From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7814) id E26F43858C53; Wed, 9 Nov 2022 04:57:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E26F43858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667969820; bh=dopbL8o+wyyu98BtNfR7CPi3TUV8SFAeu/icnQQLYsY=; h=From:To:Subject:Date:From; b=UkF7tumwVvGawQzASfL3dD8zHyHBYhY9kOaBW8kVDDlHHpgfwE3vqUMY/GaZTRL6f bZBHKdfHrIE7tP82Jz+82YW7Z2VM+f1XJeUWpSAIqR/4eU1t4SM6RonJBQ66Mkk6YN +KZwZ0evzmRbkYfDLjrIWS9zp7P5VQzt08Fy1vpk= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Fangrui Song To: glibc-cvs@sourceware.org Subject: [glibc] Makerules: Generate shlib.lds with -fuse-ld=bfd X-Act-Checkin: glibc X-Git-Author: Fangrui Song X-Git-Refname: refs/heads/master X-Git-Oldrev: 52cf11004eb10f8ebbc193fbdf4094cfecb3dbff X-Git-Newrev: 2ae7990542e1955097aa21943e416dec70f867fa Message-Id: <20221109045700.E26F43858C53@sourceware.org> Date: Wed, 9 Nov 2022 04:57:00 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2ae7990542e1955097aa21943e416dec70f867fa commit 2ae7990542e1955097aa21943e416dec70f867fa Author: Fangrui Song Date: Tue Nov 8 20:56:59 2022 -0800 Makerules: Generate shlib.lds with -fuse-ld=bfd 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. Reviewed-by: Sam James Diff: --- Makerules | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makerules b/Makerules index 09c0cf8357..a41491429e 100644 --- a/Makerules +++ b/Makerules @@ -546,14 +546,16 @@ endef ifeq (yes,$(use-default-link)) # If the linker is good enough, we can let it use its default linker script. +# In the long term the custom linker script will be removed. shlib-lds = shlib-lds-flags = else # binutils only position loadable notes into the first page for binaries, # not for shared objects +# lld --verbose does not dump a linker script. Use -fuse-ld=bfd. $(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 \