about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc/configure
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2021-08-24 09:26:44 -0700
committerFangrui Song <maskray@google.com>2021-08-24 09:26:44 -0700
commitf9cd7d5d194c652e9ec31634da3fc8ef1bf06780 (patch)
treeb53aaf4b244a8ce70349e872b2d246161341ba33 /sysdeps/unix/sysv/linux/powerpc/configure
parent528f9ff6bf69c2c0574a24ee475e31de38dcf060 (diff)
downloadglibc-f9cd7d5d194c652e9ec31634da3fc8ef1bf06780.tar.gz
glibc-f9cd7d5d194c652e9ec31634da3fc8ef1bf06780.tar.xz
glibc-f9cd7d5d194c652e9ec31634da3fc8ef1bf06780.zip
powerpc: Use --no-tls-get-addr-optimize in test only if the linker supports it
LLD doesn't support --{,no-}tls-get-addr-optimize.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/configure')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/configure34
1 files changed, 34 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 6f883de396..ceb1bd7c1b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -76,4 +76,38 @@ $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
   fi
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports --no-tls-get-addr-optimize" >&5
+$as_echo_n "checking for linker that supports --no-tls-get-addr-optimize... " >&6; }
+libc_linker_feature=no
+if test x"$gnu_ld" = x"yes"; then
+  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\--no-tls-get-addr-optimize"`
+  if test -n "$libc_linker_check"; then
+    cat > conftest.c <<EOF
+int _start (void) { return 42; }
+EOF
+    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
+				-Wl,--no-tls-get-addr-optimize -nostdlib -nostartfiles
+				-fPIC -shared -o conftest.so conftest.c
+				1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+      libc_linker_feature=yes
+    fi
+    rm -f conftest*
+  fi
+fi
+if test $libc_linker_feature = yes; then
+  libc_cv_tls_get_addr_optimize=yes
+else
+  libc_cv_tls_get_addr_optimize=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
+$as_echo "$libc_linker_feature" >&6; }
+config_vars="$config_vars
+have-tls-get-addr-optimize = $libc_cv_tls_get_addr_optimize"
+
 ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed