Skip to contentSkip to conversation

nss: define RPATH variable

PATCH Superseded Markus Lehtonen 2 participants 3 messages Feb 12, 2016 – Feb 15, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nss: define RPATH variable

Otherwise the nss libs do not get any RPATH/RUNPATH. Consequently, the .so dependencies of nss libs are always searched from the base lib directories of the host (i.e. /lib/ and /usr/lib). This causes problems with nss-native where the .so's should be searched from the base lib directories of the sysroot instead of the host file system.

This particular problem has probably been unnoticed as nss-native is seldom used and/or most users are likely to have nss libraries installed on their host system. In this case everything most likely work as expected.

[YOCTO #9041]

---
 meta/recipes-support/nss/nss_3.21.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-support/nss/nss_3.21.bb +5 -1
index 552fd6c..8b9fb71 100644
@@ -91,12 +91,16 @@ do_compile() {
 
     export NSS_DISABLE_GTESTS=1
 
+    # Need to set RPATH so that chrpath will do its job correctly
+    RPATH="-Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE}"
+
     # We can modify CC in the environment, but if we set it via an
     # argument to make, nsinstall, a host program, will also build with it!
     #
     export CC="${CC} -g"
     make -C ./nss CCC="${CXX} -g" \
-        OS_TEST=${OS_TEST}
+        OS_TEST=${OS_TEST} \
+        RPATH="${RPATH}"
 }
 
 
Signature · 1 line
2.6.2
#1 lore raw
Quoted 24 lines · Markus Lehtonen

Otherwise the nss libs do not get any RPATH/RUNPATH. Consequently, the .so dependencies of nss libs are always searched from the base lib directories of the host (i.e. /lib/ and /usr/lib). This causes problems with nss-native where the .so's should be searched from the base lib directories of the sysroot instead of the host file system.

This particular problem has probably been unnoticed as nss-native is seldom used and/or most users are likely to have nss libraries installed on their host system. In this case everything most likely work as expected.

[YOCTO #9041]

---
 meta/recipes-support/nss/nss_3.21.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-support/nss/nss_3.21.bb +0 -0
index 552fd6c..8b9fb71 100644

meta/recipes-support/nss/nss_3.21.bb do_compile() { · line 96

Quoted 9 lines
meta/recipes-support/nss/nss_3.21.bb +2 -3
@@ -91,12 +91,16 @@ do_compile() {
 
     export NSS_DISABLE_GTESTS=1
 
+    # Need to set RPATH so that chrpath will do its job correctly
+    RPATH="-Wl,-rpath-link,${STAGING_LIBDIR_NATIVE}
-Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE}
-Wl,-rpath,${STAGING_LIBDIR_NATIVE}
-Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE}"
 

Why are you adding native paths to rpath in a target recipe? If this change is native-only, this should use the class-native override., no?

#2 lore raw
Quoted 34 lines · Christopher Larson
Quoted 32 lines · Markus Lehtonen

Otherwise the nss libs do not get any RPATH/RUNPATH. Consequently, the
.so dependencies of nss libs are always searched from the base lib directories of the host (i.e. /lib/ and /usr/lib). This causes problems
with nss-native where the .so's should be searched from the base lib
directories of the sysroot instead of the host file system.

This particular problem has probably been unnoticed as nss-native is
seldom used and/or most users are likely to have nss libraries installed
on their host system. In this case everything most likely work as expected.

[YOCTO #9041]

---
 meta/recipes-support/nss/nss_3.21.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes renamed from meta/recipes-support/nss/nss_3.21.bb +0 -1
-support/nss/nss_3.21.bb

index 552fd6c..8b9fb71 100644

meta/recipes-support/nss/nss_3.21.bb +0 -0
@@ -91,12 +91,16 @@ do_compile() {
 
     export NSS_DISABLE_GTESTS=1
 
Quoted 8 lines

meta/recipes-support/nss/nss_3.21.bb do_compile() { · line 96

Quoted 5 lines
meta/recipes-support/nss/nss_3.21.bb +2 -3
+    # Need to set RPATH so that chrpath will do its job correctly
+    RPATH="-Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} -Wl,-rpath
-link,${STAGING_BASE_LIBDIR_NATIVE} -Wl,
-rpath,${STAGING_LIBDIR_NATIVE} -Wl,
-rpath,${STAGING_BASE_LIBDIR_NATIVE}"

Why are you adding native paths to rpath in a target recipe? If this change is native-only, this should use the class-native override., no?

Very good point. There's no point setting RPATH for target environment (even if it shouldn't break anything). I was too tired when writing the final version of the patch, I guess ;) I'll send a new version, soon. Thanks,
Markus