Patchwork [7/9] autotools.bbclass: Set the dynamic linker search path for libtool correctly

login
register
mail settings
Submitter Richard Purdie
Date Sept. 25, 2011, 3:56 p.m.
Message ID <6a2515b919fe6d4a7d58c39112c17111b133e27e.1316963134.git.richard.purdie@linuxfoundation.org>
Download mbox | patch
Permalink /patch/12109/
State New, archived
Headers show

Comments

Richard Purdie - Sept. 25, 2011, 3:56 p.m.
libtool obtains the search path from /etc/ld.so.conf and hardcodes /usr/lib
and /lib. This results in host contamination and variable sets of RPATH
values ending up in binaries.

By exporting the correct values for all autotools recipes we avoid this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/autotools.bbclass |    2 ++
 meta/classes/native.bbclass    |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index 8f65b70..f213c18 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -31,6 +31,8 @@  export CONFIG_SITE = "${@siteinfo_get_files(d)}"
 acpaths = "default"
 EXTRA_AUTORECONF = "--exclude=autopoint"
 
+export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}"
+
 def autotools_set_crosscompiling(d):
 	if not bb.data.inherits_class('native', d):
 		return " cross_compiling=yes"
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index 9a41f19..5e45aed 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -69,6 +69,9 @@  exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
 
 libdir = "${STAGING_DIR_NATIVE}${libdir_native}"
 
+# Libtool's default paths are correct for the native machine
+lt_cv_sys_lib_dlsearch_path_spec[unexport] = "1"
+
 NATIVE_PACKAGE_PATH_SUFFIX = ""
 bindir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
 libdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"