From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7814) id A8F2F3857C6F; Sat, 28 Aug 2021 00:40:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8F2F3857C6F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Fangrui Song To: glibc-cvs@sourceware.org Subject: [glibc/google/grte/v5-2.27/master] powerpc: Use --no-tls-get-addr-optimize in test only if the linker supports it X-Act-Checkin: glibc X-Git-Author: Fangrui Song X-Git-Refname: refs/heads/google/grte/v5-2.27/master X-Git-Oldrev: 7334a4d5c3903b0d268fdf8cba90a3d6077b4547 X-Git-Newrev: bc129fb15b826520d16656df99a29910a487c252 Message-Id: <20210828004040.A8F2F3857C6F@sourceware.org> Date: Sat, 28 Aug 2021 00:40:40 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2021 00:40:40 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bc129fb15b826520d16656df99a29910a487c252 commit bc129fb15b826520d16656df99a29910a487c252 Author: Fangrui Song Date: Tue Aug 24 09:26:44 2021 -0700 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 (cherry picked from commit f9cd7d5d194c652e9ec31634da3fc8ef1bf06780) Diff: --- sysdeps/unix/sysv/linux/powerpc/Makefile | 2 ++ sysdeps/unix/sysv/linux/powerpc/configure | 34 ++++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/powerpc/configure.ac | 4 ++++ 3 files changed, 40 insertions(+) diff --git a/sysdeps/unix/sysv/linux/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile index 19ac59d862..6ff5cc2fc1 100644 --- a/sysdeps/unix/sysv/linux/powerpc/Makefile +++ b/sysdeps/unix/sysv/linux/powerpc/Makefile @@ -19,8 +19,10 @@ ifeq ($(build-shared),yes) sysdep-dl-routines += dl-static endif # Otherwise tst-tls-dlinfo fails due to tst-tlsmod2.so using static tls. +ifeq ($(have-tls-get-addr-optimize),yes) LDFLAGS-tst-tlsmod2.so += -Wl,--no-tls-get-addr-optimize endif +endif ifeq ($(subdir),misc) sysdep_headers += bits/ppc.h diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure index 6d2465fcac..dab587c81f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/configure +++ b/sysdeps/unix/sysv/linux/powerpc/configure @@ -79,4 +79,38 @@ fi fi # clang +{ $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 <&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 diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac index d3e12079ee..5f7eb3d05b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/configure.ac +++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac @@ -40,4 +40,8 @@ fi fi # clang +LIBC_LINKER_FEATURE([--no-tls-get-addr-optimize], [-Wl,--no-tls-get-addr-optimize], + [libc_cv_tls_get_addr_optimize=yes], [libc_cv_tls_get_addr_optimize=no]) +LIBC_CONFIG_VAR([have-tls-get-addr-optimize], [$libc_cv_tls_get_addr_optimize]) + ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed