From patchwork Mon Jun 27 06:07:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 55420 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B85E4386C581 for ; Mon, 27 Jun 2022 06:07:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B85E4386C581 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656310056; bh=UBeJuBmpBxDCuiZqWXSICIIwjJnXkRjsdWZeqn6lBRs=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=cskPtO64Wk3cuIpXgoavOXhRFL0Ce9Yj97eDa4VI4tiyWmtuCNjmi2BiVJ/YPDy7f ZSQXF+o2sqGtpkgKRpkHQevE4ipRwQ+H1vaivLJ7AkTtCIB4JGatWA+OOgDIEQJG3T zYqJ/pEs92L2EiGMhxBmLaOSSgjRa1eogy7ZDpQE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 03E30385740D; Mon, 27 Jun 2022 06:07:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 03E30385740D Received: from [192.168.124.21] (unknown [113.140.11.126]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 965AD66807; Mon, 27 Jun 2022 02:07:03 -0400 (EDT) Message-ID: <227ea157c8576df47a9d016f5f25b7c6feaee53e.camel@xry111.site> Subject: [PATCH v2 1/7] config: use $EGREP instead of egrep To: gcc-patches@gcc.gnu.org Date: Mon, 27 Jun 2022 14:07:01 +0800 In-Reply-To: References: User-Agent: Evolution 3.44.2 MIME-Version: 1.0 X-Spam-Status: No, score=-5.8 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, RCVD_IN_BARRACUDACENTRAL, SCC_5_SHORT_WORD_LINES, 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-Patchwork-Original-From: Xi Ruoyao via Gcc-patches From: Xi Ruoyao Reply-To: Xi Ruoyao Cc: Bernhard Reutner-Fischer , Jonathan Wakely , libstdc++@gcc.gnu.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" egrep has been deprecated in favor of grep -E for a long time, and the next GNU grep release (3.8 or 4.0) will print a warning if egrep is used. Unfortunately, old hosts with non-GNU grep may lack the support for -E option. Use AC_PROG_EGREP and $EGREP variable so we'll work fine on both old and new platforms. ChangeLog: * configure.ac: Call AC_PROG_EGREP, and use $EGREP instead of egrep. * config.rpath: Use $EGREP instead of egrep. * configure: Regenerate. config/ChangeLog: * lib-ld.m4 (AC_LIB_PROG_LD_GNU): Call AC_PROG_EGREP, and use $EGREP instead of egrep. (acl_cv_path_LD): Likewise. * lib-link.m4 (AC_LIB_RPATH): Call AC_PROG_EGREP, and pass $EGREP to config.rpath. gcc/ChangeLog: * configure: Regenerate. intl/ChangeLog: * configure: Regenerate. libcpp/ChangeLog: * configure: Regenerate. libgcc/ChangeLog: * configure: Regenerate. libstdc++-v3/ChangeLog: * configure: Regenerate. --- config.rpath | 10 +-- config/lib-ld.m4 | 6 +- config/lib-link.m4 | 4 +- configure | 136 ++++++++++++++++++++++++++++++++++++++++- configure.ac | 5 +- gcc/configure | 13 ++-- intl/configure | 9 +-- libcpp/configure | 9 +-- libgcc/configure | 2 +- libstdc++-v3/configure | 9 +-- 10 files changed, 172 insertions(+), 31 deletions(-) diff --git a/config.rpath b/config.rpath index 4dea75957c2..4ada7468c22 100755 --- a/config.rpath +++ b/config.rpath @@ -29,7 +29,7 @@ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# The environment variables CC, GCC, EGREP, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. @@ -143,7 +143,7 @@ if test "$with_gnu_ld" = yes; then ld_shlibs=no ;; beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no @@ -162,9 +162,9 @@ if test "$with_gnu_ld" = yes; then netbsd*) ;; solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + if $LD -v 2>&1 | $EGREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + elif $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no @@ -174,7 +174,7 @@ if test "$with_gnu_ld" = yes; then hardcode_direct=yes ;; *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no diff --git a/config/lib-ld.m4 b/config/lib-ld.m4 index 11d0ce77342..88a014b7a74 100644 --- a/config/lib-ld.m4 +++ b/config/lib-ld.m4 @@ -14,7 +14,8 @@ dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then +AC_REQUIRE([AC_PROG_EGREP])dnl +if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no @@ -28,6 +29,7 @@ AC_DEFUN([AC_LIB_PROG_LD], [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl # Prepare PATH_SEPARATOR. # The user is always right. @@ -88,7 +90,7 @@ AC_CACHE_VAL(acl_cv_path_LD, # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break diff --git a/config/lib-link.m4 b/config/lib-link.m4 index 20e281fd323..5bbbd999de0 100644 --- a/config/lib-link.m4 +++ b/config/lib-link.m4 @@ -99,8 +99,10 @@ AC_DEFUN([AC_LIB_RPATH], AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_REQUIRE([AC_PROG_EGREP]) dnl we use $GREP AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" EGREP="$EGREP" \ + with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh diff --git a/configure b/configure index 5dcaab14ae9..e0f9a0708ea 100755 --- a/configure +++ b/configure @@ -724,6 +724,8 @@ target_subdir host_subdir build_subdir build_libsubdir +EGREP +GREP AWK SED LN_S @@ -2763,6 +2765,136 @@ fi test -n "$AWK" && break done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long 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=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$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="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $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" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$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="$ac_path_GREP" + ac_path_GREP_max=$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=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$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="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$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="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $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=$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="$ac_path_EGREP" + ac_path_EGREP_max=$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=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$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="$ac_cv_path_EGREP" + + srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` @@ -9448,7 +9580,7 @@ if test x${use_gnu_as} = x && fi if test x${use_gnu_ld} = x && - echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then + echo " ${configdirs} " | $EGREP " (go)?ld " > /dev/null 2>&1 ; then with_gnu_ld=yes extra_host_args="$extra_host_args --with-gnu-ld" fi @@ -10620,7 +10752,7 @@ case " $build_configdirs " in # For an installed makeinfo, we require it to be from texinfo 4.7 or # higher, else we use the "missing" dummy. if ${MAKEINFO} --version \ - | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then + | $EGREP 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then : else MAKEINFO="$MISSING makeinfo" diff --git a/configure.ac b/configure.ac index 85977482aee..19d34edba1c 100644 --- a/configure.ac +++ b/configure.ac @@ -88,6 +88,7 @@ ACX_PROG_LN AC_PROG_LN_S AC_PROG_SED AC_PROG_AWK +AC_PROG_EGREP srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` @@ -2634,7 +2635,7 @@ if test x${use_gnu_as} = x && fi if test x${use_gnu_ld} = x && - echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then + echo " ${configdirs} " | $EGREP " (go)?ld " > /dev/null 2>&1 ; then with_gnu_ld=yes extra_host_args="$extra_host_args --with-gnu-ld" fi @@ -3549,7 +3550,7 @@ changequote(,) # For an installed makeinfo, we require it to be from texinfo 4.7 or # higher, else we use the "missing" dummy. if ${MAKEINFO} --version \ - | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then + | $EGREP 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then : else MAKEINFO="$MISSING makeinfo" diff --git a/gcc/configure b/gcc/configure index f43dc989d02..c58ec9b2273 100755 --- a/gcc/configure +++ b/gcc/configure @@ -11160,7 +11160,7 @@ else # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -11188,7 +11188,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then +if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no @@ -11200,13 +11200,14 @@ with_gnu_ld=$acl_cv_prog_gnu_ld - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" EGREP="$EGREP" \ + with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh @@ -19674,7 +19675,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19679 "configure" +#line 19678 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19780,7 +19781,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19785 "configure" +#line 19784 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/intl/configure b/intl/configure index 03f40487a92..3caa5a51940 100755 --- a/intl/configure +++ b/intl/configure @@ -5090,7 +5090,7 @@ else # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -5118,7 +5118,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then +if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no @@ -5130,13 +5130,14 @@ with_gnu_ld=$acl_cv_prog_gnu_ld - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" EGREP="$EGREP" \ + with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh diff --git a/libcpp/configure b/libcpp/configure index 75145390215..800b0bad595 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -6807,7 +6807,7 @@ else # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -6835,7 +6835,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then +if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no @@ -6847,13 +6847,14 @@ with_gnu_ld=$acl_cv_prog_gnu_ld - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" EGREP="$EGREP" \ + with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh diff --git a/libgcc/configure b/libgcc/configure index 61f3ace2891..181420e67f2 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -5032,7 +5032,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then +if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index eac60392121..f715029375b 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -28473,7 +28473,7 @@ else # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -28501,7 +28501,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then +if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no @@ -28513,13 +28513,14 @@ with_gnu_ld=$acl_cv_prog_gnu_ld - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" EGREP="$EGREP" \ + with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh From patchwork Mon Jun 27 06:09:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 55421 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 26593386DC67 for ; Mon, 27 Jun 2022 06:09:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26593386DC67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656310180; bh=AIdo9TsUG3uSy25q+8qSEbJuYHqzYPagkDsvQowNjHw=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=kYJnj7KDrgXCiL/ZAwd/78Kcd2UkDBX3Q0KaurpxTuAgASacktFQaGPfxg0TbK3PY IJugYGLbgj2ZEc6J3cZhApNX6HP/9jQHhh3u3pAy9SWd0Tc2S6yo+HI27VwixZl2Ck L7vFuZIiMQXsKtQkBl5uCyO9/tRJPdZLT8h0CsCo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id CA15E385740D for ; Mon, 27 Jun 2022 06:09:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CA15E385740D Received: from [192.168.124.21] (unknown [113.140.11.126]) (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 9E93766807; Mon, 27 Jun 2022 02:09:08 -0400 (EDT) Message-ID: <7fb2f97f1bd0dacf2eab76849412c1dcda42874f.camel@xry111.site> Subject: [PATCH v2 2/7] fixincludes: use grep instead of egrep/fgrep To: gcc-patches@gcc.gnu.org Date: Mon, 27 Jun 2022 14:09:06 +0800 In-Reply-To: References: User-Agent: Evolution 3.44.2 MIME-Version: 1.0 X-Spam-Status: No, score=-6.5 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, RCVD_IN_BARRACUDACENTRAL, 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-Patchwork-Original-From: Xi Ruoyao via Gcc-patches From: Xi Ruoyao Reply-To: Xi Ruoyao Cc: Bernhard Reutner-Fischer , Jonathan Wakely Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" egrep/fgrep has been deprecated in favor of grep -E/-F for a long time, and the next grep release (3.8 or 4.0) will print a warning if egrep or fgrep is used. Stop using egrep and fgrep so we won't see the warning. But, we can't simply replace egrep to grep -E or fgrep to grep -F or the build will break with some non-GNU grep implementations (lacking -E or -F support). autoconf documentation suggests to use AC_PROG_EGREP and $EGREP or AC_PROG_FGREP and FGREP, but doing so is too complicated for fixincludes. So we simply adjust the patterns for a plain grep, instead of relying on the behavior of grep -E/-F. Q: Why "[ \t][ \t]*" instead of "[ \t]\\+"? A: POSIX does not allow escaping + in BRE. fixincludes/ChangeLog: * fixinc.in: Use grep instead of egrep. * inclhack.def: Use grep instead of egrep, and adjust an regular expression to make it a BRE. * genfixes: Use grep instead of egrep, and escape "." in the pattern. * fixincl.x: Regenerate. --- fixincludes/fixinc.in | 2 +- fixincludes/fixincl.x | 10 +++++----- fixincludes/genfixes | 2 +- fixincludes/inclhack.def | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in index 0bd8027a554..a4cd3d0fbb4 100755 --- a/fixincludes/fixinc.in +++ b/fixincludes/fixinc.in @@ -448,7 +448,7 @@ while [ $# != 0 ]; do chmod a+r $3 2>/dev/null if test $VERBOSE -gt 2 then echo Copied $2 ; fi - for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | + for include in `grep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'` do dir=`echo $2 | sed -e s'|/[^/]*$||'` diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index bad490453b7..c9b4cf504f2 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed February 27, 2022 at 07:47:03 PM by AutoGen 5.18.16 + * It has been AutoGen-ed June 25, 2022 at 12:44:14 PM by AutoGen 5.18.16 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Feb 27 19:47:03 UTC 2022 +/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Jun 25 12:44:14 CST 2022 * * You must regenerate it. Use the ./genfixes script. * @@ -6547,7 +6547,7 @@ static tTestDesc aMath_Huge_Val_From_Dbl_MaxTests[] = { * Fix Command Arguments for Math_Huge_Val_From_Dbl_Max */ static const char* apzMath_Huge_Val_From_Dbl_MaxPatch[] = { "sh", "-c", - "\tdbl_max_def=`egrep 'define[ \t]+DBL_MAX[ \t]+.*' float.h | sed 's/.*DBL_MAX[ \t]*//' 2>/dev/null`\n\n\ + "\tdbl_max_def=`grep 'define[ \t][ \t]*DBL_MAX[ \t][ \t]*.*' float.h | sed 's/.*DBL_MAX[ \t]*//' 2>/dev/null`\n\n\ \tif ( test -n \"${dbl_max_def}\" ) > /dev/null 2>&1\n\ \tthen sed -e '/define[ \t]*HUGE_VAL[ \t]*DBL_MAX/s@DBL_MAX@'\"$dbl_max_def@\"\n\ \telse cat\n\ @@ -10402,9 +10402,9 @@ tSCC zVxworks_Needs_VxworksSelect0[] = tSCC zVxworks_Needs_VxworksTest0[] = " -r types/vxTypesOld.h"; tSCC zVxworks_Needs_VxworksTest1[] = - " -n \"`egrep '#include' $file`\""; + " -n \"`grep '#include' $file`\""; tSCC zVxworks_Needs_VxworksTest2[] = - " -n \"`egrep ULONG $file`\""; + " -n \"`grep ULONG $file`\""; #define VXWORKS_NEEDS_VXWORKS_TEST_CT 4 static tTestDesc aVxworks_Needs_VxworksTests[] = { diff --git a/fixincludes/genfixes b/fixincludes/genfixes index 47aad01289d..3a4c05c832b 100755 --- a/fixincludes/genfixes +++ b/fixincludes/genfixes @@ -58,7 +58,7 @@ done AG="autogen $AG" set -e -if [ -z "`${AG} -v | fgrep ' 5.'`" ] +if [ -z "`${AG} -v | grep ' 5\.'`" ] then echo "AutoGen appears to be out of date or not correctly installed." echo "Please download and install from:" diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 7605ac89aa2..080bbc010dc 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -3274,7 +3274,7 @@ fix = { * If we do, we will replace the one in math.h with that one. */ - "\tdbl_max_def=`egrep 'define[ \t]+DBL_MAX[ \t]+.*' float.h " + "\tdbl_max_def=`grep 'define[ \t][ \t]*DBL_MAX[ \t][ \t]*.*' float.h " "| sed 's/.*DBL_MAX[ \t]*//' 2>/dev/null`\n\n" "\tif ( test -n \"${dbl_max_def}\" ) > /dev/null 2>&1\n" @@ -5266,8 +5266,8 @@ fix = { hackname = vxworks_needs_vxworks; files = sys/stat.h; test = " -r types/vxTypesOld.h"; - test = " -n \"`egrep '#include' $file`\""; - test = " -n \"`egrep ULONG $file`\""; + test = " -n \"`grep '#include' $file`\""; + test = " -n \"`grep ULONG $file`\""; select = "#[ \t]define[ \t]+__INCstath"; sed = "/#[ \t]define[ \t][ \t]*__INCstath/a\\\n" From patchwork Mon Jun 27 06:09:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 55422 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A899385626B for ; Mon, 27 Jun 2022 06:10:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A899385626B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656310237; bh=cSK11IBtd8jTe8G5s7yVI3ZwXlvoWp96V0aKV2/iMvI=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=TeDgu78YLISX3nSzWaTW2a2vEcEzT9u6RedLdaipuIGAWr7EtuLomyARApqD9kF06 uVT8pBxSC7mlevaWFiWT+qMaTFOTTqzX4QRr2HGpIjcHQIWgSdB27OCZ5+lE08DSJ2 0YrfqjMqtXZMmFwdH6IAIuzz6g3iOylt2EoKrfAg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id 8DE61386DC6F for ; Mon, 27 Jun 2022 06:09:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8DE61386DC6F Received: from [192.168.124.21] (unknown [113.140.11.126]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 6B64866807; Mon, 27 Jun 2022 02:09:42 -0400 (EDT) Message-ID: <664e8a9fa34de7dd51c18c67e5b3786818165ab1.camel@xry111.site> Subject: [PATCH v2 3/7] libbacktrace: use grep instead of fgrep To: gcc-patches@gcc.gnu.org Date: Mon, 27 Jun 2022 14:09:40 +0800 In-Reply-To: References: User-Agent: Evolution 3.44.2 MIME-Version: 1.0 X-Spam-Status: No, score=-6.6 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, RCVD_IN_BARRACUDACENTRAL, 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-Patchwork-Original-From: Xi Ruoyao via Gcc-patches From: Xi Ruoyao Reply-To: Xi Ruoyao Cc: Bernhard Reutner-Fischer , Jonathan Wakely Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" fgrep has been deprecated in favor of grep -F for a long time, and the next grep release (3.8 or 4.0) will print a warning of fgrep is used. But, we can't simply replace fgrep to grep -F, or the build will break with some non-GNU grep implementations (lacking -F support). As "add-gnu-debuglink" is definitely not a non-trivial regex, simply replace fgrep with grep. libbacktrace/ChangeLog: * configure.ac (AC_PROG_FGREP): Use grep instead of fgrep. * configure: Regenerate. --- libbacktrace/configure | 2 +- libbacktrace/configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libbacktrace/configure b/libbacktrace/configure index 17f470a4bec..537486d34f2 100755 --- a/libbacktrace/configure +++ b/libbacktrace/configure @@ -13831,7 +13831,7 @@ else libbacktrace_cv_objcopy_debuglink=no elif ! test -n "${OBJCOPY}"; then libbacktrace_cv_objcopy_debuglink=no -elif ${OBJCOPY} --help | fgrep add-gnu-debuglink >/dev/null 2>&1; then +elif ${OBJCOPY} --help | grep add-gnu-debuglink >/dev/null 2>&1; then libbacktrace_cv_objcopy_debuglink=yes else libbacktrace_cv_objcopy_debuglink=no diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac index 597c9705db8..857987a2859 100644 --- a/libbacktrace/configure.ac +++ b/libbacktrace/configure.ac @@ -500,7 +500,7 @@ AC_CACHE_CHECK([whether objcopy supports debuglink], libbacktrace_cv_objcopy_debuglink=no elif ! test -n "${OBJCOPY}"; then libbacktrace_cv_objcopy_debuglink=no -elif ${OBJCOPY} --help | fgrep add-gnu-debuglink >/dev/null 2>&1; then +elif ${OBJCOPY} --help | grep add-gnu-debuglink >/dev/null 2>&1; then libbacktrace_cv_objcopy_debuglink=yes else libbacktrace_cv_objcopy_debuglink=no From patchwork Mon Jun 27 06:10:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 55423 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1D8EF386DC50 for ; Mon, 27 Jun 2022 06:12:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D8EF386DC50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656310367; bh=CuVFaxW+PHe/UzM97LSz64oA5gwuP6ZPkpXYxmZhqKo=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=UbOJhw78DESHwqHD3p4B2hl28NECpd+XMoHTAwGwYLQU/FHNDbWmYljyMTW6Tpbvb 3VVRS2hy9Debdd6tAn+YOHLvoWHVyifTpK+1ud8apgPYMxWnGM9WUgnumQUG2r+wE0 5u2V87soJxUwkj9PcLICgLFygePMHcmffQICAIVI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id B087C386DC62; Mon, 27 Jun 2022 06:10:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B087C386DC62 Received: from [192.168.124.21] (unknown [113.140.11.126]) (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 7037A66807; Mon, 27 Jun 2022 02:10:38 -0400 (EDT) Message-ID: <1e2be9a04a91bd061892353b578261666a1c9b75.camel@xry111.site> Subject: [PATCH v2 4/7] fortran: use grep instead of fgrep To: gcc-patches@gcc.gnu.org Date: Mon, 27 Jun 2022 14:10:36 +0800 In-Reply-To: References: User-Agent: Evolution 3.44.2 MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 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, RCVD_IN_BARRACUDACENTRAL, 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-Patchwork-Original-From: Xi Ruoyao via Gcc-patches From: Xi Ruoyao Reply-To: Xi Ruoyao Cc: Bernhard Reutner-Fischer , Jonathan Wakely , fortran@gcc.gnu.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" fgrep has been deprecated in favor of grep -F for a long time, and the next grep release (3.8 or 4.0) will print a warning of fgrep is used. Stop using fgrep so we won't see the warning. We can't hard code grep -F here or it may break build on hosts w/o GNU grep. autoconf documentation contains a warning about this issue and suggest to use AC_PROG_FGREP and $FGREP, but these are too overkill in the specific case: there is no way "debian" could be interpreted as an non-trivial regex, so we can use a plain grep here. gcc/fortran/ChangeLog: * Make-lang.in: Use grep instead of fgrep. --- gcc/fortran/Make-lang.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in index 1cb47cb1a52..6eb597d0ca0 100644 --- a/gcc/fortran/Make-lang.in +++ b/gcc/fortran/Make-lang.in @@ -278,7 +278,7 @@ $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran.1 \ -chmod a-x $@ fortran.uninstall: - if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + if $(SHELL) -c 'install-info --version | sed 1q | grep -s -v -i debian' >/dev/null 2>&1; then \ echo " install-info --delete --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/gfortran.info"; \ install-info --delete --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/gfortran.info || : ; \ else : ; fi; \ From patchwork Mon Jun 27 06:11:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 55424 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 89091386DC53 for ; Mon, 27 Jun 2022 06:13:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89091386DC53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656310423; bh=8+3GFdrOday1Bt2fQRWgPtgzvHZLf+EM3Mm1rXftjyE=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ruHgk4F3TKnpKv/KbchgAkMSeQpcWWgrpSGDZk6U/R8HRvA/e9Ocp8oH4gqgxkEB6 bEPH3H7yX0q9aURKyBNAu5nJkhVKcgBtmgaKMHV3n1ldS4NcxtRLCC2DGrvZmepVfz DG/ZXvvRrCB5pL3u7h3OHCX2YDAiWpasVj6dA6qg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id 8437E386DC66 for ; Mon, 27 Jun 2022 06:11:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8437E386DC66 Received: from [192.168.124.21] (unknown [113.140.11.126]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 3F53D66807; Mon, 27 Jun 2022 02:11:25 -0400 (EDT) Message-ID: <51908ccd68c022910f59a904556483c123ae428c.camel@xry111.site> Subject: [PATCH v2 5/7] testsuite: stop using obsoleted egrep To: gcc-patches@gcc.gnu.org Date: Mon, 27 Jun 2022 14:11:23 +0800 In-Reply-To: References: User-Agent: Evolution 3.44.2 MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 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, RCVD_IN_BARRACUDACENTRAL, 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-Patchwork-Original-From: Xi Ruoyao via Gcc-patches From: Xi Ruoyao Reply-To: Xi Ruoyao Cc: Bernhard Reutner-Fischer , Jonathan Wakely Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" egrep has been deprecated in favor of grep -E for a long time, and the next grep release (3.8 or 4.0) will print a warning of egrep is used. Stop using egrep so we won't see the warning. However, simply replacing egrep with grep -E will break build on some systems (notably Solaris) w/o a POSIX-conform grep. We detect a suitable command with AC_PROG_EGREP, and pass it to run_acats.sh for Ada. For Go, simply use grep instead of egrep as the pattern does not need any ERE features. gcc/ChangeLog: * Makefile.in (EGREP): New variable. * configure.ac (AC_PROG_EGREP): Call it. * configure: Regenerate. gcc/ada/ChangeLog: * gcc-interface/Make-lang.in: Pass EGREP to run_acats.sh. gcc/testsuite/ChangeLog: * ada/acats/run_all.sh: Use $EGREP instead of egrep. * go.test/go-test.exp: Use grep intead of egrep. --- gcc/Makefile.in | 1 + gcc/ada/gcc-interface/Make-lang.in | 3 +- gcc/configure | 71 +++++++++++++++++++++++++++++- gcc/configure.ac | 1 + gcc/testsuite/ada/acats/run_all.sh | 8 +++- gcc/testsuite/go.test/go-test.exp | 2 +- 6 files changed, 81 insertions(+), 5 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index b6dcc45a58a..8b95ee20b46 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1090,6 +1090,7 @@ BACKENDLIBS = $(ISLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ SYSLIBS = @GNAT_LIBEXC@ # Used from ada/gcc-interface/Make-lang.in +EGREP = @EGREP@ GNATBIND = @GNATBIND@ GNATMAKE = @GNATMAKE@ diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index 1e245ed3b0f..e0cbb6ab1ed 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -1050,7 +1050,8 @@ check-acats: rm -rf $(ACATSDIR)-parallel; \ mkdir $(ACATSDIR)-parallel; \ ( testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \ - export testdir; \ + EGREP="$EGREP"; \ + export testdir EGREP; \ cd $(ACATSDIR) && $(SHELL) $${testdir}/$(ACATSCMD) NONE ) \ || exit 1; \ GCC_RUNTEST_PARALLELIZE_DIR=$$rootme/$(ACATSDIR)-parallel; \ diff --git a/gcc/configure b/gcc/configure index c58ec9b2273..8bd384c3fcc 100755 --- a/gcc/configure +++ b/gcc/configure @@ -8416,6 +8416,73 @@ case ${AWK} in "") as_fn_error $? "can't build without awk, bailing out" "$LINENO" 5 ;; esac +{ $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="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$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="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $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=$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="$ac_path_EGREP" + ac_path_EGREP_max=$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=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$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="$ac_cv_path_EGREP" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } if ${gcc_cv_prog_LN_S+:} false; then : @@ -19675,7 +19742,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19678 "configure" +#line 19745 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19781,7 +19848,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19784 "configure" +#line 19851 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 80bdd8ceef9..bfb124e9456 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1219,6 +1219,7 @@ case ${AWK} in "") AC_MSG_ERROR([can't build without awk, bailing out]) ;; esac +AC_PROG_EGREP gcc_AC_PROG_LN_S ACX_PROG_LN($LN_S) AC_PROG_RANLIB diff --git a/gcc/testsuite/ada/acats/run_all.sh b/gcc/testsuite/ada/acats/run_all.sh index ac2a86bea6c..81d3f9edd5c 100755 --- a/gcc/testsuite/ada/acats/run_all.sh +++ b/gcc/testsuite/ada/acats/run_all.sh @@ -53,6 +53,12 @@ if [ "$dir" = "$testdir" ]; then exit 1 fi +if [ -z "$EGREP" ]; then + # Set a default suitable for all "modern" system in case this script is + # not invoked by GCC building system. + EGREP="grep -E" +fi + GCC="$BASE/xgcc -B$BASE/" target_gnatchop () { @@ -367,7 +373,7 @@ for chapter in $chapters; do target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1 cd $dir/tests/$chapter/$i cat ${i}.log >> $dir/acats.log - egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1 + $EGREP -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1 if [ $? -ne 0 ]; then grep 'tasking not implemented' ${i}.log > /dev/null 2>&1 diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp index 11c178ad7ec..c9dbd72d16a 100644 --- a/gcc/testsuite/go.test/go-test.exp +++ b/gcc/testsuite/go.test/go-test.exp @@ -1207,7 +1207,7 @@ proc go-gc-tests { } { || $test_line == "// \$G \$D/empty.go && errchk \$G \$D/\$F.go" } { # These tests import the same package under two different # names, which gccgo does not support. - } elseif { $test_line == "// \$G -S \$D/\$F.go | egrep initdone >/dev/null && echo BUG sinit || true" } { + } elseif { $test_line == "// \$G -S \$D/\$F.go | grep initdone >/dev/null && echo BUG sinit || true" } { # This tests whether initializers are written out # statically. gccgo does not provide a way to test that, # as an initializer will be generated for any code which From patchwork Mon Jun 27 06:12:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 55425 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2139386F0D6 for ; Mon, 27 Jun 2022 06:14:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2139386F0D6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656310486; bh=PhsTxS3UEZsoynPpmzMgXUAiDcjUIDmG4uQnCKoq1go=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=nPcGAF2wnyJiAo6ZbmP1qjb3gvT+JmvpZO1oofJlsDz2YSzrSmdSctrx5946sBjLW zcjJMFzik29/OFbVu4KLawDbYLyulfqOmxVIwZvKnJGABaraJW3qqUvDeMsoOF3YLe xTkBeX5Vnnz63pGgrpU/BfKtCV/fGIBbCohcryCo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 98FBF386DC71 for ; Mon, 27 Jun 2022 06:12:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 98FBF386DC71 Received: from [192.168.124.21] (unknown [113.140.11.126]) (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 470E066807; Mon, 27 Jun 2022 02:12:09 -0400 (EDT) Message-ID: Subject: [PATCH v2 6/7] contrib: use grep -E instead of egrep To: gcc-patches@gcc.gnu.org Date: Mon, 27 Jun 2022 14:12:05 +0800 In-Reply-To: References: User-Agent: Evolution 3.44.2 MIME-Version: 1.0 X-Spam-Status: No, score=-6.8 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, RCVD_IN_BARRACUDACENTRAL, 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-Patchwork-Original-From: Xi Ruoyao via Gcc-patches From: Xi Ruoyao Reply-To: Xi Ruoyao Cc: Bernhard Reutner-Fischer , Jonathan Wakely Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" egrep has been deprecated in favor of grep -E for a long time, and the next grep release (3.8 or 4.0) will print a warning of egrep is used. Stop using egrep so we won't see the warning. Some non-POSIX grep implementations does not support -E option, so for test_summary and warn_summary we prefer grep -E, but fallback to egrep if grep -E does not work. For check_GNU_style.sh, I think it is only used by developers so hard coding grep -E is OK. contrib/ChangeLog: * check_GNU_style.sh: Use grep -E instead of egrep. * test_summary: Use grep -E instead of egrep if it works. * warn_summary: Likewise. --- contrib/check_GNU_style.sh | 10 +++++----- contrib/test_summary | 13 ++++++++++++- contrib/warn_summary | 13 ++++++++++++- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh index fb7494661ee..535be65f063 100755 --- a/contrib/check_GNU_style.sh +++ b/contrib/check_GNU_style.sh @@ -113,7 +113,7 @@ g (){ local found=false cat $inp \ - | egrep $color -- "$arg" \ + | grep -E $color -- "$arg" \ > "$tmp" && found=true if $found; then @@ -130,8 +130,8 @@ ag (){ local found=false cat $inp \ - | egrep $color -- "$arg1" \ - | egrep $color -- "$arg2" \ + | grep -E $color -- "$arg1" \ + | grep -E $color -- "$arg2" \ > "$tmp" && found=true if $found; then @@ -148,8 +148,8 @@ vg (){ local found=false cat $inp \ - | egrep -v -- "$varg" \ - | egrep $color -- "$arg" \ + | grep -E -v -- "$varg" \ + | grep -E $color -- "$arg" \ > "$tmp" && found=true if $found; then diff --git a/contrib/test_summary b/contrib/test_summary index 5760b053ec2..f17bf54f8ec 100755 --- a/contrib/test_summary +++ b/contrib/test_summary @@ -54,6 +54,17 @@ if test -z "$AWK" ; then done fi +# Prefer "grep -E" which should work with POSIX-conform grep, but fallback +# to "egrep" (which is deprecated for a long time) if grep does not support +# -E. +if test -z "$EGREP" ; then + if echo a | grep -E '(a|b)' > /dev/null 2> /dev/null; then + EGREP="grep -E" + else + EGREP="egrep" + fi +fi + : ${filesuffix=}; export filesuffix : ${move=true}; export move : ${forcemail=false}; export forcemail @@ -77,7 +88,7 @@ for file in $files; do { $anychange || anychange=`diff $file.sent $file 2>/dev/null | if test ! -f $file.sent || - egrep '^[<>] (XPASS|FAIL)' >/dev/null; then + $EGREP '^[<>] (XPASS|FAIL)' >/dev/null; then echo true else echo false diff --git a/contrib/warn_summary b/contrib/warn_summary index d4c8b6cdb19..afa11802ee1 100755 --- a/contrib/warn_summary +++ b/contrib/warn_summary @@ -57,7 +57,7 @@ subdirectoryFilter() else if test "$filter" = nosub ; then # Omit all subdirectories. - egrep -v '/gcc/(ch|cp|f|fortran|ada|intl|fixinc)/' + $EGREP -v '/gcc/(ch|cp|f|fortran|ada|intl|fixinc)/' else # Pass through only subdir $filter. grep "/gcc/$filter/" @@ -155,6 +155,17 @@ if test -z "$AWK" ; then done fi +# Prefer "grep -E" which should work with POSIX-conform grep, but fallback +# to "egrep" (which is deprecated for a long time) if grep does not support +# -E. +if test -z "$EGREP" ; then + if echo a | grep -E '(a|b)' > /dev/null 2> /dev/null; then + EGREP="grep -E" + else + EGREP="egrep" + fi +fi + # Parse command line arguments. while test -n "$1" ; do case "$1" in From patchwork Mon Jun 27 06:14:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 55426 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8CD2E386DC67 for ; Mon, 27 Jun 2022 06:15:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CD2E386DC67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656310544; bh=PJrYmC+0m0+bOL3y5lE5IanPQG7ShtgkUKQJ+8B+YBs=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=s+58dDoGq2kvDBRbd1v+szXX2SRjuOJowzrtrnw7zmMCQeTF0U8tzSOwfU2ocRkhb 6hpH6xoFzgf+UfaQByjCHHxVvO83UsEqLQB9B+hLeO9wGOXfXygniR1uurbIHq95nR HAxwL2Sp+r7q+t+A+XJNKEq+Jlwu9GIvDoyKFHdg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 To: gcc-patches@gcc.gnu.org Date: Mon, 27 Jun 2022 14:14:07 +0800 In-Reply-To: References: 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-Patchwork-Original-From: Xi Ruoyao via Gcc-patches From: Xi Ruoyao Reply-To: Xi Ruoyao Cc: Bernhard Reutner-Fischer , Jonathan Wakely Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' @@ -205,8 +206,7 @@ test -x / || exit 1" ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long 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=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$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="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $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" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$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="$ac_path_GREP" + ac_path_GREP_max=$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=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$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="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$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="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $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=$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="$ac_path_EGREP" + ac_path_EGREP_max=$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=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$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="$ac_cv_path_EGREP" + + case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 @@ -5279,136 +5409,6 @@ Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long 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=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$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="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $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" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$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="$ac_path_GREP" - ac_path_GREP_max=$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=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$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="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$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="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $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=$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="$ac_path_EGREP" - ac_path_EGREP_max=$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=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$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="$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 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=yes 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) AM_PROG_AS AM_PROG_CC_C_O +AC_PROG_EGREP AC_PROG_LIBTOOL AC_CHECK_TOOL(READELF, readelf) @@ -290,7 +291,7 @@ if test "x$GCC" = "xyes"; then echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c libffi_cv_hidden_visibility_attribute=no if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_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=yes fi fi