summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/libtool/libtool
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/libtool/libtool')
-rw-r--r--meta/recipes-devtools/libtool/libtool/0003-libtool.m4-Cleanup-sysroot-trailing.patch37
-rw-r--r--meta/recipes-devtools/libtool/libtool/0006-libtool.m4-Handle-as-a-sysroot-correctly.patch33
2 files changed, 51 insertions, 19 deletions
diff --git a/meta/recipes-devtools/libtool/libtool/0003-libtool.m4-Cleanup-sysroot-trailing.patch b/meta/recipes-devtools/libtool/libtool/0003-libtool.m4-Cleanup-sysroot-trailing.patch
new file mode 100644
index 0000000000..b6175903da
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/0003-libtool.m4-Cleanup-sysroot-trailing.patch
@@ -0,0 +1,37 @@
1libtool.m4: Cleanup sysroot trailing "/"
2
3If $CC has --sysroot=/, it is a valid configuration however libtool will
4then set lt_sysroot to "/".
5
6This means references like $lt_sysroot$libdir become //usr/lib instead
7of the more normally expected /usr/lib. This may or may not break something
8but certainly is confusing to the user and gives confusing output. Making
9"/" simply unset lt_sysroot is much cleaner.
10
11Whilst here, trim any trailing '/' from sysroot paths to drop the duplication
12and result in cleaner/consistent output.
13
14* m4/libtool.m4: Cleanup sysroot trailing '/' handling
15
16Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2024-01/msg00111.html]
17Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
18
19---
20 m4/libtool.m4 | 4 +++-
21 1 file changed, 3 insertions(+), 1 deletion(-)
22
23diff --git a/m4/libtool.m4 b/m4/libtool.m4
24index fa1ae91..2f31d24 100644
25--- a/m4/libtool.m4
26+++ b/m4/libtool.m4
27@@ -1256,7 +1256,9 @@ lt_sysroot=
28 case $with_libtool_sysroot in #(
29 yes)
30 if test yes = "$GCC"; then
31- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
32+ # Trim trailing / since we'll always append absolute paths and we want
33+ # to avoid //, if only for less confusing output for the user.
34+ lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
35 fi
36 ;; #(
37 /*)
diff --git a/meta/recipes-devtools/libtool/libtool/0006-libtool.m4-Handle-as-a-sysroot-correctly.patch b/meta/recipes-devtools/libtool/libtool/0006-libtool.m4-Handle-as-a-sysroot-correctly.patch
index a221dab528..c104e904cc 100644
--- a/meta/recipes-devtools/libtool/libtool/0006-libtool.m4-Handle-as-a-sysroot-correctly.patch
+++ b/meta/recipes-devtools/libtool/libtool/0006-libtool.m4-Handle-as-a-sysroot-correctly.patch
@@ -1,34 +1,29 @@
1From: Richard Purdie <richard.purdie@linuxfoundation.org> 1libtool.m4: Change libtool to handle sysroots by default
2Subject: [PATCH 06/12] libtool.m4: Handle "/" as a sysroot correctly
3 2
4Update libtool.m4 to resolve a problem with lt_sysroot not being properly 3Rather than using no sysroot by default, always query gcc to obtain the sysroot.
5updated if the option '--with[-libtool]-sysroot' is not provided when
6running the 'configure' script for a package so that "/" as a sysroot
7is handled correctly by libtool.
8 4
9Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 5Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
10 6
11Upstream Report: 7Upstream-Status: Inappropriate [Upstream are unlikely to accept this change of default]
12http://lists.gnu.org/archive/html/bug-libtool/2013-09/msg00005.html
13 8
14Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00018.html] 9---
10 m4/libtool.m4 | 6 +++---
11 1 file changed, 3 insertions(+), 3 deletions(-)
15 12
16Index: libtool-2.4.7/m4/libtool.m4 13diff --git a/m4/libtool.m4 b/m4/libtool.m4
17=================================================================== 14index 2f31d24..bd90775 100644
18--- libtool-2.4.7.orig/m4/libtool.m4 15--- a/m4/libtool.m4
19+++ libtool-2.4.7/m4/libtool.m4 16+++ b/m4/libtool.m4
20@@ -1254,16 +1254,20 @@ dnl lt_sysroot will always be passed unq 17@@ -1254,18 +1254,18 @@ dnl lt_sysroot will always be passed unquoted. We quote it here
21 dnl in case the user passed a directory name. 18 dnl in case the user passed a directory name.
22 lt_sysroot= 19 lt_sysroot=
23 case $with_libtool_sysroot in #( 20 case $with_libtool_sysroot in #(
24- yes) 21- yes)
25+ no) 22+ no)
26 if test yes = "$GCC"; then 23 if test yes = "$GCC"; then
27 lt_sysroot=`$CC --print-sysroot 2>/dev/null` 24 # Trim trailing / since we'll always append absolute paths and we want
28+ # Treat "/" the same a an unset sysroot. 25 # to avoid //, if only for less confusing output for the user.
29+ if test "$lt_sysroot" = /; then 26 lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
30+ lt_sysroot=
31+ fi
32 fi 27 fi
33 ;; #( 28 ;; #(
34+ yes|''|/) 29+ yes|''|/)