From bb6e526657e9c03dd3be954123c091a001c06811 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 19 Sep 2022 13:22:53 -0700 Subject: [PATCH 1/2] libtool: port to GNU grep 3.8 Origin: other, https://savannah.gnu.org/patch/index.php?10282 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019725 Last-Update: 2022-09-22 * m4/libtool.m4 (_LT_LANG_CXX_CONFIG): Do not use \- in a BRE or ERE, as this produces undefined results that GNU grep 3.8 warns about. Use [-] instead. * tests/link-order.at (Link order test): Similarly, do not use \/ in an ERE; use / instead. --- m4/libtool.m4 | 12 ++++++------ tests/link-order.at | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) Index: libtool/m4/libtool.m4 =================================================================== --- libtool.orig/m4/libtool.m4 +++ libtool/m4/libtool.m4 @@ -6469,7 +6469,7 @@ if test yes != "$_lt_caught_CXX_error"; # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else GXX=no @@ -6845,7 +6845,7 @@ if test yes != "$_lt_caught_CXX_error"; # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -6910,7 +6910,7 @@ if test yes != "$_lt_caught_CXX_error"; # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -7249,7 +7249,7 @@ if test yes != "$_lt_caught_CXX_error"; # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else # FIXME: insert proper C++ library support @@ -7333,7 +7333,7 @@ if test yes != "$_lt_caught_CXX_error"; # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. Index: libtool/tests/link-order.at =================================================================== --- libtool.orig/tests/link-order.at +++ libtool/tests/link-order.at @@ -99,12 +99,12 @@ aix* | interix*) ;; # These systems hav case $hardcode_direct$hardcode_direct_absolute in yesno) AT_CHECK([if $EGREP relinking stderr; then - $EGREP " .*\/new\/lib/libb$shared_ext .*\/old\/lib/libcee$shared_ext" stdout + $EGREP " .*/new/lib/libb$shared_ext .*/old/lib/libcee$shared_ext" stdout else :; fi], [0], [ignore], [], [echo "wrong link order"]) ;; *) AT_CHECK([if $EGREP relinking stderr; then - $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout + $EGREP " -L.*/new/lib -lb -L.*/old/lib -lcee" stdout else :; fi], [0], [ignore], [], [echo "wrong link order"]) ;; esac