Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 1 | From: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 2 | Subject: [PATCH 04/12] ltmain.sh: Fix sysroot paths being encoded into RPATHs |
| 3 | |
| 4 | There is a bug where RPATHs could end up containing sysroot values when |
| 5 | cross compiling which is obviously incorrect. Strip out sysroot components |
| 6 | from libdir when building RPATH values to avoid this. |
| 7 | |
| 8 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 9 | |
| 10 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00009.html] |
| 11 | |
| 12 | diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 13 | index 2c994612..96238350 100644 |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 14 | --- a/build-aux/ltmain.in |
| 15 | +++ b/build-aux/ltmain.in |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 16 | @@ -7654,9 +7654,11 @@ EOF |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 17 | test relink = "$opt_mode" || rpath=$compile_rpath$rpath |
| 18 | for libdir in $rpath; do |
| 19 | if test -n "$hardcode_libdir_flag_spec"; then |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 20 | + func_replace_sysroot "$libdir" |
| 21 | + libdir=$func_replace_sysroot_result |
| 22 | + func_stripname '=' '' "$libdir" |
| 23 | + libdir=$func_stripname_result |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 24 | if test -n "$hardcode_libdir_separator"; then |
| 25 | - func_replace_sysroot "$libdir" |
| 26 | - libdir=$func_replace_sysroot_result |
| 27 | if test -z "$hardcode_libdirs"; then |
| 28 | hardcode_libdirs=$libdir |
| 29 | else |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 30 | @@ -8386,6 +8388,10 @@ EOF |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 31 | hardcode_libdirs= |
| 32 | for libdir in $compile_rpath $finalize_rpath; do |
| 33 | if test -n "$hardcode_libdir_flag_spec"; then |
| 34 | + func_replace_sysroot "$libdir" |
| 35 | + libdir=$func_replace_sysroot_result |
| 36 | + func_stripname '=' '' "$libdir" |
| 37 | + libdir=$func_stripname_result |
| 38 | if test -n "$hardcode_libdir_separator"; then |
| 39 | if test -z "$hardcode_libdirs"; then |
| 40 | hardcode_libdirs=$libdir |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 41 | @@ -8437,6 +8443,10 @@ EOF |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 42 | hardcode_libdirs= |
| 43 | for libdir in $finalize_rpath; do |
| 44 | if test -n "$hardcode_libdir_flag_spec"; then |
| 45 | + func_replace_sysroot "$libdir" |
| 46 | + libdir=$func_replace_sysroot_result |
| 47 | + func_stripname '=' '' "$libdir" |
| 48 | + libdir=$func_stripname_result |
| 49 | if test -n "$hardcode_libdir_separator"; then |
| 50 | if test -z "$hardcode_libdirs"; then |
| 51 | hardcode_libdirs=$libdir |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 52 | -- |
| 53 | 2.25.1 |
| 54 | |