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 <cursoragent@cursor.com>
This commit is contained in:
2026-06-23 23:18:36 -04:00
parent 026ba608a1
commit 44d12eeb9e
5 changed files with 15 additions and 15 deletions
+8 -8
View File
@@ -16,10 +16,10 @@
# -p stimBuffApis/xcbWindow/ \ # -p stimBuffApis/xcbWindow/ \
# -p stimBuffApis/livoxGen1/ \ # -p stimBuffApis/livoxGen1/ \
# -p comparatorLibs/core/ \ # -p comparatorLibs/core/ \
# -a liblcameraBuff.so \ # -a liblcameraBuff.so.0 \
# -a libxcbWindow.so \ # -a libxcbWindow.so.0 \
# -a liblivoxGen1.so \ # -a liblivoxGen1.so.0 \
# -c libcomparatorCore.so \ # -c libcoreComp.so.0 \
# -d devices/bodies/dell-laptop.daps # -d devices/bodies/dell-laptop.daps
DELL_LAPTOP_SALMANOFF_ARGS=( DELL_LAPTOP_SALMANOFF_ARGS=(
@@ -30,9 +30,9 @@ DELL_LAPTOP_SALMANOFF_ARGS=(
-p stimBuffApis/xcbWindow/ -p stimBuffApis/xcbWindow/
-p stimBuffApis/livoxGen1/ -p stimBuffApis/livoxGen1/
-p comparatorLibs/core/ -p comparatorLibs/core/
-a liblcameraBuff.so -a liblcameraBuff.so.0
-a libxcbWindow.so -a libxcbWindow.so.0
-a liblivoxGen1.so -a liblivoxGen1.so.0
-c libcomparatorCore.so -c libcoreComp.so.0
-d devices/bodies/dell-laptop.daps -d devices/bodies/dell-laptop.daps
) )
+2 -2
View File
@@ -238,11 +238,11 @@ sscl::co::ViralNonPostingInvoker<int> lcameraBuff_initializeCInd()
const std::optional<std::string> libPath = const std::optional<std::string> libPath =
lcameraBuffSmoHooksPtr->searchForLibInSmoSearchPaths( lcameraBuffSmoHooksPtr->searchForLibInSmoSearchPaths(
"liblcameraDev.so"); "liblcameraDev.so.0");
lcameraDevDll.dlopenHandle.reset( lcameraDevDll.dlopenHandle.reset(
dlopen( dlopen(
libPath.value_or("liblcameraDev.so").c_str(), libPath.value_or("liblcameraDev.so.0").c_str(),
RTLD_LAZY)); RTLD_LAZY));
if (!lcameraDevDll.dlopenHandle) if (!lcameraDevDll.dlopenHandle)
@@ -187,7 +187,7 @@ TEST_F(LcameraBuffConfigureHilTest, AttachThreeYuvChannelsWithOptPlanar480p)
const char *libPathEnv = std::getenv("LCAMERADEV_LIB_PATH"); const char *libPathEnv = std::getenv("LCAMERADEV_LIB_PATH");
if (libPathEnv == nullptr || std::string(libPathEnv).empty()) 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( runOnProbeThread(
+2 -2
View File
@@ -705,9 +705,9 @@ sscl::co::ViralNonPostingInvoker<int> livoxGen1_initializeCInd()
} }
// Load LivoxProto1 library // Load LivoxProto1 library
auto libPath = smoHooksPtr->searchForLibInSmoSearchPaths("liblivoxProto1.so"); auto libPath = smoHooksPtr->searchForLibInSmoSearchPaths("liblivoxProto1.so.0");
livoxProto1.dlopenHandle.reset(dlopen( livoxProto1.dlopenHandle.reset(dlopen(
libPath.value_or("liblivoxProto1.so").c_str(), libPath.value_or("liblivoxProto1.so.0").c_str(),
RTLD_LAZY)); RTLD_LAZY));
if (!livoxProto1.dlopenHandle) { if (!livoxProto1.dlopenHandle) {
throw std::runtime_error( throw std::runtime_error(
+2 -2
View File
@@ -223,9 +223,9 @@ static sscl::co::ViralNonPostingInvoker<int> xcbWindow_initializeCInd(void)
} }
// Try to load libxcbXorg using the search path hook // 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( xcbXorg.dlopenHandle = dlopen(
libPath.value_or("libxcbXorg.so").c_str(), libPath.value_or("libxcbXorg.so.0").c_str(),
RTLD_LAZY); RTLD_LAZY);
if (!xcbXorg.dlopenHandle) if (!xcbXorg.dlopenHandle)