From patchwork Mon Dec 28 19:48:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 41571 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 8DBFC3844061; Mon, 28 Dec 2020 19:49:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8DBFC3844061 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609184947; bh=TqVvpSQsdbsanTFopFzAAI/Hdm5ny0Mys0tZVbMO0zg=; 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=O8l+q7BmTb8/XYXmBwOZpxnKk3Mgb0h2dJ0dwPMld7RVpXOYF6eKTB3v2qAH3vQor FH/nOsuGpDoKFgtSVifgCKh1H5xsy2DBOlDoHsuEyrBLSK9xu6BkWBcJLiJv4TZkGc ARo6qLXURE3TUoB75JuTbJBlhIlr1NX+vs3zy2Jw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by sourceware.org (Postfix) with ESMTPS id C1CEA3858010 for ; Mon, 28 Dec 2020 19:49:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C1CEA3858010 Received: by mail-qk1-x749.google.com with SMTP id x74so8700536qkb.12 for ; Mon, 28 Dec 2020 11:49:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=TqVvpSQsdbsanTFopFzAAI/Hdm5ny0Mys0tZVbMO0zg=; b=pDg3TJ6kHiZlF+SLBgyS6X+rQrox4sYPGa7V2ZBlvErwAuc5A8ElXcERvzilzG4MA/ 8vrUJX/i/1YZRbVQpy9OlfLO9TrAowhkdGWX5zH9jTjxiPfIgDneTI7ocfxMVDDjuw3D 4WtAte9EITMWVqIHZf8MH79At6X5MtslrClBmLT4ZfmqDS+PYucQd3TDAJUkdmFOz1Ja qxw4LsXfBwMFflsMAePXACvTROhOdcNEeplm3eFfLyStAe84dMcHuibKhZ2qof8Ai0jt sMC7NVYUgBXHgvvx2DYk8xl5Ms4RHQX6YXWjxfEiisGgcNo/HxGtDeCUtpkD3Uc+v6uz 0phA== X-Gm-Message-State: AOAM5329XPGZWx9Ts/5ZJWMNmL5HKiqKYQ1iIAfQR1mi8Pz57iPxGkF+ l27vy2jBmdFprEnNPamxW8a64KvppibecTQ1O8vX5DU8upyxaCK6msNZBpAQERJVcWQ1jpOhQ1P 7eUlyX2BCzT4wR1tEk0/0xB4ijNLDdvrzoZ6XrB4UEFIHmYXrtAtOcW0uHSUtP96sGzMp X-Google-Smtp-Source: ABdhPJxMTHT8n9JEfUG7TSz6xBRsvfWsujy8r3YmYVkx8sgmptxDVgRRcNtug73itnNtO1v9Wyzpc4r4ifEh X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:0:a6ae:11ff:fe11:4abb]) (user=maskray job=sendgmr) by 2002:ad4:4c50:: with SMTP id cs16mr48745369qvb.33.1609184944270; Mon, 28 Dec 2020 11:49:04 -0800 (PST) Date: Mon, 28 Dec 2020 11:48:53 -0800 In-Reply-To: <20201228194855.510315-1-maskray@google.com> Message-Id: <20201228194855.510315-2-maskray@google.com> Mime-Version: 1.0 References: <20201228194855.510315-1-maskray@google.com> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH 1/3] configure: Allow LD to be a linker other than GNU ld and gold To: libc-alpha@sourceware.org X-Spam-Status: No, score=-19.4 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@sourceware.org Sender: "Libc-alpha" When using lld as the linker, configure prints a confusing message. *** These critical programs are missing or too old: GNU ld lld>=8 can build glibc with very few patches. lld may be built with a custom version information (e.g. git commit ID), so a version check is not useful at all. --- configure | 13 ++++++++----- configure.ac | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 6a35553805..6dcd2270f8 100755 --- a/configure +++ b/configure @@ -4601,9 +4601,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 @@ -4666,8 +4667,9 @@ if test $ac_verc_fail = yes; then LD=: critic_missing="$critic_missing GNU gold" fi -else - for ac_prog in $LD + ;; + "GNU 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 @@ -4730,7 +4732,8 @@ if test $ac_verc_fail = yes; then LD=: critic_missing="$critic_missing GNU ld" fi -fi + ;; +esac # These programs are version sensitive. diff --git a/configure.ac b/configure.ac index 43cfac9d48..1a2054cd1a 100644 --- a/configure.ac +++ b/configure.ac @@ -979,18 +979,21 @@ 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, + ;; + "GNU ld"*) + 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_TOOL_PREFIX From patchwork Mon Dec 28 19:48:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 41572 X-Patchwork-Delegate: carlos@redhat.com 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 3D41B3875414; Mon, 28 Dec 2020 19:49:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D41B3875414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609184950; bh=iLNXrLXzW6YJVpPHP1sLs0ZvCN1QLQq+/LnEnypZU1g=; 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=WGbxngy6Uq3YsJYWWD3HAbHrbDCqrc1AX+mq0kyryDY662rOy3CLqR7vpQer2GpPi TOLkAZxi+gUsV1wm8bnEkRfTc53Lp1yLn+70c2QWiT0is3VuSrqCnpsWQPMGWWBj/5 wubIUXBRI9rIfCxQpvnLwyJ3U50m1mMgsUuahdp4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by sourceware.org (Postfix) with ESMTPS id 688553861887 for ; Mon, 28 Dec 2020 19:49:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 688553861887 Received: by mail-yb1-xb49.google.com with SMTP id k7so19694222ybm.13 for ; Mon, 28 Dec 2020 11:49:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=iLNXrLXzW6YJVpPHP1sLs0ZvCN1QLQq+/LnEnypZU1g=; b=lrmLBW1jpI+U+sI/kEJfAi8JFG4q7cTrrWzUEH/G0j6a/+s6ACeYmB6fcrUOXPxMgH E5wypQ9mignPDx+vp5mjcMD7n0P0uUnMCxERLRJGwvNdqRVzFF0eYoKZf9lmUzrPWlOV CGo4XEM2QyA4u+KArl2HeALSXK7LkDGXuTtBjHnHTf41UKtb1Ej3sU1Ts6+OwWxaDyTw K3LXoF7HraKhtQgp+jleN3VhBuAoNFsZo09Eol20cZdDSbr39gfTKXQbdkimfYS9cN83 LOKtUmagzHUpo5s1QSNbFjluSVFAbsZC+Ew9XCvCLX/2CVKFq6lnSCXnHQiK5XLcqfql XcUg== X-Gm-Message-State: AOAM532Lf0sXwFog0ySEsErO/Qg2w9NovKm1j7On07zzL2k9Q03q4ppn 7AWnI0IhVCZN6zYn6+VKuECNABY5qO6rGya4G3vQa3r4jygAmmcWIlJb6RyvFiEnS23VCnMlYUf 4tooCW6NhZmrg3M2R0Pr3pEmIFUJqL7GALK4zbUOzY+UBMeRrhZQCOf8jCD/fV7hf4SEw X-Google-Smtp-Source: ABdhPJwHsZamxSIwy6WCcJUDaTO/HsSQVB3lDY5DYlOdB4iOkAfk2rTCfjC3uDvx5aXL1JpgJtSL+Ja7EMot X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:0:a6ae:11ff:fe11:4abb]) (user=maskray job=sendgmr) by 2002:a25:aa45:: with SMTP id s63mr66032979ybi.471.1609184947926; Mon, 28 Dec 2020 11:49:07 -0800 (PST) Date: Mon, 28 Dec 2020 11:48:54 -0800 In-Reply-To: <20201228194855.510315-1-maskray@google.com> Message-Id: <20201228194855.510315-3-maskray@google.com> Mime-Version: 1.0 References: <20201228194855.510315-1-maskray@google.com> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH 2/3] elf: Replace a --defsym trick with an object file to be compatible with lld To: libc-alpha@sourceware.org X-Spam-Status: No, score=-19.9 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@sourceware.org Sender: "Libc-alpha" The existing code specifies -Wl,--defsym=malloc=0 and other malloc.os definitions before libc_pic.a so that libc_pic.a(malloc.os) is not fetched. This trick is used to avoid multiple definition errors which would happen as a chain result: dl-allobjs.os has an undefined __libc_scratch_buffer_set_array_size __libc_scratch_buffer_set_array_size fetches libc_pic.a(scratch_buffer_set_array_size.os) libc_pic.a(scratch_buffer_set_array_size.os) has an undefined free free fetches libc_pic.a(malloc.os) libc_pic.a(malloc.os) has an undefined __libc_message __libc_message fetches libc_pic.a(libc_fatal.os) libc_fatal.os will cause a multiple definition error (__GI___libc_fatal) >>> defined at dl-fxstatat64.c >>> /tmp/p/glibc/Release/elf/dl-allobjs.os:(__GI___libc_fatal) >>> defined at libc_fatal.c >>> libc_fatal.os:(.text+0x240) in archive /tmp/p/glibc/Release/libc_pic.a lld processes --defsym after all input files, so this trick does not suppress multiple definition errors with lld. Split the step into two and use an object file to make the intention more obvious and make lld work. This is conceptually more appropriate because --defsym defines a SHN_ABS symbol while a normal definition is relative to the image base. See https://sourceware.org/pipermail/libc-alpha/2020-March/111910.html for discussions about the --defsym semantics. --- elf/Makefile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index 0b4d78c874..299bf24b49 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -524,10 +524,6 @@ rtld-stubbed-symbols = \ malloc \ realloc \ -# The GCC arguments that implement $(rtld-stubbed-symbols). -rtld-stubbed-symbols-args = \ - $(patsubst %,-Wl$(comma)--defsym=%=0, $(rtld-stubbed-symbols)) - ifeq ($(have-ssp),yes) # rtld is not built with the stack protector, so these references will # go away in the rebuilds. @@ -536,9 +532,10 @@ endif $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a @-rm -f $@T - $(reloc-link) -o $@.o $(rtld-stubbed-symbols-args) \ - '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T - rm -f $@.o + echo '$(patsubst %,.globl %;,$(rtld-stubbed-symbols)) $(patsubst %,%:,$(rtld-stubbed-symbols))' | \ + $(CC) -o $@T.o $(ASFLAGS) -c -x assembler - + $(reloc-link) -o $@.o $@T.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T + rm -f %@T.o $@.o mv -f $@T $@ # For lld, skip preceding addresses and values before matching the archive and the member. From patchwork Mon Dec 28 19:48:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 41573 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 C6E863836C5C; Mon, 28 Dec 2020 19:49:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6E863836C5C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609184954; bh=j+5WcQRqDiNkf53Ih9rFpN5Vucdts5zhZhH97neA/C4=; 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=DyGi0yT26SB0WREM8sqtX+6JRLaFunpTyivcob9wJSJWIGghtp2hP6SqXMaRWBVbc 10mC45XC7pp5CC48THFWE7nwSS7mNzOg9YuZHbXW5RKjNDw1oYkDnjEqfshCgJDVWU KDXwIJRHojO+FrKYp18ITphVwE2TAZ6RgyJcN5vE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by sourceware.org (Postfix) with ESMTPS id 1E2873836C44 for ; Mon, 28 Dec 2020 19:49:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1E2873836C44 Received: by mail-pg1-x549.google.com with SMTP id 26so8607804pgl.2 for ; Mon, 28 Dec 2020 11:49:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=j+5WcQRqDiNkf53Ih9rFpN5Vucdts5zhZhH97neA/C4=; b=uiLhviIADCk4LyWjeTAGf9AyVv7L6eeh/INRK0tMvpwuNztwlRR8hvYFZUewM4ac+/ ydN0BhahxRXLJ907QL8ylFVcn2WeawbLCgsZOnrXVVEJ3EUev9UTTzidEOeCmuVNIrfW sioelOfWE0te07So1gW+aIo85OYyVvIUs4SGXRyhXYsyczDEIxZ7VbOiNYL6JBJ/PSri HFOGmX425XmI7Y4ijhHkTrSa/OkPY8WYryq5cGkM5yJ0W0ho79PDdNH5cvf/EhkeVJPP VEpNMuEaopEIXjJdXESwBGXV14nNJQoZg+d0JDPFR+0WmkHwWEtUT2Q6Ycf2OVNy1Zh0 r+dQ== X-Gm-Message-State: AOAM530PIsm3GQS3vhR0YEeiykJyV6qjZNwC/yIivR0HnS8ufZ0OVt59 reZOo5zJKRTJp7I/+o7yB8w0pJaLQpGhGbL3lIxL0NREbwaCsqgUAFoUOLjD2ZQ5VIQabTo44wx DYW6QfN/PcImMO28oZYRGmAg6hSHnqR15zFZwF55okZs9VrDueXEWBp6eiELsIANjavcf X-Google-Smtp-Source: ABdhPJzyLfY6D9URqCBpOVQgZKWBfwHuaiY6HAIEJOmVYQuiOjXtVXMWGyxXirBOfSx0HLZUolFGARkvJoiV X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:0:a6ae:11ff:fe11:4abb]) (user=maskray job=sendgmr) by 2002:a17:90a:f00f:: with SMTP id bt15mr449422pjb.209.1609184951115; Mon, 28 Dec 2020 11:49:11 -0800 (PST) Date: Mon, 28 Dec 2020 11:48:55 -0800 In-Reply-To: <20201228194855.510315-1-maskray@google.com> Message-Id: <20201228194855.510315-4-maskray@google.com> Mime-Version: 1.0 References: <20201228194855.510315-1-maskray@google.com> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH 3/3] install: Replace scripts/output-format.sed with objdump -f [BZ #26559] To: libc-alpha@sourceware.org X-Spam-Status: No, score=-19.3 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@sourceware.org Sender: "Libc-alpha" GNU ld and gold have supported --print-output-format since 2011. glibc requires binutils>=2.25 (2015), so if LD is GNU ld or gold, we can assume the option is supported. lld is by default a cross linker supporting multiple targets. It auto detects the file format and does not need OUTPUT_FORMAT. It does not support --print-output-format. By parsing objdump -f, we can support all the three linkers. Reviewed-by: Adhemerval Zanella --- Makerules | 13 ++----- .../strcoll-inputs/filelist#en_US.UTF-8 | 1 - config.make.in | 1 - configure | 19 ---------- configure.ac | 11 ------ scripts/output-format.sed | 35 ------------------- 6 files changed, 3 insertions(+), 77 deletions(-) delete mode 100644 scripts/output-format.sed diff --git a/Makerules b/Makerules index ef0fe67d9a..146d1ab650 100644 --- a/Makerules +++ b/Makerules @@ -1065,20 +1065,13 @@ install: $(inst_slibdir)/libc.so$(libc.so-version) # for the configuration we are building. We put this statement into # the linker scripts we install for -lc et al so that they will not be # used by a link for a different format on a multi-architecture system. -$(common-objpfx)format.lds: $(..)scripts/output-format.sed \ - $(common-objpfx)config.make \ +$(common-objpfx)format.lds: $(common-objpfx)config.make \ $(common-objpfx)config.h $(..)Makerules -ifneq (unknown,$(output-format)) - echo > $@.new 'OUTPUT_FORMAT($(output-format))' -else $(LINK.o) -shared $(sysdep-LDFLAGS) $(rtld-LDFLAGS) \ $(LDFLAGS.so) $(LDFLAGS-lib.so) \ - -x c /dev/null -o $@.so -Wl,--verbose -v 2>/dev/null \ - | sed -n -f $< > $@.new - test -s $@.new + -x c /dev/null -o $@.so 2>/dev/null + $(OBJDUMP) -f $@.so | sed -n 's/.*file format \(.*\)/OUTPUT_FORMAT(\1)/;T;p' > $@ rm -f $@.so -endif - mv -f $@.new $@ common-generated += format.lds ifndef subdir diff --git a/benchtests/strcoll-inputs/filelist#en_US.UTF-8 b/benchtests/strcoll-inputs/filelist#en_US.UTF-8 index 2f4ef195bb..43eb9efb40 100644 --- a/benchtests/strcoll-inputs/filelist#en_US.UTF-8 +++ b/benchtests/strcoll-inputs/filelist#en_US.UTF-8 @@ -9450,7 +9450,6 @@ move-if-change check-execstack.awk pylint pylintrc -output-format.sed merge-test-results.sh update-copyrights config-uname.sh diff --git a/config.make.in b/config.make.in index 7ae27564fd..7f47f0caa4 100644 --- a/config.make.in +++ b/config.make.in @@ -73,7 +73,6 @@ fno-unit-at-a-time = @fno_unit_at_a_time@ bind-now = @bindnow@ have-hash-style = @libc_cv_hashstyle@ use-default-link = @use_default_link@ -output-format = @libc_cv_output_format@ have-cxx-thread_local = @libc_cv_cxx_thread_local@ have-loop-to-function = @libc_cv_cc_loop_to_function@ have-textrel_ifunc = @libc_cv_textrel_ifunc@ diff --git a/configure b/configure index 6dcd2270f8..4b0ab150cb 100755 --- a/configure +++ b/configure @@ -623,7 +623,6 @@ libc_cv_cc_submachine libc_cv_cc_nofma libc_cv_mtls_dialect_gnu2 fno_unit_at_a_time -libc_cv_output_format libc_cv_has_glob_dat libc_cv_hashstyle libc_cv_fpie @@ -6077,24 +6076,6 @@ fi $as_echo "$libc_cv_has_glob_dat" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker output format" >&5 -$as_echo_n "checking linker output format... " >&6; } -if ${libc_cv_output_format+:} false; then : - $as_echo_n "(cached) " >&6 -else - if libc_cv_output_format=` -${CC-cc} -nostartfiles -nostdlib $no_ssp -Wl,--print-output-format 2>&5` -then - : -else - libc_cv_output_format= -fi -test -n "$libc_cv_output_format" || libc_cv_output_format=unknown -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_output_format" >&5 -$as_echo "$libc_cv_output_format" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fno-toplevel-reorder -fno-section-anchors" >&5 $as_echo_n "checking for -fno-toplevel-reorder -fno-section-anchors... " >&6; } if ${libc_cv_fno_toplevel_reorder+:} false; then : diff --git a/configure.ac b/configure.ac index 1a2054cd1a..baf3a05ae7 100644 --- a/configure.ac +++ b/configure.ac @@ -1432,17 +1432,6 @@ fi rm -f conftest*]) AC_SUBST(libc_cv_has_glob_dat) -AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl -if libc_cv_output_format=` -${CC-cc} -nostartfiles -nostdlib $no_ssp -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD` -then - : -else - libc_cv_output_format= -fi -test -n "$libc_cv_output_format" || libc_cv_output_format=unknown]) -AC_SUBST(libc_cv_output_format) - AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl cat > conftest.c <