1 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
2 # Local configure fragment for sysdeps/s390/s390-64.
4 # Minimal checking for static PIE support in ld.
5 # Compare to ld testcase/bugzilla:
6 # <binutils-source>/ld/testsuite/ld-elf/pr22263-1.rd
7 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for s390-specific static PIE requirements (runtime check)" >&5
8 printf %s "checking for s390-specific static PIE requirements (runtime check)... " >&6; }
10 libc_cv_s390x_staticpie_req_runtime; eval test \${$as_var+y}; }
12 printf %s "(cached) " >&6
14 cat > conftest1.c <<EOF
24 void* bar2_ifunc (void) __asm__ ("bar2");
25 __asm__ (".type bar2, %gnu_indirect_function");
26 void* bar2_ifunc (void) { return 0; }
28 cat > conftest2.c <<EOF
29 extern __thread int *foo;
30 extern void bar (void);
31 extern void bar2 (void);
42 libc_cv_s390x_staticpie_req_runtime=no
43 # Check if the static linker does not generate dynamic TLS relocs in PIE
44 # (binutils PR ld/22263), if it accepts --no-dynamic-linker
45 # (by using -static-pie), and if it adds a DT_JMPREL pointing to .rela.iplt
47 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fPIE -c conftest1.c -o conftest1.o'
48 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
51 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
52 test $ac_status = 0; }; } \
53 && { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fPIE -c conftest2.c -o conftest2.o'
54 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
57 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
58 test $ac_status = 0; }; } \
59 && { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostartfiles -nostdlib -fPIE -o conftest conftest1.o conftest2.o'
60 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
63 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
64 test $ac_status = 0; }; } \
65 && { ac_try='! LC_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF'
66 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
69 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
70 test $ac_status = 0; }; } \
71 && { ac_try='LC_ACLL=C $READELF -d conftest | grep JMPREL'
72 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
75 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
76 test $ac_status = 0; }; }
78 libc_cv_s390x_staticpie_req_runtime=yes
83 libc_cv_s390x_staticpie_req_runtime
84 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
85 printf "%s\n" "$ac_res" >&6; }
87 if test $libc_cv_s390x_staticpie_req_runtime = yes; then
88 # Some kernels might fail with /proc/sys/kernel/randomize_va_space set to 0
89 # due not enough space for a brk call. However, there is no reliable way to
91 printf "%s\n" "#define SUPPORT_STATIC_PIE 1" >>confdefs.h