From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id EEB083858009; Mon, 4 Apr 2022 12:58:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EEB083858009 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] elf: Only build tst-unique{1, 2} if compiler supports gnu_unique_object X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: f1bd8e59b8fb445194d33b98d006da2b026a7001 X-Git-Newrev: 41451cc4f948c673acd6040b927f3df90727a3e8 Message-Id: <20220404125841.EEB083858009@sourceware.org> Date: Mon, 4 Apr 2022 12:58:41 +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: Mon, 04 Apr 2022 12:58:42 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=41451cc4f948c673acd6040b927f3df90727a3e8 commit 41451cc4f948c673acd6040b927f3df90727a3e8 Author: Adhemerval Zanella Date: Mon Mar 28 21:20:01 2022 +0000 elf: Only build tst-unique{1,2} if compiler supports gnu_unique_object Diff: --- configure | 23 +++++++++++++++++++++++ configure.ac | 17 +++++++++++++++++ elf/Makefile | 20 ++++++++++++++------ 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 6abcd4f479..7c5bf74237 100755 --- a/configure +++ b/configure @@ -6804,6 +6804,29 @@ $as_echo "$libc_cv_cc_charset_ascii" >&6; } config_vars="$config_vars config-cflags-charset-ascii = $libc_cv_cc_charset_ascii" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports gnu_unique_object" >&5 +$as_echo_n "checking if $CC supports gnu_unique_object... " >&6; } +if ${libc_cv_cc_gnu_unique_object+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.S <&5 2>&5; +then + LC_ALL=C $READELF -s conftest.o | grep -q 'UNIQUE' && { libc_cv_cc_gnu_unique_object=yes + } +fi +rm -rf conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_gnu_unique_object" >&5 +$as_echo "$libc_cv_cc_gnu_unique_object" >&6; } +config_vars="$config_vars +config-gnu-unique-object = $libc_cv_cc_gnu_unique_object" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgd" >&5 $as_echo_n "checking for libgd... " >&6; } if test "$with_gd" != "no"; then diff --git a/configure.ac b/configure.ac index 3024e72cb9..119fa4c300 100644 --- a/configure.ac +++ b/configure.ac @@ -1751,6 +1751,23 @@ LIBC_TRY_CC_OPTION([-Werror -finput-charset=ascii], LIBC_CONFIG_VAR([config-cflags-charset-ascii], [$libc_cv_cc_charset_ascii]) +dnl Check if compiler supports %gnu_unique_object +AC_CACHE_CHECK([if $CC supports gnu_unique_object], libc_cv_cc_gnu_unique_object, [dnl +cat > conftest.S <&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; +then + LC_ALL=C $READELF -s conftest.o | grep -q 'UNIQUE' && { libc_cv_cc_gnu_unique_object=yes + } +fi +rm -rf conftest*]) +LIBC_CONFIG_VAR([config-gnu-unique-object], + [$libc_cv_cc_gnu_unique_object]) + dnl Check whether we have the gd library available. AC_MSG_CHECKING(for libgd) if test "$with_gd" != "no"; then diff --git a/elf/Makefile b/elf/Makefile index 320d4c778a..724e35f0c4 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -457,8 +457,6 @@ tests += \ tst-tls-ie \ tst-tls-ie-dlmopen \ tst-tls-manydynamic \ - tst-unique1 \ - tst-unique2 \ tst-unwind-ctor \ tst-unwind-main \ unload3 \ @@ -469,6 +467,12 @@ tests += \ unload8 \ valgrind-test \ # tests +ifeq (yes,$(config-gnu-unique-object)) +tests += \ + tst-unique1 \ + tst-unique2 \ + # tests +endif tests-cxx = \ tst-dlopen-nodelete-reloc \ tst-nodelete \ @@ -822,10 +826,6 @@ modules-names = \ tst-tlsmod7 \ tst-tlsmod8 \ tst-tlsmod9 \ - tst-unique1mod1 \ - tst-unique1mod2 \ - tst-unique2mod1 \ - tst-unique2mod2 \ tst-unwind-ctor-lib \ unload2dep \ unload2mod \ @@ -851,6 +851,14 @@ modules-names = \ vismod2 \ vismod3 \ # modules-names +ifeq (yes,$(config-gnu-unique-object)) +modules-names += \ + tst-unique1mod1 \ + tst-unique1mod2 \ + tst-unique2mod1 \ + tst-unique2mod2 \ +# modules-names +endif modules-names-cxx = \ tst-dlopen-nodelete-reloc-mod1 \