From 44d12eeb9e3fa2a0fe2961e616ff832ec97effe0 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Tue, 23 Jun 2026 23:18:36 -0400 Subject: [PATCH] Use shared-library sonames for runtime dlopen paths. Installed plugin libs ship libFoo.so.N without the linker namelink (libFoo.so); load by soname so snaps and NAMELINK_SKIP installs work. Co-authored-by: Cursor --- scripts/dell_laptop_salmanoff_args.inc.sh | 16 ++++++++-------- stimBuffApis/lcameraBuff/lcameraBuff.cpp | 4 ++-- .../tests/lcameraBuff_configure_hil_tests.cpp | 2 +- stimBuffApis/livoxGen1/livoxGen1.cpp | 4 ++-- stimBuffApis/xcbWindow/xcbWindow.cpp | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/dell_laptop_salmanoff_args.inc.sh b/scripts/dell_laptop_salmanoff_args.inc.sh index 5f619f6..603ccbc 100644 --- a/scripts/dell_laptop_salmanoff_args.inc.sh +++ b/scripts/dell_laptop_salmanoff_args.inc.sh @@ -16,10 +16,10 @@ # -p stimBuffApis/xcbWindow/ \ # -p stimBuffApis/livoxGen1/ \ # -p comparatorLibs/core/ \ -# -a liblcameraBuff.so \ -# -a libxcbWindow.so \ -# -a liblivoxGen1.so \ -# -c libcomparatorCore.so \ +# -a liblcameraBuff.so.0 \ +# -a libxcbWindow.so.0 \ +# -a liblivoxGen1.so.0 \ +# -c libcoreComp.so.0 \ # -d devices/bodies/dell-laptop.daps DELL_LAPTOP_SALMANOFF_ARGS=( @@ -30,9 +30,9 @@ DELL_LAPTOP_SALMANOFF_ARGS=( -p stimBuffApis/xcbWindow/ -p stimBuffApis/livoxGen1/ -p comparatorLibs/core/ - -a liblcameraBuff.so - -a libxcbWindow.so - -a liblivoxGen1.so - -c libcomparatorCore.so + -a liblcameraBuff.so.0 + -a libxcbWindow.so.0 + -a liblivoxGen1.so.0 + -c libcoreComp.so.0 -d devices/bodies/dell-laptop.daps ) diff --git a/stimBuffApis/lcameraBuff/lcameraBuff.cpp b/stimBuffApis/lcameraBuff/lcameraBuff.cpp index 39b783e..1f8cf31 100644 --- a/stimBuffApis/lcameraBuff/lcameraBuff.cpp +++ b/stimBuffApis/lcameraBuff/lcameraBuff.cpp @@ -238,11 +238,11 @@ sscl::co::ViralNonPostingInvoker lcameraBuff_initializeCInd() const std::optional libPath = lcameraBuffSmoHooksPtr->searchForLibInSmoSearchPaths( - "liblcameraDev.so"); + "liblcameraDev.so.0"); lcameraDevDll.dlopenHandle.reset( dlopen( - libPath.value_or("liblcameraDev.so").c_str(), + libPath.value_or("liblcameraDev.so.0").c_str(), RTLD_LAZY)); if (!lcameraDevDll.dlopenHandle) diff --git a/stimBuffApis/lcameraBuff/tests/lcameraBuff_configure_hil_tests.cpp b/stimBuffApis/lcameraBuff/tests/lcameraBuff_configure_hil_tests.cpp index ca08a91..0bd0372 100644 --- a/stimBuffApis/lcameraBuff/tests/lcameraBuff_configure_hil_tests.cpp +++ b/stimBuffApis/lcameraBuff/tests/lcameraBuff_configure_hil_tests.cpp @@ -187,7 +187,7 @@ TEST_F(LcameraBuffConfigureHilTest, AttachThreeYuvChannelsWithOptPlanar480p) const char *libPathEnv = std::getenv("LCAMERADEV_LIB_PATH"); if (libPathEnv == nullptr || std::string(libPathEnv).empty()) { - GTEST_SKIP() << "Set LCAMERADEV_LIB_PATH to liblcameraDev.so for HIL attach"; + GTEST_SKIP() << "Set LCAMERADEV_LIB_PATH to liblcameraDev.so.0 for HIL attach"; } runOnProbeThread( diff --git a/stimBuffApis/livoxGen1/livoxGen1.cpp b/stimBuffApis/livoxGen1/livoxGen1.cpp index a397715..02ad345 100644 --- a/stimBuffApis/livoxGen1/livoxGen1.cpp +++ b/stimBuffApis/livoxGen1/livoxGen1.cpp @@ -705,9 +705,9 @@ sscl::co::ViralNonPostingInvoker livoxGen1_initializeCInd() } // Load LivoxProto1 library - auto libPath = smoHooksPtr->searchForLibInSmoSearchPaths("liblivoxProto1.so"); + auto libPath = smoHooksPtr->searchForLibInSmoSearchPaths("liblivoxProto1.so.0"); livoxProto1.dlopenHandle.reset(dlopen( - libPath.value_or("liblivoxProto1.so").c_str(), + libPath.value_or("liblivoxProto1.so.0").c_str(), RTLD_LAZY)); if (!livoxProto1.dlopenHandle) { throw std::runtime_error( diff --git a/stimBuffApis/xcbWindow/xcbWindow.cpp b/stimBuffApis/xcbWindow/xcbWindow.cpp index 707e147..ed2887c 100644 --- a/stimBuffApis/xcbWindow/xcbWindow.cpp +++ b/stimBuffApis/xcbWindow/xcbWindow.cpp @@ -223,9 +223,9 @@ static sscl::co::ViralNonPostingInvoker xcbWindow_initializeCInd(void) } // Try to load libxcbXorg using the search path hook - auto libPath = smoHooksPtr->searchForLibInSmoSearchPaths("libxcbXorg.so"); + auto libPath = smoHooksPtr->searchForLibInSmoSearchPaths("libxcbXorg.so.0"); xcbXorg.dlopenHandle = dlopen( - libPath.value_or("libxcbXorg.so").c_str(), + libPath.value_or("libxcbXorg.so.0").c_str(), RTLD_LAZY); if (!xcbXorg.dlopenHandle)