From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 054973858D28; Tue, 2 Apr 2024 15:52:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 054973858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712073161; bh=iFqedi548vwJmUxm5AXxthmu8kpugfSGFsGizW7W7wM=; h=From:To:Subject:Date:From; b=RRJqC/bQsxRq1E5NP0KaZqTq1t/4lg3oPDWP0bBkeJxJEr9apn3taGD6QswqPaNx6 ltJNG1BI+46mMO8Ui8xvqy/eyEgf2OSX0zswapv9qnyip6WVRfMCPgYCMYqTT6d5/y XTM9WbvOwsdfPqQppacjuRJkL+uDHQ5jEUEXvVfg= 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: c4308f143377aea5512d64c57b413fe771c98130 X-Git-Newrev: 7a66a8db3a8474bc91939c7ada190f9d5f776ccf Message-Id: <20240402155241.054973858D28@sourceware.org> Date: Tue, 2 Apr 2024 15:52:40 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7a66a8db3a8474bc91939c7ada190f9d5f776ccf commit 7a66a8db3a8474bc91939c7ada190f9d5f776ccf 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 | 30 ++++++++++++++++++++++++++++++ configure.ac | 22 ++++++++++++++++++++++ math/Makefile | 10 ++++++++++ string/Makefile | 1 + 4 files changed, 63 insertions(+) diff --git a/configure b/configure index 85136296bf..6ac17a1078 100755 --- a/configure +++ b/configure @@ -7096,6 +7096,36 @@ printf "%s\n" "$libc_cv_wno_maybe_uninitialized" >&6; } config_vars="$config_vars config-cflags-wno-maybe-uninitialized = $libc_cv_wno_maybe_uninitialized" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if -Wno-ignored-attributes is required for aliases" >&5 +printf %s "checking if -Wno-ignored-attributes is required for aliases... " >&6; } +if test ${libc_cv_wno_ignored_attributes+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_wno_ignored_attributes" >&5 +printf "%s\n" "$libc_cv_wno_ignored_attributes" >&6; } +config_vars="$config_vars +config-cflags-wno-ignored-attributes = $libc_cv_wno_ignored_attributes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether cc puts quotes around section names" >&5 printf %s "checking whether cc puts quotes around section names... " >&6; } if test ${libc_cv_have_section_quotes+y} diff --git a/configure.ac b/configure.ac index 1260c2189d..1799ddc320 100644 --- a/configure.ac +++ b/configure.ac @@ -1340,6 +1340,28 @@ AC_CACHE_CHECK([for -Wno-maybe-uninitialized], libc_cv_wno_maybe_uninitialized, LIBC_CONFIG_VAR([config-cflags-wno-maybe-uninitialized], [$libc_cv_wno_maybe_uninitialized]) +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 < conftest.c <