From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id B7676388B6B4; Thu, 28 Sep 2023 17:51:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7676388B6B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1695923472; bh=wTljWWpsK/7Jd8K6VAuCk1StOu7JfzOu9Bd67q3KeG8=; h=From:To:Subject:Date:From; b=jxlc4HYRfqLXe8CxYg8VwLcQ41nRDTGhfEc/3UlfL8GpH8ak1/K+pc/jyASXiWnHy dIUP5z8SJ5z/lm5gcOgtpoK3rBo2xxjkbDj2SHOoNCFxOx+D/32mO/qT+BS/vYlFpp WKJkcgVIGvDYflkgwSf2K+whq1rOmESOrPzxfAV0= 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: 7f64f51c7e7ecfcb8fa9f438ffad93f6b00ab3a6 X-Git-Newrev: e4000a8fe7c372d480e2ab7aec4e909815856621 Message-Id: <20230928175112.B7676388B6B4@sourceware.org> Date: Thu, 28 Sep 2023 17:51:12 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e4000a8fe7c372d480e2ab7aec4e909815856621 commit e4000a8fe7c372d480e2ab7aec4e909815856621 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 | 8 ++++++++ sysdeps/x86_64/fpu/multiarch/Makefile | 2 ++ 4 files changed, 62 insertions(+) diff --git a/configure b/configure index 85226db392..7f191206cd 100755 --- a/configure +++ b/configure @@ -7218,6 +7218,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 f508411c25..ee99babc36 100644 --- a/configure.ac +++ b/configure.ac @@ -1402,6 +1402,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 <