From patchwork Fri Dec 2 19:00:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 61384 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 09ABD3854552 for ; Fri, 2 Dec 2022 19:01:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09ABD3854552 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670007665; bh=2OOTFxtjuYgkqIxQFhOziwIiikjnpnkSfZtbMZI8hTI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=g4IHntjiJzQxowObH9/KMCHNYg8k/i6BUk9gQyUnBzk7QSbmrCijFHySUocSVZGgL sa3/ZhVGIBaYq/eBtz4KUc19HNCPJNPHg2WsPZdd18sXdzIgb1emwiugAbJEaKNZDT By4DaNl/Ow6UCJT/sZwAJkTQVWvYrI0SNZHNvm7c= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 2FEF6385B1BD for ; Fri, 2 Dec 2022 19:00:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2FEF6385B1BD Received: by mail-ot1-x333.google.com with SMTP id s9-20020a05683004c900b0066e7414466bso3464873otd.12 for ; Fri, 02 Dec 2022 11:00:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2OOTFxtjuYgkqIxQFhOziwIiikjnpnkSfZtbMZI8hTI=; b=28AHmcu+9a0PyPHbjVTriFtkihSNz5+m7UagiS9dFm99GJFCOzfgHffsFz1U/vP/lI ISc0jQnsEDIcb4xxdrhFgVwNnp5S7giNAV8RfBhqqjNnVebMfvBduOPbPt23gDRSmChz FhTZdZuPxJyvWWQELebwmODiR3dLvz2EHAA5VW4gkoLYSjyOXMgHjiDdpEn4cQs7QGtf QQhYQiQBK/MfI1YlTW166nTiJRqjmFGk9x56S+rcjaWCqUMyUeWvL40ZYFioc3Z3l2nF qO2iMF9a32PhPbP+D5SXkAJYxYApo+Cii7Tqu+MTWI/DBEcvTUu51EiRRfqpeNVUan+b Mi3A== X-Gm-Message-State: ANoB5pn9qjQowj+vl0IwiaoUQwSLg4RScwhSS4J1P9z10KrPYagC6+dh FRK1swBRnUxSNx/hJQCQnJD/q/YG1RwWGak05CA= X-Google-Smtp-Source: AA0mqf7JLlRWHy622KLyWAQVYB6gfEWL+CRcxvK+xWab8eXbnNy9D7LFR01dFjvRz1pJdDE0pxP97g== X-Received: by 2002:a05:6830:1404:b0:66c:5310:6ff8 with SMTP id v4-20020a056830140400b0066c53106ff8mr27746998otp.122.1670007639260; Fri, 02 Dec 2022 11:00:39 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:f215:6472:4682:7ef0:a0a8]) by smtp.gmail.com with ESMTPSA id k60-20020a9d19c2000000b0066ca9001e68sm2218159otk.5.2022.12.02.11.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 11:00:38 -0800 (PST) To: libc-alpha@sourceware.org, Vineet Gupta , =?utf-8?q?Ludovic_Court=C3=A8s?= Subject: [PATCH 3/6] configure: Remove check if ld is GNU Date: Fri, 2 Dec 2022 16:00:27 -0300 Message-Id: <20221202190030.1671870-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221202190030.1671870-1-adhemerval.zanella@linaro.org> References: <20221202190030.1671870-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Assume linker has gnu argument input style. Reviewed-by: Carlos O'Donell --- aclocal.m4 | 32 ++--- configure | 158 +++++++++------------- sysdeps/unix/sysv/linux/powerpc/configure | 28 ++-- 3 files changed, 91 insertions(+), 127 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 149b9e5376..88db64a683 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -126,10 +126,6 @@ OBJCOPY=`$CC -print-prog-name=objcopy` AC_SUBST(OBJCOPY) GPROF=`$CC -print-prog-name=gprof` AC_SUBST(GPROF) - -AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu, -[LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)]) -gnu_ld=$libc_cv_prog_ld_gnu ]) dnl Run a static link test with -nostdlib -nostartfiles. @@ -219,25 +215,23 @@ dnl LIBC_LINKER_FEATURE([ld_option], [cc_option], [action-if-true], [action-if-f AC_DEFUN([LIBC_LINKER_FEATURE], [AC_MSG_CHECKING([for linker that supports $1]) libc_linker_feature=no -if test x"$gnu_ld" = x"yes"; then - cat > conftest.c < conftest.c <&AS_MESSAGE_LOG_FD]) - then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp $2 -nostdlib \ - -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ - | grep "warning: $1 ignored" > /dev/null 2>&1; then - true - else - libc_linker_feature=yes - fi +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp + $2 -nostdlib -nostartfiles + -fPIC -shared -o conftest.so conftest.c + 1>&AS_MESSAGE_LOG_FD]) +then + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp $2 -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: $1 ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes fi - rm -f conftest* fi +rm -f conftest* if test $libc_linker_feature = yes; then $3 else diff --git a/configure b/configure index 2d3b3946b9..086d6fba7a 100755 --- a/configure +++ b/configure @@ -4155,24 +4155,6 @@ OBJCOPY=`$CC -print-prog-name=objcopy` GPROF=`$CC -print-prog-name=gprof` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $LD is GNU ld" >&5 -$as_echo_n "checking whether $LD is GNU ld... " >&6; } -if ${libc_cv_prog_ld_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Most GNU programs take a -v and spit out some text including -# the word 'GNU'. Some try to read stdin, so give them /dev/null. -if $LD -o conftest -v &1 | grep GNU > /dev/null 2>&1; then - libc_cv_prog_ld_gnu=yes -else - libc_cv_prog_ld_gnu=no -fi -rm -fr contest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_prog_ld_gnu" >&5 -$as_echo "$libc_cv_prog_ld_gnu" >&6; } -gnu_ld=$libc_cv_prog_ld_gnu - # Accept binutils 2.25 or newer. for ac_prog in $AS @@ -6037,30 +6019,28 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z execstack" >&5 $as_echo_n "checking for linker that supports -z execstack... " >&6; } libc_linker_feature=no -if test x"$gnu_ld" = x"yes"; then - cat > conftest.c < conftest.c <&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } - then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,execstack -nostdlib \ - -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ - | grep "warning: -z execstack ignored" > /dev/null 2>&1; then - true - else - libc_linker_feature=yes - fi +then + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,execstack -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: -z execstack ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes fi - rm -f conftest* fi +rm -f conftest* if test $libc_linker_feature = yes; then libc_cv_z_execstack=yes else @@ -6073,30 +6053,28 @@ $as_echo "$libc_linker_feature" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z start-stop-gc" >&5 $as_echo_n "checking for linker that supports -z start-stop-gc... " >&6; } libc_linker_feature=no -if test x"$gnu_ld" = x"yes"; then - cat > conftest.c < conftest.c <&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } - then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,start-stop-gc -nostdlib \ - -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ - | grep "warning: -z start-stop-gc ignored" > /dev/null 2>&1; then - true - else - libc_linker_feature=yes - fi +then + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,start-stop-gc -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: -z start-stop-gc ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes fi - rm -f conftest* fi +rm -f conftest* if test $libc_linker_feature = yes; then libc_cv_z_start_stop_gc=yes else @@ -6110,30 +6088,28 @@ have-z-start-stop-gc = $libc_cv_z_start_stop_gc" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports --depaudit" >&5 $as_echo_n "checking for linker that supports --depaudit... " >&6; } libc_linker_feature=no -if test x"$gnu_ld" = x"yes"; then - cat > conftest.c < conftest.c <&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } - then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--depaudit,x -nostdlib \ - -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ - | grep "warning: --depaudit ignored" > /dev/null 2>&1; then - true - else - libc_linker_feature=yes - fi +then + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--depaudit,x -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: --depaudit ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes fi - rm -f conftest* fi +rm -f conftest* if test $libc_linker_feature = yes; then libc_cv_depaudit=yes else @@ -6147,30 +6123,28 @@ have-depaudit = $libc_cv_depaudit" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z pack-relative-relocs" >&5 $as_echo_n "checking for linker that supports -z pack-relative-relocs... " >&6; } libc_linker_feature=no -if test x"$gnu_ld" = x"yes"; then - cat > conftest.c < conftest.c <&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } - then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,pack-relative-relocs -nostdlib \ - -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ - | grep "warning: -z pack-relative-relocs ignored" > /dev/null 2>&1; then - true - else - libc_linker_feature=yes - fi +then + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,pack-relative-relocs -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: -z pack-relative-relocs ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes fi - rm -f conftest* fi +rm -f conftest* if test $libc_linker_feature = yes; then libc_cv_dt_relr=yes else @@ -6184,30 +6158,28 @@ have-dt-relr = $libc_cv_dt_relr" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports --no-dynamic-linker" >&5 $as_echo_n "checking for linker that supports --no-dynamic-linker... " >&6; } libc_linker_feature=no -if test x"$gnu_ld" = x"yes"; then - cat > conftest.c < conftest.c <&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } - then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--no-dynamic-linker -nostdlib \ - -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ - | grep "warning: --no-dynamic-linker ignored" > /dev/null 2>&1; then - true - else - libc_linker_feature=yes - fi +then + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--no-dynamic-linker -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: --no-dynamic-linker ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes fi - rm -f conftest* fi +rm -f conftest* if test $libc_linker_feature = yes; then libc_cv_no_dynamic_linker=yes else diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure index 7183573bc0..84a39495f0 100644 --- a/sysdeps/unix/sysv/linux/powerpc/configure +++ b/sysdeps/unix/sysv/linux/powerpc/configure @@ -79,30 +79,28 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports --no-tls-get-addr-optimize" >&5 $as_echo_n "checking for linker that supports --no-tls-get-addr-optimize... " >&6; } libc_linker_feature=no -if test x"$gnu_ld" = x"yes"; then - cat > conftest.c < conftest.c <&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } - then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--no-tls-get-addr-optimize -nostdlib \ - -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ - | grep "warning: --no-tls-get-addr-optimize ignored" > /dev/null 2>&1; then - true - else - libc_linker_feature=yes - fi +then + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--no-tls-get-addr-optimize -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: --no-tls-get-addr-optimize ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes fi - rm -f conftest* fi +rm -f conftest* if test $libc_linker_feature = yes; then libc_cv_tls_get_addr_optimize=yes else