Message ID | 20230125170725.386430-1-hjl.tools@gmail.com |
---|---|
State | Repeat Merge |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp383376wrn; Wed, 25 Jan 2023 09:07:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXuG9s/9LoTYQCPUYw8x8B9UBMAASrJxzOuiNwkLnmVJv7c/9wcXxYWIkMMNqAQEatIrAeBU X-Received: by 2002:a17:907:6d21:b0:805:1e6e:6777 with SMTP id sa33-20020a1709076d2100b008051e6e6777mr61748058ejc.23.1674666464102; Wed, 25 Jan 2023 09:07:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674666464; cv=none; d=google.com; s=arc-20160816; b=XDSv6TNoJS6RCzBMNis8EHohkTUBZd3EYdOaDUzBOhY2KYiWkbfb2Io0zxynVBE0FN yEtDqrWm6PYTr7/mziyiDKPXI1kUfmdvtqwBJcMOMmct0UFC96flDH77tMiG1xKpwXaF AZBp/u+QrsyYCzD/n4JE0typEz0lmVEUb6RkpLaW+pukJE5G/FTY/xjlJp6Y6RCj5N3B 1htLxugk9CvIWVB15Ig/p6tag9kI1aWxeLnu7W+IlAjV00ySYeQ1JCZHe/wCYJ/oZQGC Swyugn7fgZWZqjJdgXCSVtFGOZl2hvhQqZpTJkbfDpd7liPhqSEe2VmXIkMChcW+SiH/ zGqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=U4BshCv+U5HAz4V3Y219OwI6RFntPZsM+yxJhGoEzoQ=; b=cNhR5AH4ojkroDS68bynPFtB0NnGB00hfrO+HrJw8aqrF7g4Nwpy9DuYj/P5ZBRvwV PCEuN+8nT4vIpwuCM1A+HppcoxsqPO72ClicokGYUc6rJ145DeYrYo5KFcxVwwLfD6eV W4x4fBbVV2jfm5hHEshmsCvEizUdKXlfUhDATCMd6QoHPXhXzAho2iuo+UFYhKd79Rnq YKJpgLY+OVMbcmBCFLJkPN6D9xG/uB5D9eu0ZqL7aybXKgNP55lc5fNJg1MaLtRNch1F 8kh1GiLCwNxutMYN4eCjFnR9fhWzENZeJ+SPw88gmiLduFDYra6kAh6xJ5vQ9yfJcUGV Wi5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=OpbcUKCV; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id 4-20020a170906024400b00877dde5c2a8si6739860ejl.753.2023.01.25.09.07.43 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 09:07:44 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=OpbcUKCV; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF5E33858D39 for <ouuuleilei@gmail.com>; Wed, 25 Jan 2023 17:07:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF5E33858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674666462; bh=U4BshCv+U5HAz4V3Y219OwI6RFntPZsM+yxJhGoEzoQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=OpbcUKCVKSRQGA4Jy2SXXMX3Afr0VHfIdL6giRfrs8dzW3IdzeUUmlHpt5UFVRUl9 hPeQDjcUV5pJ/Z/I76CXLCP9NP9jStCJ7I89kR5N1rrrKWVg4MHYUEhsBppig7YEG6 +7g5YJVKbuEr+QoBDA83O+h6RT2Py+BQPR5IU9Rk= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 5E3DC3858D28 for <binutils@sourceware.org>; Wed, 25 Jan 2023 17:07:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E3DC3858D28 Received: by mail-pg1-x52d.google.com with SMTP id q9so13827967pgq.5 for <binutils@sourceware.org>; Wed, 25 Jan 2023 09:07:31 -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:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U4BshCv+U5HAz4V3Y219OwI6RFntPZsM+yxJhGoEzoQ=; b=gttaBF6RA3bYSnO+PVW8HykTFQ58ms+hRsqa7aZWsRNhLCa28BlPve07uBrwvsSJL5 t5xZ2WikR5JAQmkZrYeU+wOhVHOfZvDI0s99TrLibyGKAgq9AN3q/fSVk8UsZApUNYSG Ku+R6PfNQg8ChJkJPKKaTrZMYA2kZMAmlrANDuy6JlnBElTd8Xiqm9V769Uc8sfmWQcb qJ55ETlJXwuBJx4OD3E7Bu50RlAXBo6GAhXleG/k2eqXMpF7RmmNUUFK4BgLC1tXhOhp Kmh0h1gn9pay4YdkSOD6r7t2gdm7dH9NTPgLpRXXepYWZJwv9CXrkrrOf9AnJkGROuSz wzBQ== X-Gm-Message-State: AO0yUKVK6YXKTBXgkoKd4p9+Nvdq3Wh2tol+IQwSsr2/1ozNRydnu/nG xpFoZmCcu3OcDDIuh1rqJ+V7MHQp8w4= X-Received: by 2002:aa7:939b:0:b0:590:6b27:badb with SMTP id t27-20020aa7939b000000b005906b27badbmr1485956pfe.0.1674666449727; Wed, 25 Jan 2023 09:07:29 -0800 (PST) Received: from gnu-cfl-3.localdomain ([172.56.30.15]) by smtp.gmail.com with ESMTPSA id d2-20020aa78142000000b005810c4286d6sm3895692pfn.0.2023.01.25.09.07.28 for <binutils@sourceware.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 09:07:29 -0800 (PST) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 8575F740158 for <binutils@sourceware.org>; Wed, 25 Jan 2023 09:07:25 -0800 (PST) To: binutils@sourceware.org Subject: [PATCH] i386: Pass -Wl,--no-as-needed to compiler as needed Date: Wed, 25 Jan 2023 09:07:25 -0800 Message-Id: <20230125170725.386430-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3023.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: "H.J. Lu via Binutils" <binutils@sourceware.org> Reply-To: "H.J. Lu" <hjl.tools@gmail.com> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756015061998894642?= X-GMAIL-MSGID: =?utf-8?q?1756015061998894642?= |
Series |
i386: Pass -Wl,--no-as-needed to compiler as needed
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | warning | Git am fail log |
Commit Message
H.J. Lu
Jan. 25, 2023, 5:07 p.m. UTC
Pass -Wl,--no-as-needed to linker tests to fix FAIL: Run pr19031 FAIL: Run got1 FAIL: Undefined weak symbol (-fPIE -no-pie) FAIL: Undefined weak symbol (-fPIE -pie) when --as-needed is passed to linker by compiler. PR ld/30050 * testsuite/ld-i386/i386.exp: Pass -Wl,--no-as-needed to compiler as needed. --- ld/testsuite/ld-i386/i386.exp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Comments
On 25.01.2023 18:07, H.J. Lu via Binutils wrote: > Pass -Wl,--no-as-needed to linker tests to fix > > FAIL: Run pr19031 > FAIL: Run got1 > FAIL: Undefined weak symbol (-fPIE -no-pie) > FAIL: Undefined weak symbol (-fPIE -pie) How come these four don't match (even in count) ... > --- a/ld/testsuite/ld-i386/i386.exp > +++ b/ld/testsuite/ld-i386/i386.exp > @@ -577,7 +577,8 @@ proc undefined_weak {cflags ldflags} { > run_ld_link_exec_tests [list \ > [list \ > "Run pr19704" \ > - "$ldflags tmpdir/libpr19704.so -Wl,-R,tmpdir" \ > + "$ldflags -Wl,--no-as-needed tmpdir/libpr19704.so \ > + -Wl,-R,tmpdir" \ > "-Wa,-mrelax-relocations=yes" \ > { pr19704a.c } \ > "pr19704" \ > @@ -1078,7 +1079,7 @@ if { [isnative] > ] \ > [list \ > "Run pr19031" \ > - "$NOPIE_LDFLAGS tmpdir/pr19031.so" \ > + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr19031.so" \ > "-Wa,-mx86-used-note=yes" \ > { pr19031b.S pr19031c.c } \ > "pr19031" \ > @@ -1087,7 +1088,7 @@ if { [isnative] > ] \ > [list \ > "Run got1" \ > - "$NOPIE_LDFLAGS tmpdir/got1d.so" \ > + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/got1d.so" \ > "-Wa,-mx86-used-note=yes" \ > { got1a.S got1b.c got1c.c } \ > "got1" \ ... the three tests (with the "Run ..." even visible in context)? Also it would have helped if you said a word on what it is that breaks with --as-needed. After all there might also be the option of adjusting overly strict expectations. (It is always somewhat questionable to "fight" compiler defaults by further command line overrides. That's not to say it's always the extra override which is wrong; sometimes it's also the compiler default which is to be put under question.) Jan
On Wed, Jan 25, 2023 at 11:41 PM Jan Beulich <jbeulich@suse.com> wrote: > > On 25.01.2023 18:07, H.J. Lu via Binutils wrote: > > Pass -Wl,--no-as-needed to linker tests to fix > > > > FAIL: Run pr19031 > > FAIL: Run got1 These 2 failed to link when --as-needed is passed to linker by compiler. The shared library is ignored by linker since it is placed before the .o files. > > FAIL: Undefined weak symbol (-fPIE -no-pie) > > FAIL: Undefined weak symbol (-fPIE -pie) These 2 failed at run-time when --as-needed is passed to linker by compiler. The shared library is ignored by linker since it is placed before the .o files. > How come these four don't match (even in count) ... > > > --- a/ld/testsuite/ld-i386/i386.exp > > +++ b/ld/testsuite/ld-i386/i386.exp > > @@ -577,7 +577,8 @@ proc undefined_weak {cflags ldflags} { > > run_ld_link_exec_tests [list \ > > [list \ > > "Run pr19704" \ > > - "$ldflags tmpdir/libpr19704.so -Wl,-R,tmpdir" \ > > + "$ldflags -Wl,--no-as-needed tmpdir/libpr19704.so \ > > + -Wl,-R,tmpdir" \ > > "-Wa,-mrelax-relocations=yes" \ > > { pr19704a.c } \ > > "pr19704" \ > > @@ -1078,7 +1079,7 @@ if { [isnative] > > ] \ > > [list \ > > "Run pr19031" \ > > - "$NOPIE_LDFLAGS tmpdir/pr19031.so" \ > > + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr19031.so" \ > > "-Wa,-mx86-used-note=yes" \ > > { pr19031b.S pr19031c.c } \ > > "pr19031" \ > > @@ -1087,7 +1088,7 @@ if { [isnative] > > ] \ > > [list \ > > "Run got1" \ > > - "$NOPIE_LDFLAGS tmpdir/got1d.so" \ > > + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/got1d.so" \ > > "-Wa,-mx86-used-note=yes" \ > > { got1a.S got1b.c got1c.c } \ > > "got1" \ > > ... the three tests (with the "Run ..." even visible in context)? Also > it would have helped if you said a word on what it is that breaks with > --as-needed. After all there might also be the option of adjusting > overly strict expectations. (It is always somewhat questionable to > "fight" compiler defaults by further command line overrides. That's not > to say it's always the extra override which is wrong; sometimes it's > also the compiler default which is to be put under question.) > > Jan
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index 89e8aee237c..5f53bcf29bc 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -577,7 +577,8 @@ proc undefined_weak {cflags ldflags} { run_ld_link_exec_tests [list \ [list \ "Run pr19704" \ - "$ldflags tmpdir/libpr19704.so -Wl,-R,tmpdir" \ + "$ldflags -Wl,--no-as-needed tmpdir/libpr19704.so \ + -Wl,-R,tmpdir" \ "-Wa,-mrelax-relocations=yes" \ { pr19704a.c } \ "pr19704" \ @@ -1078,7 +1079,7 @@ if { [isnative] ] \ [list \ "Run pr19031" \ - "$NOPIE_LDFLAGS tmpdir/pr19031.so" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr19031.so" \ "-Wa,-mx86-used-note=yes" \ { pr19031b.S pr19031c.c } \ "pr19031" \ @@ -1087,7 +1088,7 @@ if { [isnative] ] \ [list \ "Run got1" \ - "$NOPIE_LDFLAGS tmpdir/got1d.so" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/got1d.so" \ "-Wa,-mx86-used-note=yes" \ { got1a.S got1b.c got1c.c } \ "got1" \