public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] elf: Only build tst-unique{1, 2} if compiler supports gnu_unique_object Date: Fri, 3 Jun 2022 14:10:24 +0000 (GMT) [thread overview] Message-ID: <20220603141024.EFDF2385084C@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2becbbd95fb521156cb17bb019612b78fcf39ebb commit 2becbbd95fb521156cb17bb019612b78fcf39ebb Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> 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 a651196339..47f423cd02 100755 --- a/configure +++ b/configure @@ -6649,6 +6649,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 <<EOF +.type foo, %gnu_unique_object; +.globl foo; +foo: +EOF +libc_cv_cc_gnu_unique_object=no +if ${CC-cc} $CFLAGS $CPPFLAGS -c conftest.S 1>&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 f002e928a6..716a800d78 100644 --- a/configure.ac +++ b/configure.ac @@ -1619,6 +1619,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 <<EOF +.type foo, %gnu_unique_object; +.globl foo; +foo: +EOF +libc_cv_cc_gnu_unique_object=no +if ${CC-cc} $CFLAGS $CPPFLAGS -c conftest.S 1>&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 7feedb6f6a..86110e9a42 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -463,8 +463,6 @@ tests += \ tst-tls-ie \ tst-tls-ie-dlmopen \ tst-tls-manydynamic \ - tst-unique1 \ - tst-unique2 \ tst-unwind-ctor \ tst-unwind-main \ unload3 \ @@ -475,6 +473,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 \ @@ -910,10 +914,6 @@ modules-names += \ tst-tlsmod7 \ tst-tlsmod8 \ tst-tlsmod9 \ - tst-unique1mod1 \ - tst-unique1mod2 \ - tst-unique2mod1 \ - tst-unique2mod2 \ tst-unwind-ctor-lib \ unload2dep \ unload2mod \ @@ -939,6 +939,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 \
next reply other threads:[~2022-06-03 14:10 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-03 14:10 Adhemerval Zanella [this message] -- strict thread matches above, loose matches on Subject: below -- 2022-06-09 21:24 Adhemerval Zanella 2022-06-09 13:21 Adhemerval Zanella 2022-05-13 14:24 Adhemerval Zanella 2022-05-12 19:38 Adhemerval Zanella 2022-05-10 18:28 Adhemerval Zanella 2022-04-29 14:08 Adhemerval Zanella 2022-04-04 12:58 Adhemerval Zanella 2022-03-31 19:11 Adhemerval Zanella 2022-03-29 20:35 Adhemerval Zanella
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220603141024.EFDF2385084C@sourceware.org \ --to=azanella@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).