From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 3F8FF3858C83 for ; Tue, 8 Nov 2022 00:30:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3F8FF3858C83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Content-Type: multipart/signed; boundary="Apple-Mail=_356473E1-72F3-4FA6-A763-87896D094AEA"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: [PATCH] Makerules: Generate shlib.lds with -fuse-ld=bfd From: Sam James In-Reply-To: <20221108002235.6hdp4uvm2twy76ei@google.com> Date: Tue, 8 Nov 2022 00:29:52 +0000 Cc: Florian Weimer , libc-alpha@sourceware.org Message-Id: <4C2A24C2-0B26-40C3-8302-95689753AE4C@gentoo.org> References: <20221106181750.2859300-1-maskray@google.com> <87o7tjmaif.fsf@oldenburg.str.redhat.com> <96E39C71-C947-400A-B4BC-A07404C8BDDD@gentoo.org> <20221108002235.6hdp4uvm2twy76ei@google.com> To: Fangrui Song X-Mailer: Apple Mail (2.3731.200.110.1.12) X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,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 List-Id: --Apple-Mail=_356473E1-72F3-4FA6-A763-87896D094AEA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 8 Nov 2022, at 00:22, Fangrui Song via Libc-alpha = wrote: >=20 > On 2022-11-08, Sam James wrote: >>=20 >>=20 >>> On 7 Nov 2022, at 08:31, Florian Weimer via Libc-alpha = wrote: >>>=20 >>> * Fangrui Song: >>>=20 >>>> lld does not dump a linker script with --verbose (it does not use a >>>> linker script driven design and lots of linker processing is not >>>> serializable as a linker script anyway). With the default >>>> --with-default-link=3Dno build, $@T is empty and makes `test -s = $@T` fail. >>>>=20 >>>> Just dump the linker script with -fuse-ld=3Dbfd. lld since 15 >>>> (https://reviews.llvm.org/D124656) supports custom RELRO sections = in the >>>> GNU ld dumped linker script. >>>> --- >>>> Makerules | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>=20 >>>> diff --git a/Makerules b/Makerules >>>> index 09c0cf8357..2edc6ee4e1 100644 >>>> --- a/Makerules >>>> +++ b/Makerules >>>> @@ -553,7 +553,7 @@ else >>>> # not for shared objects >>>> $(common-objpfx)shlib.lds: $(common-objpfx)config.make = $(..)Makerules >>>> $(LINK.o) -shared -Wl,-O1 \ >>>> - -nostdlib -nostartfiles \ >>>> + -nostdlib -nostartfiles -fuse-ld=3Dbfd \ >>>> $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \ >>>> -Wl,--verbose 2>/dev/null | \ >>>> sed > $@T \ >>>=20 >>> Would you please add the comment? >>>=20 >>> I'm not sure if a configure check is required. We have a path = towards >>> removal of the custom linker script; the vfprintf refactor I posted = is a >>> first step. >>>=20 >>=20 >> That works for me. >>=20 >>=20 >=20 > Added comments... >=20 >=20 > =46rom 00ee52ee0753a8d849c23d4e051f10aa8a4e2074 Mon Sep 17 00:00:00 = 2001 > From: Fangrui Song > Date: Mon, 7 Nov 2022 16:21:13 -0800 > Subject: [PATCH] Makerules: Generate shlib.lds with -fuse-ld=3Dbfd >=20 > lld does not dump a linker script with --verbose (it does not use a > linker script driven design and lots of linker processing is not > serializable as a linker script anyway). With the default > --with-default-link=3Dno build, $@T is empty and makes `test -s $@T` = fail. >=20 > Just dump the linker script with -fuse-ld=3Dbfd. lld since 15 > (https://reviews.llvm.org/D124656) supports custom RELRO sections in = the > GNU ld dumped linker script. > --- Thanks! Reviewed-by: Sam James > --Apple-Mail=_356473E1-72F3-4FA6-A763-87896D094AEA Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY2mjAF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kPaAAQCu8d/CADfFVLeLrat1jEBnX0/QZd0I4I4OJ/2QGiGeMAD+O+eZQMOQvH9P 2egnPfZuOnZ4twlf6phAH/Nb2FjIiAE= =rpoX -----END PGP SIGNATURE----- --Apple-Mail=_356473E1-72F3-4FA6-A763-87896D094AEA--