From patchwork Mon Jul 26 03:58:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 44469 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 2E846396E07E for ; Mon, 26 Jul 2021 03:59:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E846396E07E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627271980; bh=6ir1ITnMLazHZlcWUDo20zG7JCoLZdzz9poTAHaYI9o=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ebq4xSgc90bg+Xnjy6DY2q1zVAAnA/ouHJRSLCPdDww9dkbSasr2QKadkC6uKGtNc 5uDpPVCCghUMN7eJ9it/ZzvMESzrH9Te6X8YmOQCVSfT2NYp8iK9lhqHjkGpgaHCmx w7Cd2V0FC1SYIWB/GRlw5dpb4tkG6z60UH7Vhs24= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by sourceware.org (Postfix) with ESMTPS id AAEB13854809 for ; Mon, 26 Jul 2021 03:58:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AAEB13854809 Received: by mail-qv1-xf4a.google.com with SMTP id t4-20020a0cef040000b02902e2f9404330so7194032qvr.9 for ; Sun, 25 Jul 2021 20:58:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=6ir1ITnMLazHZlcWUDo20zG7JCoLZdzz9poTAHaYI9o=; b=rcq4eU/Wberp9Tlf35vvXeZk0+SZrVPkRxmHj+yRa5+uY9zHSlc8LB4KHDl7UsQUBC 03AWU88wPf6IkMGiRFMPRRf1ghYWEZe90hvOOKk/21ai3QkR1LL60oJfxqqwIhZYR0HU zcdKM9FcAf0Np3zD4blsXwCCuVffJNDaPd772vcHFQK82wz24HzPvDhLYUzyDUPhdEhn d+6FaIoGgWuqEZgVRHiHOhy5sVHJqp4TGcD2hEm1kHKzpOcxI3YZz72304EGz1qSEp9A HCBK20mNH54oHLA1w5MKoGuVnSBeb8WGVydKULImpisviKPpyFx3j679O+eiqPzbnMPz L7Yg== X-Gm-Message-State: AOAM530F+aN0gZ32RV66VvTExY5JyTAX1/WIEYnyO9W0CoTZ4u9Na86e Yj4XM+oNgTNtdzMUUDT3lEULJGV8xEDxHCOI5YICLOP8MmS1WFoFb+gYvHQ4yLvUle1GRoKKM4r ZIPyEj+7LzJN0r8NwQBJk9yALoh1iepGo4qMTiCN+uIuA9Ib4flBsZySQ0y/aEp+6Aj5B X-Google-Smtp-Source: ABdhPJzFjG7cL5VTk9hOtNJJEzmWMMst/jw/ICnPrQhTIj282nChUYFUvb1Y4iqYGA1kaOg+u9q3RZaiMsDp X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:565c:23d5:ef81:9e9d]) (user=maskray job=sendgmr) by 2002:a05:6214:1909:: with SMTP id er9mr8312878qvb.26.1627271907153; Sun, 25 Jul 2021 20:58:27 -0700 (PDT) Date: Sun, 25 Jul 2021 20:58:00 -0700 In-Reply-To: <20210726035802.275992-1-maskray@google.com> Message-Id: <20210726035802.275992-2-maskray@google.com> Mime-Version: 1.0 References: <20210726035802.275992-1-maskray@google.com> Subject: [PATCH 1/3] elf: Replace .tls_common with .tbss definition To: libc-alpha@sourceware.org X-Spam-Status: No, score=-18.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, PDS_OTHER_BAD_TLD, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fangrui Song via Libc-alpha From: Fangrui Song Reply-To: Fangrui Song Cc: Fangrui Song Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" .tls_common is obsoleted, not supported by clang -fintegrated-as or ld.lld. Just change it to .tbss for portability. --- elf/tls-macros.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elf/tls-macros.h b/elf/tls-macros.h index e25e33b0f0..a637407417 100644 --- a/elf/tls-macros.h +++ b/elf/tls-macros.h @@ -1,7 +1,11 @@ /* Macros to support TLS testing in times of missing compiler support. */ #define COMMON_INT_DEF(x) \ - asm (".tls_common " #x ",4,4") + asm (".section .tbss\n\t" \ + ".globl " #x "\n\t" \ + ".balign 4\n\t" \ + #x ":\t.space 4\n\t" \ + ".previous") /* XXX Until we get compiler support we don't need declarations. */ #define COMMON_INT_DECL(x) From patchwork Mon Jul 26 03:58:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 44470 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 213EE396E44B for ; Mon, 26 Jul 2021 04:00:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 213EE396E44B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627272025; bh=Smc5RpTQ1F//Ad/q+fRuCmVF9bXqcUbIO08Ak29+Rf8=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=s5ogaCbo4pFY/IYcf+iygdySuyRFQGSYtgW8IBM29RIQYHAYxId9OiXBhLIEheikv OObHxw9w1bWhO5Oic+l/mk6Ol2nz6Q4XZsL6pScump0PwV82fc96Ue69xSxSgDkLHC f480LJrfaK3liIqk7Ywr9XsuZRlYAzFS19qmtAz0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf49.google.com (mail-qv1-xf49.google.com [IPv6:2607:f8b0:4864:20::f49]) by sourceware.org (Postfix) with ESMTPS id 4FDC7384603D for ; Mon, 26 Jul 2021 03:58:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4FDC7384603D Received: by mail-qv1-xf49.google.com with SMTP id m15-20020a0cbf0f0000b02902e60d75210eso7107317qvi.19 for ; Sun, 25 Jul 2021 20:58:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Smc5RpTQ1F//Ad/q+fRuCmVF9bXqcUbIO08Ak29+Rf8=; b=Rel7LXSxP5AuKGkqPUUacfJVWU/43RYF2Rot6i6KAjK+PWdFKcXX0Sxrtt3mEU2qt7 4dsAxXFo3kVBIZAN4nJBaO6cQuN3wnh8ZVupoIABSANQpttd15j+z8yLGlwchiO2/Xvw Kq5BDRgh9EN2SkC9Ob/2UIWFfpjVPhRLwEJlC8Jv7wsgJTb12lLgSzdcUUx8NLnQTtLM Sr54JdR9oh2Y9IwFH/5X5XP3oTvFgzz8be8UFlbhm0krChBHAmJRUleRC7UtrVafxx6R ekMYCkiGF8UAn04anNs9/JXOfovNh1bbRrqyk4k/8CfNPsfRROqJLhGg3QiSQDfasUHb IwBA== X-Gm-Message-State: AOAM532RIt3tnQI4Vl/X79WCV/l1jW4Xb3A/lVI0NS9CZdSd/6IBkR4s GQTmlTHFUJLr9nNE2+yWdhRTB7dwXqTsMSrOlHSU3fk/UgMD/unuvvBbQDxkAq2ZasrRosiBZhE 7HulKF6zOHsIFq2bPpXB4tQtu8YdZMP2ueKBpyh+P2zKClshhTywKCuAO1jcnBj44/5be X-Google-Smtp-Source: ABdhPJy9kEM3rhX6u4CAaapuXiiGSXLeJkqpElqk/CKsg8u200fWoxbEx+0lKWGAc9zL2c9EQLUaogY9ZCLc X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:565c:23d5:ef81:9e9d]) (user=maskray job=sendgmr) by 2002:a0c:fb03:: with SMTP id c3mr15924715qvp.19.1627271909824; Sun, 25 Jul 2021 20:58:29 -0700 (PDT) Date: Sun, 25 Jul 2021 20:58:01 -0700 In-Reply-To: <20210726035802.275992-1-maskray@google.com> Message-Id: <20210726035802.275992-3-maskray@google.com> Mime-Version: 1.0 References: <20210726035802.275992-1-maskray@google.com> Subject: [PATCH 2/3] elf: Skip tst-auditlogmod-* if the linker doesn't support --depaudit To: libc-alpha@sourceware.org X-Spam-Status: No, score=-19.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fangrui Song via Libc-alpha From: Fangrui Song Reply-To: Fangrui Song Cc: Fangrui Song Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" gold and ld.lld do not support --audit or --depaudit. --- configure | 34 ++++++++++++++++++++++++++++++++++ configure.ac | 4 ++++ elf/Makefile | 4 +++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 9619c10991..9b966196d4 100755 --- a/configure +++ b/configure @@ -5969,6 +5969,40 @@ $as_echo "$libc_linker_feature" >&6; } config_vars="$config_vars 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 + libc_linker_check=`$LD -v --help 2>/dev/null | grep "\--depaudit"` + if test -n "$libc_linker_check"; then + cat > 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 + libc_linker_feature=yes + fi + rm -f conftest* + fi +fi +if test $libc_linker_feature = yes; then + libc_cv_depaudit=yes +else + libc_cv_depaudit=no +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5 +$as_echo "$libc_linker_feature" >&6; } +config_vars="$config_vars +have-depaudit = $libc_cv_depaudit" + { $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 diff --git a/configure.ac b/configure.ac index 34ecbba540..17a4c9a1ab 100644 --- a/configure.ac +++ b/configure.ac @@ -1337,6 +1337,10 @@ LIBC_LINKER_FEATURE([-z start-stop-gc], [-Wl,-z,start-stop-gc], [libc_cv_z_start_stop_gc=yes], [libc_cv_z_start_stop_gc=no]) LIBC_CONFIG_VAR([have-z-start-stop-gc], [$libc_cv_z_start_stop_gc]) +LIBC_LINKER_FEATURE([--depaudit], [-Wl,--depaudit,x], + [libc_cv_depaudit=yes], [libc_cv_depaudit=no]) +LIBC_CONFIG_VAR([have-depaudit], [$libc_cv_depaudit]) + LIBC_LINKER_FEATURE([--no-dynamic-linker], [-Wl,--no-dynamic-linker], [libc_cv_no_dynamic_linker=yes], diff --git a/elf/Makefile b/elf/Makefile index 87a70d6c7a..09f860a268 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -219,7 +219,6 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \ tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenfail \ tst-dlopenfail-2 \ tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlopen \ - tst-audit14 tst-audit15 tst-audit16 \ tst-single_threaded tst-single_threaded-pthread \ tst-tls-ie tst-tls-ie-dlmopen argv0test \ tst-glibc-hwcaps tst-glibc-hwcaps-prepend tst-glibc-hwcaps-mask \ @@ -238,6 +237,9 @@ selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null) ifneq ($(selinux-enabled),1) tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog endif +ifeq ($(have-depaudit),yes) +tests += tst-audit14 tst-audit15 tst-audit16 +endif endif tests += $(tests-execstack-$(have-z-execstack)) ifeq ($(run-built-tests),yes) From patchwork Mon Jul 26 03:58:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 44471 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 91FD1396E44C for ; Mon, 26 Jul 2021 04:01:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91FD1396E44C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627272070; bh=JvrcZdBEDvNCI+CtC/hEh6dOW8wcvseeKcqof4UVzfk=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=oKLqwzfY/Zrx2VkKVXeVq2JkNXg9lviGzmrInKqdapoQweczDn/MgMYrNVTwOEaVA YCD6b7+Y+142r9da7Nrn6tFo2KOeCjsSL2aKPG629n26Qaq9mpdtlBkxKeoSX+HpT7 bzM3NL3io5tTEbZW0yHsHmM/2TXr3te8mPe0DIjg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by sourceware.org (Postfix) with ESMTPS id 405D5396E44B for ; Mon, 26 Jul 2021 03:58:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 405D5396E44B Received: by mail-qv1-xf4a.google.com with SMTP id k7-20020ad453c70000b02902f36ca6afdcso7184256qvv.7 for ; Sun, 25 Jul 2021 20:58:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=JvrcZdBEDvNCI+CtC/hEh6dOW8wcvseeKcqof4UVzfk=; b=bvKwCV/pM1TQzfV5NlW7XdaCI4KRGV8fcixLwWkZLTU/oSrasZgKCjyiG0nWGxC427 EyCjbluOSy6Br5NLi1TF+7/WLwIPDGCF6CC5Wk0/iCVSGuy1FP0vgbBnSyL2aN2GM3Tr 2xsDSCg6ejjSSprcuFMSNNS1YpWVq4mEUgHzKVCEIZl1Vwfx01CGGZa6+yCiu1Z+sm8s pPFdcLljATJrY89mRKAFYsTuboJotNMTfePOEVsAyxwzp2mrXn2e5mFxwYL80YzVTcbr R6jdcOPCIHtCZd8O6Lc8IVtGVPeqAYG7sURUWk3WpkD6+ytm5mhDVmgza+lPH8bVNbxr ZiiQ== X-Gm-Message-State: AOAM531bImylAP2InfNdg1DAQX5A/qgHE5Ocm1w7Td6nDu20e1KTRon8 Xibfxngr9vkdugViwvhVpEELx+J2QTh5qAcmQLLarcuEVBT3afZPZ4hOVrGzx7W6g8HLYUokcrm WR1Q/QVVdhFOrhiIHrN/+jH2AwLMS3iWJXgyi5a+qhnLDyb4WH+Bv4Hd9KDsYRByhgoQ0 X-Google-Smtp-Source: ABdhPJz6Fuqw3Q8Y36rbX5FXyv4izLv54M+8yJZp5LBQ+pB9tFLVhN3/sIvHViIsFY3PLWYHKRFvzOp6bshe X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:565c:23d5:ef81:9e9d]) (user=maskray job=sendgmr) by 2002:a0c:9ac7:: with SMTP id k7mr16182328qvf.49.1627271911845; Sun, 25 Jul 2021 20:58:31 -0700 (PDT) Date: Sun, 25 Jul 2021 20:58:02 -0700 In-Reply-To: <20210726035802.275992-1-maskray@google.com> Message-Id: <20210726035802.275992-4-maskray@google.com> Mime-Version: 1.0 References: <20210726035802.275992-1-maskray@google.com> Subject: [PATCH 3/3] configure: Allow LD to be LLD 13.0.0 or above To: libc-alpha@sourceware.org X-Spam-Status: No, score=-19.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fangrui Song via Libc-alpha From: Fangrui Song Reply-To: Fangrui Song Cc: Fangrui Song Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" When using LLD (LLVM linker) as the linker, configure prints a confusing message. *** These critical programs are missing or too old: GNU ld LLD>=13.0.0 can build glibc --enable-static-pie. (8.0.0 needs one workaround for -Wl,-defsym=_begin=0. 9.0.0 works with --disable-static-pie). --- configure | 77 +++++++++++++++++++++++++++++++++++++++++++++++++--- configure.ac | 20 ++++++++++---- 2 files changed, 88 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 9b966196d4..050f1a29cf 100755 --- a/configure +++ b/configure @@ -4664,9 +4664,10 @@ if test $ac_verc_fail = yes; then fi -if test -n "`$LD --version | sed -n 's/^GNU \(gold\).*$/\1/p'`"; then +case $($LD --version) in + "GNU gold"*) # Accept gold 1.14 or higher - for ac_prog in $LD + for ac_prog in $LD do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4729,8 +4730,75 @@ if test $ac_verc_fail = yes; then LD=: critic_missing="$critic_missing GNU gold" fi + ;; + "LLD"*) + # Accept LLD 13.0.0 or higher + for ac_prog in $LD +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LD+:} false; then : + $as_echo_n "(cached) " >&6 else - for ac_prog in $LD + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LD="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LD=$ac_cv_prog_LD +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LD" && break +done + +if test -z "$LD"; then + ac_verc_fail=yes +else + # Found it, now check the version. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $LD" >&5 +$as_echo_n "checking version of $LD... " >&6; } + ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*LLD.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1[3-9].*|[2-9][0-9].*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 +$as_echo "$ac_prog_version" >&6; } +fi +if test $ac_verc_fail = yes; then + LD=: critic_missing="$critic_missing LLD" +fi + + ;; + *) + for ac_prog in $LD do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4793,7 +4861,8 @@ if test $ac_verc_fail = yes; then LD=: critic_missing="$critic_missing GNU ld" fi -fi + ;; +esac # These programs are version sensitive. for ac_prog in gnumake gmake make diff --git a/configure.ac b/configure.ac index 17a4c9a1ab..5632277f9c 100644 --- a/configure.ac +++ b/configure.ac @@ -995,18 +995,28 @@ AC_CHECK_PROG_VER(AS, $AS, --version, [2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as") -if test -n "`$LD --version | sed -n 's/^GNU \(gold\).*$/\1/p'`"; then +case $($LD --version) in + "GNU gold"*) # Accept gold 1.14 or higher - AC_CHECK_PROG_VER(LD, $LD, --version, + AC_CHECK_PROG_VER(LD, $LD, --version, [GNU gold.* \([0-9][0-9]*\.[0-9.]*\)], [1.1[4-9]*|1.[2-9][0-9]*|1.1[0-9][0-9]*|[2-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing GNU gold") -else - AC_CHECK_PROG_VER(LD, $LD, --version, + ;; + "LLD"*) + # Accept LLD 13.0.0 or higher + AC_CHECK_PROG_VER(LD, $LD, --version, + [LLD.* \([0-9][0-9]*\.[0-9.]*\)], + [1[3-9].*|[2-9][0-9].*], + LD=: critic_missing="$critic_missing LLD") + ;; + *) + AC_CHECK_PROG_VER(LD, $LD, --version, [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)], [2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing GNU ld") -fi + ;; +esac # These programs are version sensitive. AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,