From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id B301138582A1; Tue, 4 Oct 2022 12:58:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B301138582A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664888330; bh=SOr84HH6bGVCRLj8VSylZAqeG71IRuzGVtm2dHs+/54=; h=From:To:Subject:Date:From; b=oRuDbhoyizQtFhO7gBiFwPj02swsV088MUZc6a67oChmaejdLC79YR5HDE8ziO/e9 dB+woqMxqAnEeEN+CroaPtBb9yYKBjG92GatBjtvSK20XEW2BQX9q/+z04ZS/FQS/x SuYhiGkDXSOAShlQ/jTX2cEIXzzcPLafYPX1KJ/4= 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] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: b4ea0d9899c0acd31769239cb2673a9e29bbf24a X-Git-Newrev: 87314d7135126c19c0e55d0a483acb50ed8e5ca6 Message-Id: <20221004125850.B301138582A1@sourceware.org> Date: Tue, 4 Oct 2022 12:58:50 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=87314d7135126c19c0e55d0a483acb50ed8e5ca6 commit 87314d7135126c19c0e55d0a483acb50ed8e5ca6 Author: Adhemerval Zanella Date: Fri Mar 11 10:40:44 2022 -0300 configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases clang emits an warning when a double alias redirection is used, to warn the the original symbol will be used even when weak definition is overridden. Howerver, this is a common pattern for weak_alias, where multiple alias are set to same symbol. Diff: --- configure | 29 +++++++++++++++++++++++++++++ configure.ac | 22 ++++++++++++++++++++++ math/Makefile | 8 ++++++++ sysdeps/x86_64/fpu/multiarch/Makefile | 2 ++ 4 files changed, 61 insertions(+) diff --git a/configure b/configure index d670a2e81c..316c86dccb 100755 --- a/configure +++ b/configure @@ -6286,6 +6286,35 @@ $as_echo "$libc_cv_wno_ignored_attributes" >&6; } config_vars="$config_vars config-cflags-wno-ignored-attributes = $libc_cv_wno_ignored_attributes" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -Wno-ignored-attributes is required for aliases" >&5 +$as_echo_n "checking if -Wno-ignored-attributes is required for aliases... " >&6; } +if ${libc_cv_wno_ignored_attributes+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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_cv_wno_ignored_attributes="-Wno-ignored-attributes" +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_wno_ignored_attributes" >&5 +$as_echo "$libc_cv_wno_ignored_attributes" >&6; } +config_vars="$config_vars +config-cflags-wno-ignored-attributes = $libc_cv_wno_ignored_attributes" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc puts quotes around section names" >&5 $as_echo_n "checking whether cc puts quotes around section names... " >&6; } if ${libc_cv_have_section_quotes+:} false; then : diff --git a/configure.ac b/configure.ac index c2fcd224a3..e9b2c06be5 100644 --- a/configure.ac +++ b/configure.ac @@ -1403,6 +1403,28 @@ rm -f conftest*]) AC_SUBST(libc_cv_mtls_dialect_gnu2) LIBC_CONFIG_VAR([have-mtls-dialect-gnu2], [$libc_cv_mtls_dialect_gnu2]) +dnl clang emits an warning when a double alias redirection is used, to warn +dnl the the original symbol will be used even when weak definition is overridden. +dnl This is a common pattern for weak_alias, where multiple alias are set to +dnl same symbol. +AC_CACHE_CHECK([if -Wno-ignored-attributes is required for aliases], + libc_cv_wno_ignored_attributes, [dnl +cat > conftest.c <