summaryrefslogtreecommitdiff
path: root/Rules
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-05-13 23:31:43 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-13 23:31:43 -0400
commitda62f81bdd23bb5095cd54c0b34ae6d5a93df69e (patch)
tree1045b2d50648b4b24cfbcda07c3929bcad2da4f3 /Rules
parent20030ae6d7e7187d7caf1b23c4aa5471fcf56d47 (diff)
Add support for generated PIE link rules
Diffstat (limited to 'Rules')
-rw-r--r--Rules18
1 files changed, 16 insertions, 2 deletions
diff --git a/Rules b/Rules
index 5ace24cee0..00f03df6da 100644
--- a/Rules
+++ b/Rules
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2000,2002,2003,2004,2005,2006
+# Copyright (C) 1991-2000,2002,2003,2004,2005,2006,2011
# Free Software Foundation, Inc.
# This file is part of the GNU C Library.
@@ -106,12 +106,19 @@ endif
ifeq ($(build-programs),yes)
binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
binaries-static = $(others-static) $(tests-static) $(xtests-static)
+ifeq (yesyes,$(have-fpie)$(build-shared))
+binaries-pie = $(others-pie) $(tests-pie) $(xtests-pie)
+else
+binaries-pie =
+endif
else
binaries-all = $(tests) $(xtests) $(test-srcs)
binaries-static =
+binaries-pie =
endif
-binaries-shared = $(filter-out $(binaries-static), $(binaries-all))
+binaries-shared = $(filter-out $(binaries-pie) $(binaries-static), \
+ $(binaries-all))
ifneq "$(strip $(binaries-shared))" ""
$(addprefix $(objpfx),$(binaries-shared)): %: %.o \
@@ -120,6 +127,13 @@ $(addprefix $(objpfx),$(binaries-shared)): %: %.o \
$(+link)
endif
+ifneq "$(strip $(binaries-pie))" ""
+$(addprefix $(objpfx),$(binaries-pie)): %: %.o \
+ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
+ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
+ $(+link-pie)
+endif
+
ifneq "$(strip $(binaries-static))" ""
$(addprefix $(objpfx),$(binaries-static)): %: %.o \
$(sort $(filter $(common-objpfx)lib%,$(link-libc-static))) \