]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - elf/Makefile
Support compilers defaulting to PIE
[thirdparty/glibc.git] / elf / Makefile
index c8af5ba2c90fd10068a4222048db38f6f1e16e78..f21276c0064bb2bf6b2cdc6ef4c73d64e65e1851 100644 (file)
@@ -121,7 +121,8 @@ tests = tst-tls1 tst-tls2 tst-tls9 tst-leaks1 \
        tst-auxv
 tests-static = tst-tls1-static tst-tls2-static tst-stackguard1-static \
               tst-leaks1-static tst-array1-static tst-array5-static \
-              tst-ptrguard1-static tst-dl-iter-static
+              tst-ptrguard1-static tst-dl-iter-static \
+              tst-tlsalign-static tst-tlsalign-extern-static
 ifeq (yes,$(build-shared))
 tests-static += tst-tls9-static
 tst-tls9-static-ENV = \
@@ -146,10 +147,11 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
         tst-stackguard1 tst-addr1 tst-thrlock \
         tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4) \
         tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
-        tst-ptrguard1
+        tst-ptrguard1 tst-tlsalign tst-tlsalign-extern
 #       reldep9
 ifeq ($(build-hardcoded-path-in-tests),yes)
 tests += tst-dlopen-aout
+LDFLAGS-tst-dlopen-aout = $(no-pie-ldflag)
 endif
 test-srcs = tst-pathopt
 selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)
@@ -212,7 +214,15 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
                tst-initorder2a tst-initorder2b tst-initorder2c \
                tst-initorder2d \
                tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
-               tst-array5dep tst-null-argv-lib
+               tst-array5dep tst-null-argv-lib \
+               tst-tlsalign-lib
+ifeq (yes,$(have-protected-data))
+modules-names += tst-protected1moda tst-protected1modb
+tests += tst-protected1a tst-protected1b
+$(objpfx)tst-protected1a: $(addprefix $(objpfx),tst-protected1moda.so tst-protected1modb.so)
+$(objpfx)tst-protected1b: $(addprefix $(objpfx),tst-protected1modb.so tst-protected1moda.so)
+tst-protected1modb.so-no-z-defs = yes
+endif
 ifeq (yesyes,$(have-fpie)$(build-shared))
 modules-names += tst-piemod1
 tests += tst-pie1 tst-pie2
@@ -356,16 +366,10 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
          | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
        mv -f $@.new $@
 
+ifeq (yes,$(build-shared))
 # interp.c exists just to get the runtime linker path into libc.so.
-$(objpfx)interp.os: $(elf-objpfx)runtime-linker.h
-
-$(elf-objpfx)runtime-linker.h: $(elf-objpfx)runtime-linker.st; @:
-$(elf-objpfx)runtime-linker.st: $(common-objpfx)config.make
-       $(make-target-directory)
-       echo '#define RUNTIME_LINKER "$(rtlddir)/$(rtld-installed-name)"' \
-               > ${@:st=T}
-       $(move-if-change) ${@:st=T} ${@:st=h}
-       touch $@
+$(objpfx)interp.os: $(common-objpfx)runtime-linker.h
+endif
 
 ifneq (ld.so,$(rtld-installed-name))
 # Make sure ld.so.1 exists in the build directory so we can link
@@ -518,6 +522,14 @@ $(objpfx)tst-initordera3.so: $(objpfx)tst-initorderb2.so $(objpfx)tst-initorderb
 $(objpfx)tst-initordera4.so: $(objpfx)tst-initordera3.so
 $(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-initorderb2.so
 $(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so
+$(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so
+
+# BZ#18383: broken on at least ARM (both).
+test-xfail-tst-tlsalign = yes
+test-xfail-tst-tlsalign-static = yes
+
+$(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)
@@ -977,6 +989,9 @@ localplt-built-dso := $(addprefix $(common-objpfx),\
                                  resolv/libresolv.so \
                                  crypt/libcrypt.so \
                       )
+ifeq ($(build-mathvec),yes)
+localplt-built-dso += $(addprefix $(common-objpfx), mathvec/libmvec.so)
+endif
 ifeq ($(have-thread-library),yes)
 localplt-built-dso += $(filter-out %_nonshared.a, $(shared-thread-library))
 endif
@@ -1018,7 +1033,8 @@ $(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so
 $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so
 tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
 
-$(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so
+$(objpfx)tst-audit2: $(libdl)
+$(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so $(objpfx)tst-auditmod9b.so
 # Prevent GCC-5 from translating a malloc/memset pair into calloc
 CFLAGS-tst-audit2.c += -fno-builtin
 tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so