public inbox for
help / color / mirror / Atom feed
* [glibc] Makerules: Generate with -fuse-ld=bfd
@ 2022-11-09  4:57 Fangrui Song
  0 siblings, 0 replies; only message in thread
From: Fangrui Song @ 2022-11-09  4:57 UTC (permalink / raw)
  To: glibc-cvs;h=2ae7990542e1955097aa21943e416dec70f867fa

commit 2ae7990542e1955097aa21943e416dec70f867fa
Author: Fangrui Song <>
Date:   Tue Nov 8 20:56:59 2022 -0800

    Makerules: Generate 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
    ( supports custom RELRO sections in the
    GNU ld dumped linker script.
    Reviewed-by: Sam James <>

 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 =
 # 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) $(common-objpfx)config.make $(..)Makerules
 	$(LINK.o) -shared -Wl,-O1 \
-		  -nostdlib -nostartfiles \
+		  -nostdlib -nostartfiles -fuse-ld=bfd \
 		  $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $( \
 		  -Wl,--verbose 2>/dev/null | \
 	  sed > $@T \

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-09  4:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09  4:57 [glibc] Makerules: Generate with -fuse-ld=bfd Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).