]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Add rules for static PIE build
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 11 Dec 2021 22:08:32 +0000 (23:08 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 11 Dec 2021 23:42:13 +0000 (00:42 +0100)
This fixes [BZ #28671].

csu/Makefile
sysdeps/mach/hurd/Makefile

index e2390e4a7deb694183ba1049fde1f2818b3facc7..b52a98ffda6c7dcd198d551e5bacd33e673a8db1 100644 (file)
@@ -71,17 +71,21 @@ else
 extra-objs += gmon-start.o
 endif
 
+ifeq (yes,$(enable-static-pie))
+extra-objs += r$(start-installed-name) gr$(start-installed-name)
+install-lib += r$(start-installed-name) gr$(start-installed-name)
+endif
+
 ifneq ($(start-installed-name),$(static-start-installed-name))
-# FIXME: Only Hurd defines static-start-installed-name.  Hurd needs to
-# provide special rules to support static PIE.
 extra-objs += $(static-start-installed-name) g$(static-start-installed-name)
 omit-deps += $(patsubst %.o,%,$(static-start-installed-name) \
                             g$(static-start-installed-name))
 install-lib += $(static-start-installed-name) g$(static-start-installed-name)
-else
 ifeq (yes,$(enable-static-pie))
-extra-objs += r$(start-installed-name) gr$(start-installed-name)
-install-lib += r$(start-installed-name) gr$(start-installed-name)
+extra-objs += r$(static-start-installed-name) gr$(static-start-installed-name)
+omit-deps += $(patsubst %.o,%,r$(static-start-installed-name) \
+                            gr$(static-start-installed-name))
+install-lib += r$(static-start-installed-name) gr$(static-start-installed-name)
 endif
 endif
 
@@ -150,6 +154,9 @@ ifneq ($(start-installed-name),$(static-start-installed-name))
 $(objpfx)g$(static-start-installed-name): \
   $(objpfx)g%: $(objpfx)% $(objpfx)gmon-start.o
        $(link-relocatable)
+$(objpfx)gr$(static-start-installed-name): \
+  $(objpfx)gr%: $(objpfx)r% $(objpfx)gmon-start.o
+       $(link-relocatable)
 endif
 else
 $(addprefix $(objpfx),$(sort g$(start-installed-name) \
index 393e92210b0522a0ff96d5de3243a0aa3a8d1b8a..6a6a25ca1fba4e2934577aca076e92199877aefc 100644 (file)
@@ -188,6 +188,8 @@ extra-objs += static-start.o
 # We need special startup code for statically linked binaries.
 $(objpfx)crt0.o: $(objpfx)static-start.o $(objpfx)abi-note.o $(objpfx)init.o $(objpfx)static-reloc.o
        $(link-relocatable)
+$(objpfx)rcrt0.o: $(objpfx)static-start.o $(objpfx)abi-note.o $(objpfx)init.o
+       $(link-relocatable)
 
 endif
 \f