[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/12] ltmain.sh: Fix sysroot paths being encoded into RPATHs
From: |
Richard Purdie |
Subject: |
[PATCH 04/12] ltmain.sh: Fix sysroot paths being encoded into RPATHs |
Date: |
Mon, 25 Oct 2021 15:33:29 +0100 |
There is a bug where RPATHs could end up containing sysroot values when
cross compiling which is obviously incorrect. Strip out sysroot components
from libdir when building RPATH values to avoid this.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
build-aux/ltmain.in | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 2c994612..96238350 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -7654,9 +7654,11 @@ EOF
test relink = "$opt_mode" || rpath=$compile_rpath$rpath
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ func_stripname '=' '' "$libdir"
+ libdir=$func_stripname_result
if test -n "$hardcode_libdir_separator"; then
- func_replace_sysroot "$libdir"
- libdir=$func_replace_sysroot_result
if test -z "$hardcode_libdirs"; then
hardcode_libdirs=$libdir
else
@@ -8386,6 +8388,10 @@ EOF
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ func_stripname '=' '' "$libdir"
+ libdir=$func_stripname_result
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs=$libdir
@@ -8437,6 +8443,10 @@ EOF
hardcode_libdirs=
for libdir in $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ func_stripname '=' '' "$libdir"
+ libdir=$func_stripname_result
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs=$libdir
--
2.25.1
- [PATCH 00/12] Yocto Project libtool patch queue, Richard Purdie, 2021/10/25
- [PATCH 04/12] ltmain.sh: Fix sysroot paths being encoded into RPATHs,
Richard Purdie <=
- [PATCH 01/12] ltmain.in: Handle trailing slashes on install commands correctly, Richard Purdie, 2021/10/25
- [PATCH 12/12] libtool.m4: For reproducibility stop encoding hostname in libtool script, Richard Purdie, 2021/10/25
- [PATCH 05/12] ltmain.in: Don't encode RATHS which match default linker paths, Richard Purdie, 2021/10/25
- [PATCH 02/12] libtool.m4: Rename the --with-sysroot option to avoid conflict with gcc/binutils, Richard Purdie, 2021/10/25
- [PATCH 09/12] Makefile.am: make sure autoheader run before autoconf, Richard Purdie, 2021/10/25
- [PATCH 08/12] libtool: Check for static libs for internal compiler libraries, Richard Purdie, 2021/10/25
- [PATCH 03/12] ltmain.in: Add missing sysroot to library path, Richard Purdie, 2021/10/25
- [PATCH 06/12] libtool.m4: Handle "/" as a sysroot correctly, Richard Purdie, 2021/10/25
- [PATCH 11/12] ltmain.in: Handle prefix-map compiler options correctly, Richard Purdie, 2021/10/25
- [PATCH 10/12] Makefile.am: make sure autoheader run before automake, Richard Purdie, 2021/10/25