summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorLi Wang <li.wang@windriver.com>2021-11-30 14:51:11 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-01 16:23:45 +0000
commit7d2b8ac293c092491eb6a547728a4a687e4b93b1 (patch)
treec07d2dcfe1b1086bf8d410169ee4f70423d6e566 /meta/recipes-devtools
parent0e733283f69b2ba07c89711df5c8ac57d7af04c3 (diff)
downloadpoky-7d2b8ac293c092491eb6a547728a4a687e4b93b1.tar.gz
libtool: change the default AR_FLAGS from "cru" to "cr"
Backport patch to fix warning: `u' modifier ignored since `D' is the default (see `U') (From OE-Core rev: 3d5092e7ee63fb8119a22b3d9de1f23e94791b56) Signed-off-by: Li Wang <li.wang@windriver.com> Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/libtool/libtool-2.4.6.inc2
-rw-r--r--meta/recipes-devtools/libtool/libtool/ARFLAGS-use-cr-instead-of-cru-by-default.patch133
-rw-r--r--meta/recipes-devtools/libtool/libtool/libool.m4-add-ARFLAGS-variable.patch77
3 files changed, 212 insertions, 0 deletions
diff --git a/meta/recipes-devtools/libtool/libtool-2.4.6.inc b/meta/recipes-devtools/libtool/libtool-2.4.6.inc
index 2df46aa773..a636926ef9 100644
--- a/meta/recipes-devtools/libtool/libtool-2.4.6.inc
+++ b/meta/recipes-devtools/libtool/libtool-2.4.6.inc
@@ -24,6 +24,8 @@ SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \
24 file://0010-Makefile.am-make-sure-autoheader-run-before-automake.patch \ 24 file://0010-Makefile.am-make-sure-autoheader-run-before-automake.patch \
25 file://0011-ltmain.in-Handle-prefix-map-compiler-options-correct.patch \ 25 file://0011-ltmain.in-Handle-prefix-map-compiler-options-correct.patch \
26 file://0012-libtool.m4-For-reproducibility-stop-encoding-hostnam.patch \ 26 file://0012-libtool.m4-For-reproducibility-stop-encoding-hostnam.patch \
27 file://libool.m4-add-ARFLAGS-variable.patch \
28 file://ARFLAGS-use-cr-instead-of-cru-by-default.patch \
27 " 29 "
28 30
29SRC_URI[md5sum] = "addf44b646ddb4e3919805aa88fa7c5e" 31SRC_URI[md5sum] = "addf44b646ddb4e3919805aa88fa7c5e"
diff --git a/meta/recipes-devtools/libtool/libtool/ARFLAGS-use-cr-instead-of-cru-by-default.patch b/meta/recipes-devtools/libtool/libtool/ARFLAGS-use-cr-instead-of-cru-by-default.patch
new file mode 100644
index 0000000000..447640cef6
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/ARFLAGS-use-cr-instead-of-cru-by-default.patch
@@ -0,0 +1,133 @@
1From 418129bc63afc312701e84cb8afa5ca413df1ab5 Mon Sep 17 00:00:00 2001
2From: Pavel Raiskup <praiskup@redhat.com>
3Date: Fri, 17 Apr 2015 16:54:58 +0200
4Subject: ARFLAGS: use 'cr' instead of 'cru' by default
5
6In some GNU/Linux distributions people started to compile 'ar'
7binary with --enable-deterministic-archives (binutils project).
8That, however, in combination with our previous long time working
9default AR_FLAGS=cru causes warnings on such installations:
10ar: `u' modifier ignored since `D' is the default (see `U')
11
12The 'u' option (at least with GNU binutils) did small optimization
13during repeated builds because it instructed 'ar' to not
14open/close unchanged *.o files and to rather read their contents
15from old archive file. However, its removal should not cause a
16big performance hit for usual workflows.
17
18Distributions started using --enable-deterministic-archives
19knowing that it would disable the 'u', just to rather have a bit
20more deterministic builds.
21
22Also, to justify this change a bit more, keeping 'u' in ARFLAGS
23could only result in many per-project changes to override
24Libtool's ARFLAGS default, just to silent such warnings.
25
26Fixes bug#19967. Reported by Eric Blake.
27
28* m4/libtool.m4 (_LT_PROG_AR): Default AR_FLAGS to 'cr'.
29(_LT_REQUIRED_DARWIN_CHECKS): Use $AR_FLAGS instead 'cru' string.
30* doc/libtool.texi: Do 's/ar cru/ar cr/' in whole documentation.
31* NEWS: Document.
32
33Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/libtool.git/commit/?id=418129bc63afc312701e84cb8afa5ca413df1ab5]
34
35Signed-off-by: Li Wang <li.wang@windriver.com>
36Signed-off-by: Changqing Li <changqing.li@windriver.com>
37---
38 NEWS | 4 ++++
39 doc/libtool.texi | 10 +++++-----
40 m4/libtool.m4 | 6 +++---
41 3 files changed, 12 insertions(+), 8 deletions(-)
42
43diff --git a/NEWS b/NEWS
44index 71a932d..1518f09 100644
45--- a/NEWS
46+++ b/NEWS
47@@ -13,6 +13,10 @@ NEWS - list of user-visible changes between releases of GNU Libtool
48 variable, which obsoletes AR_FLAGS. This is due to naming conventions
49 among other *FLAGS and to be consistent with Automake's ARFLAGS.
50
51+** Important incompatible changes:
52+
53+ - Libtool changed ARFLAGS/AR_FLAGS default from 'cru' to 'cr'.
54+
55 ** Bug fixes:
56
57 - Fix a race condition in ltdl dryrun test that would cause spurious
58diff --git a/doc/libtool.texi b/doc/libtool.texi
59index 0298627..4c664bb 100644
60--- a/doc/libtool.texi
61+++ b/doc/libtool.texi
62@@ -602,7 +602,7 @@ Without libtool, the programmer would invoke the @command{ar} command to
63 create a static library:
64
65 @example
66-burger$ @kbd{ar cru libhello.a hello.o foo.o}
67+burger$ @kbd{ar cr libhello.a hello.o foo.o}
68 burger$
69 @end example
70
71@@ -632,7 +632,7 @@ libtool are the same ones you would use to produce an executable named
72 a23$ @kbd{libtool --mode=link gcc -g -O -o libhello.la foo.o hello.o}
73 *** Warning: Linking the shared library libhello.la against the
74 *** non-libtool objects foo.o hello.o is not portable!
75-ar cru .libs/libhello.a
76+ar cr .libs/libhello.a
77 ranlib .libs/libhello.a
78 creating libhello.la
79 (cd .libs && rm -f libhello.la && ln -s ../libhello.la libhello.la)
80@@ -662,7 +662,7 @@ archive, not a shared library (@pxref{Static libraries}).}:
81 @example
82 a23$ @kbd{libtool --mode=link gcc -g -O -o libhello.la foo.lo hello.lo \
83 -rpath /usr/local/lib -lm}
84-ar cru @value{objdir}/libhello.a foo.o hello.o
85+ar cr @value{objdir}/libhello.a foo.o hello.o
86 ranlib @value{objdir}/libhello.a
87 creating libhello.la
88 (cd @value{objdir} && rm -f libhello.la && ln -s ../libhello.la libhello.la)
89@@ -676,7 +676,7 @@ burger$ @kbd{libtool --mode=link gcc -g -O -o libhello.la foo.lo hello.lo \
90 -rpath /usr/local/lib -lm}
91 rm -fr @value{objdir}/libhello.a @value{objdir}/libhello.la
92 ld -Bshareable -o @value{objdir}/libhello.so.0.0 @value{objdir}/foo.o @value{objdir}/hello.o -lm
93-ar cru @value{objdir}/libhello.a foo.o hello.o
94+ar cr @value{objdir}/libhello.a foo.o hello.o
95 ranlib @value{objdir}/libhello.a
96 creating libhello.la
97 (cd @value{objdir} && rm -f libhello.la && ln -s ../libhello.la libhello.la)
98@@ -6001,7 +6001,7 @@ in cases where it is necessary.
99 @subsection Archivers
100
101 On all known systems, building a static library can be accomplished by
102-running @kbd{ar cru lib@var{name}.a @var{obj1}.o @var{obj2}.o @dots{}},
103+running @kbd{ar cr lib@var{name}.a @var{obj1}.o @var{obj2}.o @dots{}},
104 where the @file{.a} file is the output library, and each @file{.o} file is an
105 object file.
106
107diff --git a/m4/libtool.m4 b/m4/libtool.m4
108index 6514196..add06ee 100644
109--- a/m4/libtool.m4
110+++ b/m4/libtool.m4
111@@ -1041,8 +1041,8 @@ int forced_loaded() { return 2;}
112 _LT_EOF
113 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
114 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
115- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
116- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
117+ echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
118+ $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
119 echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
120 $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
121 cat > conftest.c << _LT_EOF
122@@ -1505,7 +1505,7 @@ _LT_DECL([], [AR], [1], [The archiver])
123 # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
124 # variable obsoleted/removed.
125
126-test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cru}
127+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
128 lt_ar_flags=$AR_FLAGS
129 _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
130
131--
1322.23.0
133
diff --git a/meta/recipes-devtools/libtool/libtool/libool.m4-add-ARFLAGS-variable.patch b/meta/recipes-devtools/libtool/libtool/libool.m4-add-ARFLAGS-variable.patch
new file mode 100644
index 0000000000..bb11887cda
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/libool.m4-add-ARFLAGS-variable.patch
@@ -0,0 +1,77 @@
1From 4335de1dfb7d2ec728427e07a54136b94a2d40f6 Mon Sep 17 00:00:00 2001
2From: Pavel Raiskup <praiskup@redhat.com>
3Date: Fri, 17 Apr 2015 15:05:42 +0200
4Subject: libool.m4: add ARFLAGS variable
5
6Libtool has used $AR_FLAGS since 2000-05-29 commit
78300de4c54e6f04f0d, Automake ARFLAGS since 2003-04-06 commit
8a71b3490639831ca. Even though ARFLAGS is younger, it sounds like
9better name according GNU Coding Standards.
10
11Related to bug#20082.
12
13* m4/libtool.m4 (_LT_PROG_AR): Copy ARFLAGS value into AR_FLAGS
14variable if AR_FLAGS is not set. Add new _LT_DECL'ed variable
15'lt_ar_flags' to keep the configure-time value of AR_FLAGS. The
16new 'lt_ar_flags' is to be used as the default value for AR_FLAGS
17at libtool-runtime.
18* NEWS: Document.
19
20Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/libtool.git/commit/?id=4335de1dfb7d2ec728427e07a54136b94a2d40f6]
21
22Signed-off-by: Li Wang <li.wang@windriver.com>
23Signed-off-by: Changqing Li <changqing.li@windriver.com>
24---
25 NEWS | 6 ++++++
26 m4/libtool.m4 | 17 +++++++++++++++--
27 2 files changed, 21 insertions(+), 2 deletions(-)
28
29diff --git a/NEWS b/NEWS
30index d7ca434..71a932d 100644
31--- a/NEWS
32+++ b/NEWS
33@@ -7,6 +7,12 @@ NEWS - list of user-visible changes between releases of GNU Libtool
34 - LT_SYS_LIBRARY_PATH can be set in config.site, or at configure time
35 and persists correctly in the generated libtool script.
36
37+** New features:
38+
39+ - Libtool script now supports (configure-time and runtime) ARFLAGS
40+ variable, which obsoletes AR_FLAGS. This is due to naming conventions
41+ among other *FLAGS and to be consistent with Automake's ARFLAGS.
42+
43 ** Bug fixes:
44
45 - Fix a race condition in ltdl dryrun test that would cause spurious
46diff --git a/m4/libtool.m4 b/m4/libtool.m4
47index 63acd09..6514196 100644
48--- a/m4/libtool.m4
49+++ b/m4/libtool.m4
50@@ -1497,9 +1497,22 @@ need_locks=$enable_libtool_lock
51 m4_defun([_LT_PROG_AR],
52 [AC_CHECK_TOOLS(AR, [ar], false)
53 : ${AR=ar}
54-: ${AR_FLAGS=cru}
55 _LT_DECL([], [AR], [1], [The archiver])
56-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
57+
58+# Use ARFLAGS variable as AR's operation code to sync the variable naming with
59+# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
60+# higher priority because thats what people were doing historically (setting
61+# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
62+# variable obsoleted/removed.
63+
64+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cru}
65+lt_ar_flags=$AR_FLAGS
66+_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
67+
68+# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
69+# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
70+_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
71+ [Flags to create an archive])
72
73 AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
74 [lt_cv_ar_at_file=no
75--
762.23.0
77