Current versions of GNU ld print "warning" with a lowercase 'w' so
adjust the grep patter. Also use LC_ALL=C to ensure the warning isn't
translated.
Because m4 uses square brackets as quotes, we need to use double
brackets in the grep pattern to expand to "[Ww]" in the configure
script.
libstdc++-v3/ChangeLog:
PR libstdc++/126452
* acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Use LC_ALL_C and
match both "Warning" and "warning" in ld output.
* configure: Regenerate.
---
Built on x86_64-linux and the config result is unchanged:
checking for ld that supports -Wl,--gc-sections... yes
libstdc++-v3/acinclude.m4 | 4 ++--
libstdc++-v3/configure | 36 ++++++++++++++++++------------------
2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 7942ce0ffa21..8c44e618cb84 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -262,8 +262,8 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[[Ww]]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 96e3298a28b7..577640fcb758 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -23173,8 +23173,8 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[Ww]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
@@ -29102,8 +29102,8 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[Ww]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
@@ -32236,8 +32236,8 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[Ww]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
@@ -38361,8 +38361,8 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[Ww]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
@@ -38652,8 +38652,8 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[Ww]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
@@ -39119,8 +39119,8 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[Ww]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
@@ -42516,8 +42516,8 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[Ww]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
@@ -45866,8 +45866,8 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[Ww]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
@@ -46082,8 +46082,8 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conftest.c
touch conftest.c
if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
+ if LC_ALL=C $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "[Ww]arning: gc-sections option ignored" > /dev/null; then
ac_gcsections=no
fi
fi
--
2.55.0