From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 167A53850844; Fri, 3 Jun 2022 14:05:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 167A53850844 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: c9e5791c5dd777927f40166c4f1ce4bd31c97ded X-Git-Newrev: 5f011930f4fbf7b4d4bc2175c2cb0ca72e89fcf8 Message-Id: <20220603140551.167A53850844@sourceware.org> Date: Fri, 3 Jun 2022 14:05:51 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2022 14:05:51 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5f011930f4fbf7b4d4bc2175c2cb0ca72e89fcf8 commit 5f011930f4fbf7b4d4bc2175c2cb0ca72e89fcf8 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: --- argp/Makefile | 7 ++++--- configure | 29 +++++++++++++++++++++++++++++ configure.ac | 22 ++++++++++++++++++++++ dirent/Makefile | 1 + inet/Makefile | 3 +++ io/Makefile | 9 +++++---- libio/Makefile | 14 +++++++++++--- login/Makefile | 1 + misc/Makefile | 2 ++ posix/Makefile | 6 +++--- resolv/Makefile | 1 + resource/Makefile | 2 ++ socket/Makefile | 8 ++++---- stdlib/Makefile | 8 ++++++++ string/Makefile | 8 ++++++++ sysdeps/aarch64/Makefile | 1 + sysdeps/wordsize-64/Makefile | 5 +++++ termios/Makefile | 1 + time/Makefile | 1 + wcsmbs/Makefile | 22 ++++++++++++++-------- wctype/Makefile | 2 ++ 21 files changed, 128 insertions(+), 25 deletions(-) diff --git a/argp/Makefile b/argp/Makefile index 8d98faba88..fd99098ccd 100644 --- a/argp/Makefile +++ b/argp/Makefile @@ -29,9 +29,10 @@ routines = $(addprefix argp-, ba fmtstream fs-xinl help parse pv \ tests = argp-test tst-argp1 bug-argp1 tst-argp2 bug-argp2 \ tst-ldbl-argp -CFLAGS-argp-help.c += $(uses-callbacks) -fexceptions -CFLAGS-argp-parse.c += $(uses-callbacks) -CFLAGS-argp-fmtstream.c += -fexceptions +CFLAGS-argp-help.c += $(uses-callbacks) -fexceptions $(config-cflags-wno-ignored-attributes) +CFLAGS-argp-parse.c += $(uses-callbacks) $(config-cflags-wno-ignored-attributes) +CFLAGS-argp-fmtstream.c += -fexceptions $(config-cflags-wno-ignored-attributes) +CFLAGS-argp-fs-xinl.c += $(config-cflags-wno-ignored-attributes) bug-argp1-ARGS = -- --help bug-argp2-ARGS = -- -d 111 --dstaddr 222 -p 333 --peer 444 diff --git a/configure b/configure index 94f9e082ed..4738e16b9b 100755 --- a/configure +++ b/configure @@ -6301,6 +6301,35 @@ $as_echo "$libc_cv_fexcess_precision_standard" >&6; } config_vars="$config_vars config-cflags-fexcess-precision-standard = $libc_cv_fexcess_precision_standard" +{ $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 712cbaaaf5..cf50761b3d 100644 --- a/configure.ac +++ b/configure.ac @@ -1419,6 +1419,28 @@ AC_CACHE_CHECK([for -fexcess-precision=standard], libc_cv_fexcess_precision_stan LIBC_CONFIG_VAR([config-cflags-fexcess-precision-standard], [$libc_cv_fexcess_precision_standard]) +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 < $@; \ diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile index 17fb1c5b72..6a9559e5f5 100644 --- a/sysdeps/aarch64/Makefile +++ b/sysdeps/aarch64/Makefile @@ -57,6 +57,7 @@ endif ifeq ($(subdir),math) CPPFLAGS += -I../soft-fp +CFLAGS-feupdateenv.c += $(config-cflags-wno-ignored-attributes) endif ifeq ($(subdir),misc) diff --git a/sysdeps/wordsize-64/Makefile b/sysdeps/wordsize-64/Makefile index 2fa934751f..db7764f664 100644 --- a/sysdeps/wordsize-64/Makefile +++ b/sysdeps/wordsize-64/Makefile @@ -1,3 +1,8 @@ ifeq ($(subdir),misc) tests += tst-writev endif + +# strtol is aliased to stroll +CFLAGS-strtol.c += -fno-builtin-strtoll $(config-cflags-wno-ignored-attributes) +# strtoul is aliased to strtoull +CFLAGS-strtoul.c += -fno-builtin-strtoull $(config-cflags-wno-ignored-attributes) diff --git a/termios/Makefile b/termios/Makefile index 54ed9fe51e..1490dd17b2 100644 --- a/termios/Makefile +++ b/termios/Makefile @@ -31,3 +31,4 @@ routines := speed cfsetspeed tcsetattr tcgetattr tcgetpgrp tcsetpgrp \ include ../Rules CFLAGS-tcdrain.c += -fexceptions -fasynchronous-unwind-tables +CFLAGS-tcsetattr.c += $(config-cflags-wno-ignored-attributes) diff --git a/time/Makefile b/time/Makefile index 470275b90c..dc6e2c93ad 100644 --- a/time/Makefile +++ b/time/Makefile @@ -98,6 +98,7 @@ CFLAGS-tzset.c += $(tz-cflags) CFLAGS-getdate.c += -fexceptions CFLAGS-clock_nanosleep.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables +CFLAGS-mktime.c += $(config-cflags-wno-ignored-attributes) # Don't warn about Y2k problem in strftime format string. CFLAGS-test_time.c += -Wno-format diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile index b67202526d..fdd5965b01 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -80,24 +80,30 @@ CFLAGS-wcwidth.c += -I../wctype CFLAGS-wcswidth.c += -I../wctype strtox-CFLAGS = -I../include -CFLAGS-wcstol.c += $(strtox-CFLAGS) -CFLAGS-wcstoul.c += $(strtox-CFLAGS) +CFLAGS-wcstol.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes) +CFLAGS-wcstoul.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes) CFLAGS-wcstoll.c += $(strtox-CFLAGS) CFLAGS-wcstoull.c += $(strtox-CFLAGS) -CFLAGS-wcstod.c += $(strtox-CFLAGS) -CFLAGS-wcstold.c += $(strtox-CFLAGS) +CFLAGS-wcstod.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes) +CFLAGS-wcstold.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes) CFLAGS-wcstof128.c += $(strtox-CFLAGS) -CFLAGS-wcstof.c += $(strtox-CFLAGS) +CFLAGS-wcstof.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes) CFLAGS-wcstol_l.c += $(strtox-CFLAGS) CFLAGS-wcstoul_l.c += $(strtox-CFLAGS) CFLAGS-wcstoll_l.c += $(strtox-CFLAGS) CFLAGS-wcstoull_l.c += $(strtox-CFLAGS) -CFLAGS-wcstod_l.c += $(strtox-CFLAGS) -CFLAGS-wcstold_l.c += $(strtox-CFLAGS) +CFLAGS-wcstod_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes) +CFLAGS-wcstold_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes) CFLAGS-wcstof128_l.c += $(strtox-CFLAGS) -CFLAGS-wcstof_l.c += $(strtox-CFLAGS) +CFLAGS-wcstof_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes) CPPFLAGS-tst-wchar-h.c += -D_FORTIFY_SOURCE=2 +CFLAGS-wcschr.c += $(config-cflags-wno-ignored-attributes) +CFLAGS-wmemchr.c += $(config-cflags-wno-ignored-attributes) +CFLAGS-wmemset.c += $(config-cflags-wno-ignored-attributes) +CFLAGS-mbrtowc.c += $(config-cflags-wno-ignored-attributes) +CFLAGS-wcrtomb.c += $(config-cflags-wno-ignored-attributes) + CFLAGS-isoc99_wscanf.c += -fexceptions CFLAGS-isoc99_fwscanf.c += -fexceptions CFLAGS-isoc99_vwscanf.c += -fexceptions diff --git a/wctype/Makefile b/wctype/Makefile index a3540203cc..79d9608cb9 100644 --- a/wctype/Makefile +++ b/wctype/Makefile @@ -29,3 +29,5 @@ routines := wcfuncs wctype iswctype wctrans towctrans \ tests := test_wctype test_wcfuncs bug-wctypeh include ../Rules + +CFLAGS-wcfuncs.c += $(config-cflags-wno-ignored-attributes)