From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6A2CA3858035 for ; Mon, 7 Nov 2022 08:31:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A2CA3858035 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667809869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JgFvNSgVofYJ/sEuILbOmJzzta2AWFIEzkpKdlLd05s=; b=E+K1Ty/E3rqtDzOU6e9BMaWt/Zhr3+OgOMA3/inbCFe5fLIWthkfXOnuoipxLORUoWtAno B6Y/yDRa0RvTO3Br1mYzTHJMIziukrLB45+Ml89tiu6lD+8i8/+4waIkMBmrRA05dodwAG Po8PXENKV1o9ZRGfPmKPFc2Ie7s39qg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-7kvUpyEANaSPKMUU6j84mQ-1; Mon, 07 Nov 2022 03:31:07 -0500 X-MC-Unique: 7kvUpyEANaSPKMUU6j84mQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 31DF33C0E459; Mon, 7 Nov 2022 08:31:07 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.86]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B397E1121314; Mon, 7 Nov 2022 08:31:06 +0000 (UTC) From: Florian Weimer To: Fangrui Song Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] Makerules: Generate shlib.lds with -fuse-ld=bfd References: <20221106181750.2859300-1-maskray@google.com> Date: Mon, 07 Nov 2022 09:31:04 +0100 In-Reply-To: <20221106181750.2859300-1-maskray@google.com> (Fangrui Song's message of "Sun, 6 Nov 2022 18:17:50 +0000") Message-ID: <87o7tjmaif.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: * Fangrui Song: > 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=no build, $@T is empty and makes `test -s $@T` fail. > > Just dump the linker script with -fuse-ld=bfd. 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(-) > > 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=bfd \ > $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \ > -Wl,--verbose 2>/dev/null | \ > sed > $@T \ Would you please add the comment? 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. Thanks, Florian