From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id EA33738485A3 for ; Mon, 27 Jun 2022 06:14:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA33738485A3 Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 022E96680A; Mon, 27 Jun 2022 02:14:08 -0400 (EDT) Message-ID: Subject: [PATCH 7/7] libffi: Use $EGREP instead of egrep From: Xi Ruoyao To: gcc-patches@gcc.gnu.org Cc: Rainer Orth , Arnaud Charlet , Bernhard Reutner-Fischer , Jonathan Wakely Date: Mon, 27 Jun 2022 14:14:07 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 MIME-Version: 1.0 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, GIT_PATCH_0, LIKELY_SPAM_FROM, SPF_HELO_PASS, SPF_PASS, TXREP, T_PDS_OTHER_BAD_TLD, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2022 06:14:14 -0000 Cherry-pick libffi commit 280fe78d37f58927b280e2e316a2ae19201f2b83, and regenerate configure. libffi/ChangeLog: * configure.ac: Call AC_PROG_EGREP, and use $EGREP instead of egrep. * configure: Regenerate. --- libffi/configure | 270 ++++++++++++++++++++++---------------------- libffi/configure.ac | 3 +- 2 files changed, 137 insertions(+), 136 deletions(-) diff --git a/libffi/configure b/libffi/configure index 575641cca1d..3e490ba22d1 100755 --- a/libffi/configure +++ b/libffi/configure @@ -198,6 +198,7 @@ test -x / || exit 1" as_lineno_2=3D";as_suggested=3D$as_suggested$LINENO;as_suggested=3D$as_s= uggested" as_lineno_2a=3D\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" !=3D \"x\$as_lineno_2'\$as_run'\= " && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" =3D \"x\$as_lineno_2'\$as= _run'\"' || exit 1 +test \$(( 1 + 1 )) =3D 2 || exit 1 =20 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO=3D'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\= \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\= \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' @@ -205,8 +206,7 @@ test -x / || exit 1" ECHO=3D\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=3D/empty FPATH=3D/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" =3D \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" =3D \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) =3D 2 || exit 1" + || test \"X\`print -r -- \$ECHO\`\" =3D \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=3Dyes else @@ -683,10 +683,10 @@ ac_ct_DUMPBIN DUMPBIN LD FGREP -EGREP -GREP SED LIBTOOL +EGREP +GREP am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE CCASDEPMODE @@ -5103,6 +5103,136 @@ fi =20 =20 =20 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles lo= ng lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=3Dfalse + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=3D$IFS; IFS=3D$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=3D$as_save_IFS + test -z "$as_dir" && as_dir=3D. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP=3D"$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP=3D"$ac_path_GREP" ac_path_GREP_found=3D:;; +*) + ac_count=3D0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"con= ftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=3D$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP=3D"$ac_path_GREP" + ac_path_GREP_max=3D$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=3D$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARA= TOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=3D$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP=3D"$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP=3D"$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=3Dfalse + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=3D$IFS; IFS=3D$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=3D$as_save_IFS + test -z "$as_dir" && as_dir=3D. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP=3D"$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP=3D"$ac_path_EGREP" ac_path_EGREP_found=3D:;; +*) + ac_count=3D0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null = || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=3D$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP=3D"$ac_path_EGREP" + ac_path_EGREP_max=3D$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=3D$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPAR= ATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=3D$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP=3D"$ac_cv_path_EGREP" + + case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cop= e well with whitespace in \`pwd\`" >&5 @@ -5279,136 +5409,6 @@ Xsed=3D"$SED -e 1s/^X//" =20 =20 =20 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles lo= ng lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=3Dfalse - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=3D$IFS; IFS=3D$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=3D$as_save_IFS - test -z "$as_dir" && as_dir=3D. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP=3D"$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP=3D"$ac_path_GREP" ac_path_GREP_found=3D:;; -*) - ac_count=3D0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"con= ftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=3D$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP=3D"$ac_path_GREP" - ac_path_GREP_max=3D$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=3D$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARA= TOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=3D$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP=3D"$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP=3D"$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=3Dfalse - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=3D$IFS; IFS=3D$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=3D$as_save_IFS - test -z "$as_dir" && as_dir=3D. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP=3D"$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP=3D"$ac_path_EGREP" ac_path_EGREP_found=3D:;; -*) - ac_count=3D0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null = || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=3D$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP=3D"$ac_path_EGREP" - ac_path_EGREP_max=3D$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=3D$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPAR= ATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=3D$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP=3D"$ac_cv_path_EGREP" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : @@ -16256,7 +16256,7 @@ else ac_status=3D$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 test $ac_status =3D 0; }; }; then - if egrep '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; = then + if $EGREP '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null;= then libffi_cv_hidden_visibility_attribute=3Dyes fi fi diff --git a/libffi/configure.ac b/libffi/configure.ac index 014d89d0423..b8f021cb7cb 100644 --- a/libffi/configure.ac +++ b/libffi/configure.ac @@ -54,6 +54,7 @@ AC_SUBST(CET_FLAGS) =20 AM_PROG_AS AM_PROG_CC_C_O +AC_PROG_EGREP AC_PROG_LIBTOOL =20 AC_CHECK_TOOL(READELF, readelf) @@ -290,7 +291,7 @@ if test "x$GCC" =3D "xyes"; then echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1= ; }' > conftest.c libffi_cv_hidden_visibility_attribute=3Dno if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_ME= SSAGE_LOG_FD); then - if egrep '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; = then + if $EGREP '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null;= then libffi_cv_hidden_visibility_attribute=3Dyes fi fi --=20 2.36.1