about summary refs log tree commit diff
path: root/Makeconfig
diff options
context:
space:
mode:
Diffstat (limited to 'Makeconfig')
-rw-r--r--Makeconfig6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makeconfig b/Makeconfig
index 751e9ffa32..8e4c360c70 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -425,6 +425,11 @@ endif
 # Commands for linking programs with the C library.
 ifndef +link
 ifeq (yes,$(build-shared))
+ifeq (yes,$(build-pie-default))
+no-pie-ldflag = -no-pie
++link = $(+link-pie)
++link-tests = $(+link-pie-tests)
+else
 +link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
 	      $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
 	      $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
@@ -440,6 +445,7 @@ ifeq (yes,$(build-shared))
 	$(+link-after-libc)
 +link-tests = $(+link-before-libc) $(rtld-tests-LDFLAGS) \
 	      $(link-libc-tests) $(+link-after-libc)
+endif
 else
 +link = $(+link-static)
 +link-tests = $(+link-static-tests)