aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makeconfig7
-rw-r--r--Makerules2
-rw-r--r--elf/Makefile48
-rw-r--r--nptl/Makefile4
-rw-r--r--stdlib/Makefile2
-rw-r--r--sysdeps/powerpc/powerpc64/le/Makefile2
6 files changed, 31 insertions, 34 deletions
diff --git a/Makeconfig b/Makeconfig
index 44b5f3a..6d8e24f 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -336,9 +336,6 @@ ifndef asm-CPPFLAGS
asm-CPPFLAGS =
endif
-as-needed := -Wl,--as-needed
-no-as-needed := -Wl,--no-as-needed
-
# Must be supported by the linker.
no-whole-archive = -Wl,--no-whole-archive
whole-archive = -Wl,--whole-archive
@@ -569,8 +566,8 @@ endif # build-hardcoded-path-in-tests
link-libc-before-gnulib = $(common-objpfx)libc.so$(libc.so-version) \
$(common-objpfx)$(patsubst %,$(libtype.oS),c) \
- $(as-needed) $(elf-objpfx)ld.so \
- $(no-as-needed)
+ -Wl,--as-needed $(elf-objpfx)ld.so \
+ -Wl,--no-as-needed
link-libc = $(link-libc-before-gnulib) $(gnulib)
link-libc-tests-after-rpath-link = $(link-libc-before-gnulib) $(gnulib-tests)
diff --git a/Makerules b/Makerules
index f513458..23fb5db 100644
--- a/Makerules
+++ b/Makerules
@@ -513,7 +513,7 @@ endif
link-libc-args = -Wl,--start-group \
$(libc-for-link) \
$(common-objpfx)libc_nonshared.a \
- $(as-needed) $(elf-objpfx)ld.so $(no-as-needed) \
+ -Wl,--as-needed $(elf-objpfx)ld.so -Wl,--no-as-needed \
-Wl,--end-group
# The corresponding shared libc to use. This may be modified for a
diff --git a/elf/Makefile b/elf/Makefile
index 0debea7..b2b3be2 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -690,20 +690,20 @@ $(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o
$(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o
tst-null-argv-ENV = LD_DEBUG=all LD_DEBUG_OUTPUT=$(objpfx)tst-null-argv.debug.out
-LDFLAGS-nodel2mod3.so = $(no-as-needed)
-LDFLAGS-reldepmod5.so = $(no-as-needed)
-LDFLAGS-reldep6mod1.so = $(no-as-needed)
-LDFLAGS-reldep6mod4.so = $(no-as-needed)
-LDFLAGS-reldep8mod3.so = $(no-as-needed)
-LDFLAGS-unload4mod1.so = $(no-as-needed)
-LDFLAGS-unload4mod2.so = $(no-as-needed)
-LDFLAGS-tst-initorder = $(no-as-needed)
-LDFLAGS-tst-initordera2.so = $(no-as-needed)
-LDFLAGS-tst-initordera3.so = $(no-as-needed)
-LDFLAGS-tst-initordera4.so = $(no-as-needed)
-LDFLAGS-tst-initorderb2.so = $(no-as-needed)
-LDFLAGS-tst-tlsmod5.so = -nostdlib $(no-as-needed)
-LDFLAGS-tst-tlsmod6.so = -nostdlib $(no-as-needed)
+LDFLAGS-nodel2mod3.so = -Wl,--no-as-needed
+LDFLAGS-reldepmod5.so = -Wl,--no-as-needed
+LDFLAGS-reldep6mod1.so = -Wl,--no-as-needed
+LDFLAGS-reldep6mod4.so = -Wl,--no-as-needed
+LDFLAGS-reldep8mod3.so = -Wl,--no-as-needed
+LDFLAGS-unload4mod1.so = -Wl,--no-as-needed
+LDFLAGS-unload4mod2.so = -Wl,--no-as-needed
+LDFLAGS-tst-initorder = -Wl,--no-as-needed
+LDFLAGS-tst-initordera2.so = -Wl,--no-as-needed
+LDFLAGS-tst-initordera3.so = -Wl,--no-as-needed
+LDFLAGS-tst-initordera4.so = -Wl,--no-as-needed
+LDFLAGS-tst-initorderb2.so = -Wl,--no-as-needed
+LDFLAGS-tst-tlsmod5.so = -nostdlib -Wl,--no-as-needed
+LDFLAGS-tst-tlsmod6.so = -nostdlib -Wl,--no-as-needed
testobj1.so-no-z-defs = yes
testobj3.so-no-z-defs = yes
@@ -838,7 +838,7 @@ $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)
$(objpfx)noload: $(objpfx)testobj1.so $(libdl)
-LDFLAGS-noload = -rdynamic $(no-as-needed)
+LDFLAGS-noload = -rdynamic -Wl,--no-as-needed
$(objpfx)noload.out: $(objpfx)testobj5.so
$(objpfx)noload-mem.out: $(objpfx)noload.out
@@ -887,7 +887,7 @@ $(objpfx)reldep4: $(libdl)
$(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so
$(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so $(libdl)
-LDFLAGS-next = $(no-as-needed)
+LDFLAGS-next = -Wl,--no-as-needed
$(objpfx)unload2: $(libdl)
$(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so
@@ -1055,8 +1055,8 @@ CFLAGS-tst-execstack-prog.c += -Wno-trampolines
CFLAGS-tst-execstack-mod.c += -Wno-trampolines
endif
-LDFLAGS-tst-array2 = $(no-as-needed)
-LDFLAGS-tst-array5 = $(no-as-needed)
+LDFLAGS-tst-array2 = -Wl,--no-as-needed
+LDFLAGS-tst-array5 = -Wl,--no-as-needed
$(objpfx)tst-array1-cmp.out: tst-array1.exp $(objpfx)tst-array1.out
cmp $^ > $@; \
@@ -1254,8 +1254,8 @@ $(objpfx)order2mod1.so: $(objpfx)order2mod4.so
$(objpfx)order2mod4.so: $(objpfx)order2mod3.so
$(objpfx)order2mod2.so: $(objpfx)order2mod3.so
order2mod2.so-no-z-defs = yes
-LDFLAGS-order2mod1.so = $(no-as-needed)
-LDFLAGS-order2mod2.so = $(no-as-needed)
+LDFLAGS-order2mod1.so = -Wl,--no-as-needed
+LDFLAGS-order2mod2.so = -Wl,--no-as-needed
tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
@@ -1403,10 +1403,10 @@ $(objpfx)tst-initorder2: $(objpfx)tst-initorder2a.so $(objpfx)tst-initorder2d.so
$(objpfx)tst-initorder2a.so: $(objpfx)tst-initorder2b.so
$(objpfx)tst-initorder2b.so: $(objpfx)tst-initorder2c.so
$(objpfx)tst-initorder2c.so: $(objpfx)tst-initorder2d.so
-LDFLAGS-tst-initorder2 = $(no-as-needed)
-LDFLAGS-tst-initorder2a.so = $(no-as-needed)
-LDFLAGS-tst-initorder2b.so = $(no-as-needed)
-LDFLAGS-tst-initorder2c.so = $(no-as-needed)
+LDFLAGS-tst-initorder2 = -Wl,--no-as-needed
+LDFLAGS-tst-initorder2a.so = -Wl,--no-as-needed
+LDFLAGS-tst-initorder2b.so = -Wl,--no-as-needed
+LDFLAGS-tst-initorder2c.so = -Wl,--no-as-needed
define o-iterator-doit
$(objpfx)tst-initorder2$o.os: tst-initorder2.c; \
$$(compile-command.c) -DNAME=\"$o\"
diff --git a/nptl/Makefile b/nptl/Makefile
index bcf97ec..fffd946 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -591,7 +591,7 @@ $(objpfx)tst-tls4: $(libdl) $(shared-thread-library)
$(objpfx)tst-tls4.out: $(objpfx)tst-tls4moda.so $(objpfx)tst-tls4modb.so
$(objpfx)tst-tls5: $(objpfx)tst-tls5mod.so $(shared-thread-library)
-LDFLAGS-tst-tls5 = $(no-as-needed)
+LDFLAGS-tst-tls5 = -Wl,--no-as-needed
LDFLAGS-tst-tls5mod.so = -Wl,-soname,tst-tls5mod.so
ifeq ($(build-shared),yes)
@@ -631,7 +631,7 @@ LDFLAGS-tst-_res1mod2.so = -Wl,-soname,tst-_res1mod2.so
$(objpfx)tst-_res1: $(objpfx)tst-_res1mod1.so $(objpfx)tst-_res1mod2.so \
$(shared-thread-library)
-LDLIBS-tst-cancel24 = $(no-as-needed) -lstdc++
+LDLIBS-tst-cancel24 = -Wl,--no-as-needed -lstdc++
LDLIBS-tst-cancel24-static = $(LDLIBS-tst-cancel24)
extra-B-pthread.so = -B$(common-objpfx)nptl/
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 8ca82f8..c852028 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -211,7 +211,7 @@ $(objpfx)tst-fmtmsg.out: tst-fmtmsg.sh $(objpfx)tst-fmtmsg
$(evaluate-test)
$(objpfx)tst-putenv: $(objpfx)tst-putenvmod.so
-LDFLAGS-tst-putenv = $(no-as-needed)
+LDFLAGS-tst-putenv = -Wl,--no-as-needed
$(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
$(build-module)
diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile
index f59db1c..0ce3868 100644
--- a/sysdeps/powerpc/powerpc64/le/Makefile
+++ b/sysdeps/powerpc/powerpc64/le/Makefile
@@ -4,7 +4,7 @@
# libgcc requires __tcb_parse_hwcap_and_convert_at_platform when built with
# a binary128 type. That symbol is provided by the loader on dynamically
# linked executables, forcing to link the loader after libgcc link.
-f128-loader-link = $(as-needed) $(elf-objpfx)ld.so $(no-as-needed)
+f128-loader-link = -Wl,--as-needed $(elf-objpfx)ld.so -Wl,--no-as-needed
ifeq ($(subdir),math)
# sqrtf128 requires emulation before POWER9.