From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 4D4013853D10; Wed, 30 Aug 2023 12:36:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D4013853D10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693398963; bh=/aRmH5UNF5i/itvrYi4SrEjMXjuCq9eXEgmrU0nFn78=; h=From:To:Subject:Date:From; b=C9DbAm0fXIkK/honc0FGiNNw8v8aoqSkoXwO6Sk6H5GBhjkq+SEjkWYaUdC7sQZyf g4A/OjY6X/jbVFwpVMqa6BhkqS5ekCnCuEfRL5agzVOvoPOXR8xkNN5lvDHNxvVY6n SsvZfhivuJIIl04ECBYAj/lZyAWewaU5PsQUbMcY= 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: 314ec91560d6be2a58df34779fe1a68defe411b8 X-Git-Newrev: b6694a1f8b228fa5e66c9e0207381adbfa8425af Message-Id: <20230830123603.4D4013853D10@sourceware.org> Date: Wed, 30 Aug 2023 12:36:03 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b6694a1f8b228fa5e66c9e0207381adbfa8425af commit b6694a1f8b228fa5e66c9e0207381adbfa8425af 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 57181a386c..3b1371b189 100755 --- a/configure +++ b/configure @@ -7194,6 +7194,36 @@ 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 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 b0fc9c2766..1f31d967ab 100644 --- a/configure.ac +++ b/configure.ac @@ -1394,6 +1394,28 @@ rm -f conftest*]) LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes], [$libc_cv_wno_ignored_attributes]) +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 <