Skip to content

Fix eigen ODR violations on exported shared library

Mateo de Mayo requested to merge mateosss/exports into xrtslam

Turns the old basalt shared target into a basalt_internal static target so that all basalt_* binaries keep working. It then generates a new basalt shared library that only exports the symbols from slam_tracker.hpp through a linker version script. This fixes eigen-related crashes due to ODR violations in which Eigen definitions were being exported but they could be different from Monado's version of eigen/compilation flags.

The output of nm -gC --defined-only $bsltinstall/lib/libbasalt.so is now just

0000000000000000 A LIBXRTSLAM_BASALT_4.0.0
000000000004e610 T xrt::auxiliary::tracking::slam::slam_tracker::initialize()
000000000004d280 T xrt::auxiliary::tracking::slam::slam_tracker::is_running()
000000000004e110 T xrt::auxiliary::tracking::slam::slam_tracker::push_frame(xrt::auxiliary::tracking::slam::img_sample const&)
000000000004e120 T xrt::auxiliary::tracking::slam::slam_tracker::use_feature(int, std::shared_ptr<void> const&, std::shared_ptr<void>&)
000000000004d660 T xrt::auxiliary::tracking::slam::slam_tracker::push_imu_sample(xrt::auxiliary::tracking::slam::imu_sample const&)
000000000004d2a0 T xrt::auxiliary::tracking::slam::slam_tracker::supports_feature(int)
000000000004d8d0 T xrt::auxiliary::tracking::slam::slam_tracker::try_dequeue_pose(xrt::auxiliary::tracking::slam::pose&)
000000000004d420 T xrt::auxiliary::tracking::slam::slam_tracker::stop()
000000000004f080 T xrt::auxiliary::tracking::slam::slam_tracker::start()
000000000004d340 T xrt::auxiliary::tracking::slam::slam_tracker::finalize()
000000000004f090 T xrt::auxiliary::tracking::slam::slam_tracker::slam_tracker(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
000000000004f090 T xrt::auxiliary::tracking::slam::slam_tracker::slam_tracker(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
000000000004ecb0 T xrt::auxiliary::tracking::slam::slam_tracker::~slam_tracker()
000000000004ecb0 T xrt::auxiliary::tracking::slam::slam_tracker::~slam_tracker()
00000000005866e8 R xrt::auxiliary::tracking::slam::IMPLEMENTATION_VERSION_MAJOR
00000000005866e4 R xrt::auxiliary::tracking::slam::IMPLEMENTATION_VERSION_MINOR
00000000005866e0 R xrt::auxiliary::tracking::slam::IMPLEMENTATION_VERSION_PATCH

Merge request reports

Loading