public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-03-15 18:41 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-03-15 18:41 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=55ef77def2c09257b8db033961a42c4f32388e1d
commit 55ef77def2c09257b8db033961a42c4f32388e1d
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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/wordsize-64/Makefile | 5 +++++
termios/Makefile | 1 +
time/Makefile | 1 +
wcsmbs/Makefile | 22 ++++++++++++++--------
wctype/Makefile | 2 ++
20 files changed, 127 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 ff0a3841d2..d891044cef 100755
--- a/configure
+++ b/configure
@@ -6457,6 +6457,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 dd8fb99867..64fbbce11f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1551,6 +1551,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index cf265dc9b9..abcdb88d48 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -111,11 +111,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -130,9 +130,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 0b7ccd4924..9dea4c9d77 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -141,6 +141,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5510ce5ae7..35492fc1dd 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -212,6 +212,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2024-04-17 20:06 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:06 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=66a42a70993d07a449aa3238b6ee5ef94d5bb978
commit 66a42a70993d07a449aa3238b6ee5ef94d5bb978
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index a9fef9e2db..f8d2e95b32 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1535,6 +1535,16 @@ CFLAGS-s_y0f.c += -fno-builtin-y0f32
CFLAGS-s_y1f.c += -fno-builtin-y1f32
CFLAGS-s_ynf.c += -fno-builtin-ynf32
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-w_exp10_compat.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/string/Makefile b/string/Makefile
index 8f31fa49e6..cbdcff3706 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -280,6 +280,7 @@ CFLAGS-memchr.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffsll.c += $(config-cflags-wno-ignored-attributes)
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2024-04-02 15:52 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 15:52 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7a66a8db3a8474bc91939c7ada190f9d5f776ccf
commit 7a66a8db3a8474bc91939c7ada190f9d5f776ccf
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index 79ef4ebb65..98c5d43a34 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1002,6 +1002,16 @@ CFLAGS-s_y0f.c += -fno-builtin-y0f32
CFLAGS-s_y1f.c += -fno-builtin-y1f32
CFLAGS-s_ynf.c += -fno-builtin-ynf32
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-w_exp10_compat.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/string/Makefile b/string/Makefile
index 8f31fa49e6..cbdcff3706 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -280,6 +280,7 @@ CFLAGS-memchr.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffsll.c += $(config-cflags-wno-ignored-attributes)
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2024-02-09 17:30 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:30 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e1b8ef0408e4fef764a11ee27b3e0a75a76fdf1b
commit e1b8ef0408e4fef764a11ee27b3e0a75a76fdf1b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 | 9 +++++++++
string/Makefile | 1 +
sysdeps/x86_64/fpu/multiarch/Makefile | 2 ++
5 files changed, 64 insertions(+)
diff --git a/configure b/configure
index a3cc038ac1..742c5c7c14 100755
--- a/configure
+++ b/configure
@@ -7093,6 +7093,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 315fc5fb2b..c10e4bc306 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1337,6 +1337,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index 79ef4ebb65..e405a70416 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1002,6 +1002,15 @@ CFLAGS-s_y0f.c += -fno-builtin-y0f32
CFLAGS-s_y1f.c += -fno-builtin-y1f32
CFLAGS-s_ynf.c += -fno-builtin-ynf32
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-w_exp10_compat.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/string/Makefile b/string/Makefile
index 8f31fa49e6..cbdcff3706 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -280,6 +280,7 @@ CFLAGS-memchr.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffsll.c += $(config-cflags-wno-ignored-attributes)
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index ea81753b70..0253edf027 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -44,6 +44,8 @@ libm-sysdep_routines += \
s_tan-fma \
# libm-sysdep_routines
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-e_asin-fma.c = -mfma -mavx2
CFLAGS-e_atan2-fma.c = -mfma -mavx2
CFLAGS-e_exp-fma.c = -mfma -mavx2
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2024-02-07 14:06 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:06 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f94bfb88617e8b405f864ad7a78041605a3bc0d4
commit f94bfb88617e8b405f864ad7a78041605a3bc0d4
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 | 9 +++++++++
string/Makefile | 1 +
sysdeps/x86_64/fpu/multiarch/Makefile | 2 ++
5 files changed, 64 insertions(+)
diff --git a/configure b/configure
index a3cc038ac1..742c5c7c14 100755
--- a/configure
+++ b/configure
@@ -7093,6 +7093,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 315fc5fb2b..c10e4bc306 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1337,6 +1337,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index 79ef4ebb65..e405a70416 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1002,6 +1002,15 @@ CFLAGS-s_y0f.c += -fno-builtin-y0f32
CFLAGS-s_y1f.c += -fno-builtin-y1f32
CFLAGS-s_ynf.c += -fno-builtin-ynf32
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-w_exp10_compat.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/string/Makefile b/string/Makefile
index 8f31fa49e6..cbdcff3706 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -280,6 +280,7 @@ CFLAGS-memchr.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffsll.c += $(config-cflags-wno-ignored-attributes)
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index ea81753b70..0253edf027 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -44,6 +44,8 @@ libm-sysdep_routines += \
s_tan-fma \
# libm-sysdep_routines
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-e_asin-fma.c = -mfma -mavx2
CFLAGS-e_atan2-fma.c = -mfma -mavx2
CFLAGS-e_exp-fma.c = -mfma -mavx2
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2024-01-29 17:56 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 17:56 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9c94564b88a61d3ef03e14922c427ed2364c4d68
commit 9c94564b88a61d3ef03e14922c427ed2364c4d68
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 | 9 +++++++++
sysdeps/x86_64/fpu/multiarch/Makefile | 2 ++
4 files changed, 63 insertions(+)
diff --git a/configure b/configure
index a3cc038ac1..742c5c7c14 100755
--- a/configure
+++ b/configure
@@ -7093,6 +7093,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 315fc5fb2b..c10e4bc306 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1337,6 +1337,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index 79ef4ebb65..e405a70416 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1002,6 +1002,15 @@ CFLAGS-s_y0f.c += -fno-builtin-y0f32
CFLAGS-s_y1f.c += -fno-builtin-y1f32
CFLAGS-s_ynf.c += -fno-builtin-ynf32
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-w_exp10_compat.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index ea81753b70..0253edf027 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -44,6 +44,8 @@ libm-sysdep_routines += \
s_tan-fma \
# libm-sysdep_routines
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-e_asin-fma.c = -mfma -mavx2
CFLAGS-e_atan2-fma.c = -mfma -mavx2
CFLAGS-e_exp-fma.c = -mfma -mavx2
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2023-12-21 18:53 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:53 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9de7d6f585393b6d1e455bbb5c4195797774330e
commit 9de7d6f585393b6d1e455bbb5c4195797774330e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 a5551f96ec..bcb741baa1 100755
--- a/configure
+++ b/configure
@@ -7092,6 +7092,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 315fc5fb2b..c10e4bc306 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1337,6 +1337,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index a9daae09de..bf0393b7a7 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1002,6 +1002,14 @@ CFLAGS-s_y0f.c += -fno-builtin-y0f32
CFLAGS-s_y1f.c += -fno-builtin-y1f32
CFLAGS-s_ynf.c += -fno-builtin-ynf32
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index ea81753b70..0253edf027 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -44,6 +44,8 @@ libm-sysdep_routines += \
s_tan-fma \
# libm-sysdep_routines
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-e_asin-fma.c = -mfma -mavx2
CFLAGS-e_atan2-fma.c = -mfma -mavx2
CFLAGS-e_exp-fma.c = -mfma -mavx2
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2023-09-28 17:51 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:51 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e4000a8fe7c372d480e2ab7aec4e909815856621
commit e4000a8fe7c372d480e2ab7aec4e909815856621
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index a9daae09de..bf0393b7a7 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1002,6 +1002,14 @@ CFLAGS-s_y0f.c += -fno-builtin-y0f32
CFLAGS-s_y1f.c += -fno-builtin-y1f32
CFLAGS-s_ynf.c += -fno-builtin-ynf32
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index ea81753b70..0253edf027 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -44,6 +44,8 @@ libm-sysdep_routines += \
s_tan-fma \
# libm-sysdep_routines
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-e_asin-fma.c = -mfma -mavx2
CFLAGS-e_atan2-fma.c = -mfma -mavx2
CFLAGS-e_exp-fma.c = -mfma -mavx2
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2023-08-30 12:36 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:36 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b6694a1f8b228fa5e66c9e0207381adbfa8425af
commit b6694a1f8b228fa5e66c9e0207381adbfa8425af
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index a9daae09de..bf0393b7a7 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1002,6 +1002,14 @@ CFLAGS-s_y0f.c += -fno-builtin-y0f32
CFLAGS-s_y1f.c += -fno-builtin-y1f32
CFLAGS-s_ynf.c += -fno-builtin-ynf32
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index ea81753b70..0253edf027 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -44,6 +44,8 @@ libm-sysdep_routines += \
s_tan-fma \
# libm-sysdep_routines
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-e_asin-fma.c = -mfma -mavx2
CFLAGS-e_atan2-fma.c = -mfma -mavx2
CFLAGS-e_exp-fma.c = -mfma -mavx2
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2023-02-09 19:47 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:47 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ba390dd1a58a1414cc7ae0571286d8f4f085f0f0
commit ba390dd1a58a1414cc7ae0571286d8f4f085f0f0
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 f1fddbfeb6..073d474fcc 100755
--- a/configure
+++ b/configure
@@ -5992,6 +5992,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 1b39d19735..c2a90c070d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1410,6 +1410,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index a9daae09de..bf0393b7a7 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1002,6 +1002,14 @@ CFLAGS-s_y0f.c += -fno-builtin-y0f32
CFLAGS-s_y1f.c += -fno-builtin-y1f32
CFLAGS-s_ynf.c += -fno-builtin-ynf32
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 248162525b..caa1ec82fb 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -13,6 +13,8 @@ libm-sysdep_routines += e_exp-fma e_log-fma e_pow-fma s_atan-fma \
e_asin-fma e_atan2-fma s_sin-fma s_tan-fma \
s_sincos-fma
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-e_asin-fma.c = -mfma -mavx2
CFLAGS-e_atan2-fma.c = -mfma -mavx2
CFLAGS-e_exp-fma.c = -mfma -mavx2
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-10-28 17:40 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:40 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0bd3e0e60541d7cc2a7fd77ba8cb8652110fae70
commit 0bd3e0e60541d7cc2a7fd77ba8cb8652110fae70
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 c5f5cbc633..fa6d97078e 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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 3c25be44d2..9dc967001a 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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+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
diff --git a/math/Makefile b/math/Makefile
index 71708f5542..dce94d0249 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -769,6 +769,14 @@ CFLAGS-s_y1.c += -fno-builtin-y1l
CFLAGS-s_yn.c += -fno-builtin-ynl
endif
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 248162525b..caa1ec82fb 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -13,6 +13,8 @@ libm-sysdep_routines += e_exp-fma e_log-fma e_pow-fma s_atan-fma \
e_asin-fma e_atan2-fma s_sin-fma s_tan-fma \
s_sincos-fma
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-e_asin-fma.c = -mfma -mavx2
CFLAGS-e_atan2-fma.c = -mfma -mavx2
CFLAGS-e_exp-fma.c = -mfma -mavx2
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-10-28 17:38 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:38 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7ce1dc6f37fbb6251e0b1e5924f0c26c865b3f42
commit 7ce1dc6f37fbb6251e0b1e5924f0c26c865b3f42
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 | 18 ++++++++++--------
libio/Makefile | 14 +++++++++++---
login/Makefile | 1 +
misc/Makefile | 2 ++
posix/Makefile | 6 +++---
resolv/Makefile | 1 +
resource/Makefile | 3 +++
socket/Makefile | 10 +++++-----
stdio-common/Makefile | 2 ++
stdlib/Makefile | 12 ++++++++++++
string/Makefile | 9 +++++++++
sysdeps/aarch64/Makefile | 1 +
sysdeps/arm/Makefile | 4 ++++
sysdeps/wordsize-64/Makefile | 5 +++++
termios/Makefile | 1 +
time/Makefile | 1 +
wcsmbs/Makefile | 24 ++++++++++++++++--------
wctype/Makefile | 2 ++
23 files changed, 148 insertions(+), 30 deletions(-)
diff --git a/argp/Makefile b/argp/Makefile
index 586136f2fe..8de8fd6113 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 1f5916af3f..939c3e094f 100755
--- a/configure
+++ b/configure
@@ -6257,6 +6257,35 @@ $as_echo "$libc_cv_mtls_dialect_gnu2" >&6; }
config_vars="$config_vars
have-mtls-dialect-gnu2 = $libc_cv_mtls_dialect_gnu2"
+{ $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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 c207503c8a..98bd9c01f8 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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index b1710407d0..14329e58fe 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -107,20 +107,21 @@ endif
include ../Rules
-CFLAGS-open.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-open.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-openat.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
-CFLAGS-statvfs.c += -fexceptions
-CFLAGS-fstatvfs.c += -fexceptions
+CFLAGS-statvfs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
+CFLAGS-fstatvfs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
@@ -131,9 +132,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index 3a02611020..64398ab1ee 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index ba8232a0e9..014c601909 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -144,6 +144,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index d1df7c27cb..4d60449426 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index f8a92c6cff..d9d887a0d0 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -234,6 +234,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..a005eab3e5 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,6 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getrlimit.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 2bde78387f..bd659a5ad1 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -49,11 +49,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 9c98c02884..401dac69de 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -381,6 +381,8 @@ CFLAGS-isoc99_vscanf.c += -fexceptions
CFLAGS-isoc99_fscanf.c += -fexceptions
CFLAGS-isoc99_scanf.c += -fexceptions
+CFLAGS-dprintf.c += $(config-cflags-wno-ignored-attributes)
+
# scanf14a.c and scanf16a.c test a deprecated extension which is no
# longer visible under most conformance levels; see the source files
# for more detail.
diff --git a/stdlib/Makefile b/stdlib/Makefile
index f7b25c1981..417d525d8e 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -375,6 +375,18 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtol.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtoul.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtoll.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtoull.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..938f528b8d 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,15 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memchr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
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/arm/Makefile b/sysdeps/arm/Makefile
index da4226c8c8..d5cea717a9 100644
--- a/sysdeps/arm/Makefile
+++ b/sysdeps/arm/Makefile
@@ -54,6 +54,10 @@ ifeq ($(subdir),gmon)
sysdep_routines += arm-mcount
endif
+ifeq ($(subdir),math)
+CFLAGS-feupdateenv.c += $(config-cflags-wno-ignored-attributes)
+endif
+
ifeq ($(subdir),rt)
librt-sysdep_routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
librt-shared-only-routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
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 4af102a3f6..aaa067fc69 100644
--- a/wcsmbs/Makefile
+++ b/wcsmbs/Makefile
@@ -84,24 +84,32 @@ 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-wcstoll.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-wcstoull.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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-10-04 12:58 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 12:58 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=87314d7135126c19c0e55d0a483acb50ed8e5ca6
commit 87314d7135126c19c0e55d0a483acb50ed8e5ca6
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+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
diff --git a/math/Makefile b/math/Makefile
index 71708f5542..dce94d0249 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -769,6 +769,14 @@ CFLAGS-s_y1.c += -fno-builtin-y1l
CFLAGS-s_yn.c += -fno-builtin-ynl
endif
+CFLAGS-s_fabsf128.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fraiseexcpt.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetround.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fegetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-fesetenv.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feholdexcpt.c += $(config-cflags-wno-ignored-attributes)
+
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 248162525b..caa1ec82fb 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -13,6 +13,8 @@ libm-sysdep_routines += e_exp-fma e_log-fma e_pow-fma s_atan-fma \
e_asin-fma e_atan2-fma s_sin-fma s_tan-fma \
s_sincos-fma
+CFLAGS-s_sincos.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-e_asin-fma.c = -mfma -mavx2
CFLAGS-e_atan2-fma.c = -mfma -mavx2
CFLAGS-e_exp-fma.c = -mfma -mavx2
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-10-04 12:56 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 12:56 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e91e031633d70d197f1c32f54d58821964f7940b
commit e91e031633d70d197f1c32f54d58821964f7940b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 | 18 ++++++++++--------
libio/Makefile | 14 +++++++++++---
login/Makefile | 1 +
misc/Makefile | 2 ++
posix/Makefile | 6 +++---
resolv/Makefile | 1 +
resource/Makefile | 3 +++
socket/Makefile | 10 +++++-----
stdio-common/Makefile | 2 ++
stdlib/Makefile | 12 ++++++++++++
string/Makefile | 9 +++++++++
sysdeps/aarch64/Makefile | 1 +
sysdeps/arm/Makefile | 4 ++++
sysdeps/wordsize-64/Makefile | 5 +++++
termios/Makefile | 1 +
time/Makefile | 1 +
wcsmbs/Makefile | 24 ++++++++++++++++--------
wctype/Makefile | 2 ++
23 files changed, 148 insertions(+), 30 deletions(-)
diff --git a/argp/Makefile b/argp/Makefile
index 586136f2fe..8de8fd6113 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 83009454a8..a4ecec5a25 100755
--- a/configure
+++ b/configure
@@ -6257,6 +6257,35 @@ $as_echo "$libc_cv_mtls_dialect_gnu2" >&6; }
config_vars="$config_vars
have-mtls-dialect-gnu2 = $libc_cv_mtls_dialect_gnu2"
+{ $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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 06bb2d79e7..e4991c23f3 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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index b1710407d0..14329e58fe 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -107,20 +107,21 @@ endif
include ../Rules
-CFLAGS-open.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-open.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-openat.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
-CFLAGS-statvfs.c += -fexceptions
-CFLAGS-fstatvfs.c += -fexceptions
+CFLAGS-statvfs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
+CFLAGS-fstatvfs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
@@ -131,9 +132,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index 3a02611020..64398ab1ee 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index ba8232a0e9..014c601909 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -144,6 +144,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index d1df7c27cb..4d60449426 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index f8a92c6cff..d9d887a0d0 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -234,6 +234,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..a005eab3e5 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,6 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getrlimit.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 2bde78387f..bd659a5ad1 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -49,11 +49,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 9c98c02884..401dac69de 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -381,6 +381,8 @@ CFLAGS-isoc99_vscanf.c += -fexceptions
CFLAGS-isoc99_fscanf.c += -fexceptions
CFLAGS-isoc99_scanf.c += -fexceptions
+CFLAGS-dprintf.c += $(config-cflags-wno-ignored-attributes)
+
# scanf14a.c and scanf16a.c test a deprecated extension which is no
# longer visible under most conformance levels; see the source files
# for more detail.
diff --git a/stdlib/Makefile b/stdlib/Makefile
index f7b25c1981..417d525d8e 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -375,6 +375,18 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtol.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtoul.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtoll.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtoull.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..938f528b8d 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,15 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memchr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
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/arm/Makefile b/sysdeps/arm/Makefile
index da4226c8c8..d5cea717a9 100644
--- a/sysdeps/arm/Makefile
+++ b/sysdeps/arm/Makefile
@@ -54,6 +54,10 @@ ifeq ($(subdir),gmon)
sysdep_routines += arm-mcount
endif
+ifeq ($(subdir),math)
+CFLAGS-feupdateenv.c += $(config-cflags-wno-ignored-attributes)
+endif
+
ifeq ($(subdir),rt)
librt-sysdep_routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
librt-shared-only-routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
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 4af102a3f6..aaa067fc69 100644
--- a/wcsmbs/Makefile
+++ b/wcsmbs/Makefile
@@ -84,24 +84,32 @@ 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-wcstoll.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-wcstoull.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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-06-09 21:19 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:19 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3e73a4db53f508e96add03cf6fe5b11f74d69cbc
commit 3e73a4db53f508e96add03cf6fe5b11f74d69cbc
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index b1710407d0..bcb10384aa 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -112,11 +112,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -131,9 +131,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 6fd23dd918..e254c4f24f 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -143,6 +143,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index d1df7c27cb..4d60449426 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9dda53a64c..99229226db 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -366,6 +366,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-06-09 13:16 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 13:16 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3e73a4db53f508e96add03cf6fe5b11f74d69cbc
commit 3e73a4db53f508e96add03cf6fe5b11f74d69cbc
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index b1710407d0..bcb10384aa 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -112,11 +112,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -131,9 +131,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 6fd23dd918..e254c4f24f 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -143,6 +143,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index d1df7c27cb..4d60449426 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9dda53a64c..99229226db 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -366,6 +366,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-06-03 14:05 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:05 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5f011930f4fbf7b4d4bc2175c2cb0ca72e89fcf8
commit 5f011930f4fbf7b4d4bc2175c2cb0ca72e89fcf8
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index b1710407d0..bcb10384aa 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -112,11 +112,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -131,9 +131,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 6fd23dd918..e254c4f24f 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -143,6 +143,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index d1df7c27cb..4d60449426 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9dda53a64c..99229226db 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -366,6 +366,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-05-13 14:19 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-05-13 14:19 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5a6e1d5996e7e49f9add6b9570161183f90256c1
commit 5a6e1d5996e7e49f9add6b9570161183f90256c1
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index b1710407d0..bcb10384aa 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -112,11 +112,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -131,9 +131,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 6fd23dd918..e254c4f24f 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -143,6 +143,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9dda53a64c..99229226db 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -366,6 +366,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 7183895d04..f5367e01ca 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -56,6 +56,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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-05-12 19:33 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-05-12 19:33 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e4253adf4cf2d0cba80122d5e8879086012b7467
commit e4253adf4cf2d0cba80122d5e8879086012b7467
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index b1710407d0..bcb10384aa 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -112,11 +112,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -131,9 +131,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 6fd23dd918..e254c4f24f 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -143,6 +143,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9dda53a64c..99229226db 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -366,6 +366,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 7183895d04..f5367e01ca 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -56,6 +56,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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-05-10 18:23 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:23 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ae8246ee147579322b19ff4048c1d55762ff23b0
commit ae8246ee147579322b19ff4048c1d55762ff23b0
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index b1710407d0..bcb10384aa 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -112,11 +112,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -131,9 +131,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 6fd23dd918..e254c4f24f 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -143,6 +143,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9dda53a64c..99229226db 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -366,6 +366,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 7183895d04..f5367e01ca 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -56,6 +56,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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-04-29 14:03 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-04-29 14:03 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=692e00bd5608dec97844d5f22529eb7af793aa12
commit 692e00bd5608dec97844d5f22529eb7af793aa12
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 4999f69f6a..8a179abb73 100755
--- a/configure
+++ b/configure
@@ -6329,6 +6329,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 93d4198599..c9d1b2a883 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1435,6 +1435,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index b1710407d0..bcb10384aa 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -112,11 +112,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -131,9 +131,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 6fd23dd918..e254c4f24f 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -143,6 +143,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9dda53a64c..99229226db 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -366,6 +366,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 7183895d04..f5367e01ca 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -56,6 +56,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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-04-04 12:54 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-04-04 12:54 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2556f6e98ad27f9c879e3a9ebad2f353292dc102
commit 2556f6e98ad27f9c879e3a9ebad2f353292dc102
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 105c917e72..3e59f2511f 100755
--- a/configure
+++ b/configure
@@ -6456,6 +6456,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 63336dd144..3800b740f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1551,6 +1551,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index cf265dc9b9..abcdb88d48 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -111,11 +111,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -130,9 +130,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 0b7ccd4924..9dea4c9d77 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -141,6 +141,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5510ce5ae7..35492fc1dd 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -212,6 +212,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 7183895d04..f5367e01ca 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -56,6 +56,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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-03-31 19:06 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-03-31 19:06 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=002a8aa24891ce56ef3db7718d998da5de3113d4
commit 002a8aa24891ce56ef3db7718d998da5de3113d4
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 105c917e72..3e59f2511f 100755
--- a/configure
+++ b/configure
@@ -6456,6 +6456,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 63336dd144..3800b740f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1551,6 +1551,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index cf265dc9b9..abcdb88d48 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -111,11 +111,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -130,9 +130,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 0b7ccd4924..9dea4c9d77 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -141,6 +141,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5510ce5ae7..35492fc1dd 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -212,6 +212,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 7183895d04..f5367e01ca 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -56,6 +56,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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-03-29 20:29 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-03-29 20:29 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e688bc346f45cb90f695b20071d6b77d68779abb
commit e688bc346f45cb90f695b20071d6b77d68779abb
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 105c917e72..3e59f2511f 100755
--- a/configure
+++ b/configure
@@ -6456,6 +6456,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 63336dd144..3800b740f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1551,6 +1551,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index cf265dc9b9..abcdb88d48 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -111,11 +111,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -130,9 +130,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 0b7ccd4924..9dea4c9d77 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -141,6 +141,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5510ce5ae7..35492fc1dd 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -212,6 +212,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 7183895d04..f5367e01ca 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -56,6 +56,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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-03-16 18:03 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-03-16 18:03 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b5665c4eb8390b38fa744eb3379cf5fb1110ffee
commit b5665c4eb8390b38fa744eb3379cf5fb1110ffee
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 ff0a3841d2..d891044cef 100755
--- a/configure
+++ b/configure
@@ -6457,6 +6457,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 dd8fb99867..64fbbce11f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1551,6 +1551,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index cf265dc9b9..abcdb88d48 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -111,11 +111,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -130,9 +130,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 0b7ccd4924..9dea4c9d77 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -141,6 +141,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5510ce5ae7..35492fc1dd 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -212,6 +212,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 7183895d04..f5367e01ca 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -56,6 +56,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)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases
@ 2022-03-11 17:25 Adhemerval Zanella
0 siblings, 0 replies; 26+ messages in thread
From: Adhemerval Zanella @ 2022-03-11 17:25 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=31a2c23b042f151c2f40f9887a9797ee0342a640
commit 31a2c23b042f151c2f40f9887a9797ee0342a640
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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/wordsize-64/Makefile | 5 +++++
termios/Makefile | 1 +
time/Makefile | 1 +
wcsmbs/Makefile | 22 ++++++++++++++--------
wctype/Makefile | 2 ++
20 files changed, 127 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 ff0a3841d2..d891044cef 100755
--- a/configure
+++ b/configure
@@ -6457,6 +6457,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 dd8fb99867..64fbbce11f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1551,6 +1551,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 <<EOF
+void __foo (void)
+{
+}
+extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
+extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
+EOF
+libc_cv_wno_ignored_attributes=""
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
+then
+ libc_cv_wno_ignored_attributes="-Wno-ignored-attributes"
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
+ [$libc_cv_wno_ignored_attributes])
+
AC_CACHE_CHECK(whether cc puts quotes around section names,
libc_cv_have_section_quotes,
[cat > conftest.c <<EOF
diff --git a/dirent/Makefile b/dirent/Makefile
index b80f6a73ea..cfa61826ed 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -37,6 +37,7 @@ CFLAGS-scandir.c += $(uses-callbacks)
CFLAGS-scandir64.c += $(uses-callbacks)
CFLAGS-scandir-tail.c += $(uses-callbacks)
CFLAGS-scandir64-tail.c += $(uses-callbacks)
+CFLAGS-dirfd.c += $(config-cflags-wno-ignored-attributes)
include ../Rules
diff --git a/inet/Makefile b/inet/Makefile
index 9b96e57cac..a5ef1ec0a3 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -106,6 +106,9 @@ CFLAGS-either_ntoh.c += -fexceptions
CFLAGS-either_hton.c += -fexceptions
CFLAGS-getnetgrent.c += -fexceptions
CFLAGS-getnetgrent_r.c += -fexceptions
+CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst-checks-posix.c += -std=c99
CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
diff --git a/io/Makefile b/io/Makefile
index cf265dc9b9..abcdb88d48 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -111,11 +111,11 @@ CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-statfs.c += -fexceptions
CFLAGS-fstatfs.c += -fexceptions
CFLAGS-statvfs.c += -fexceptions
@@ -130,9 +130,10 @@ CFLAGS-posix_fallocate.c += -fexceptions
CFLAGS-posix_fallocate64.c += -fexceptions
CFLAGS-fallocate.c += -fexceptions
CFLAGS-fallocate64.c += -fexceptions
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
diff --git a/libio/Makefile b/libio/Makefile
index a4830ddf42..3d26a0ed25 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -112,18 +112,18 @@ CFLAGS-getchar.c += -fexceptions
CFLAGS-getwc.c += -fexceptions
CFLAGS-getwchar.c += -fexceptions
CFLAGS-iofclose.c += -fexceptions
-CFLAGS-iofflush.c += -fexceptions
+CFLAGS-iofflush.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofgetpos64.c += -fexceptions
CFLAGS-iofgetpos.c += -fexceptions
CFLAGS-iofgets.c += -fexceptions
CFLAGS-iofgetws.c += -fexceptions
-CFLAGS-iofputs.c += -fexceptions
+CFLAGS-iofputs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iofputws.c += -fexceptions
CFLAGS-iofread.c += -fexceptions
CFLAGS-iofsetpos64.c += -fexceptions
CFLAGS-iofsetpos.c += -fexceptions
CFLAGS-ioftell.c += -fexceptions
-CFLAGS-iofwrite.c += -fexceptions
+CFLAGS-iofwrite.c += -fexceptions $(config-cflags-wno-ignored-attributes)
CFLAGS-iogetdelim.c += -fexceptions
CFLAGS-iogetline.c += -fexceptions
CFLAGS-iogets.c += -fexceptions
@@ -153,6 +153,14 @@ CFLAGS-oldiofopen.c += -fexceptions
CFLAGS-iofopen.c += -fexceptions
CFLAGS-iofopen64.c += -fexceptions
CFLAGS-oldtmpfile.c += -fexceptions
+CFLAGS-fileno.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-feof_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ferror_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-getc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofflush_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-putc_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofgets_u.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
# XXX Do we need filedoalloc and wfiledoalloc? Others?
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
diff --git a/login/Makefile b/login/Makefile
index 62440499bc..a0a96f3bbe 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -64,6 +64,7 @@ endif # $(have-GLIBC_2.33)
include ../Rules
CFLAGS-getpt.c += -fexceptions
+CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
diff --git a/misc/Makefile b/misc/Makefile
index 0b7ccd4924..9dea4c9d77 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -141,6 +141,8 @@ CFLAGS-tst-tsearch.c += $(stack-align-test-flags)
CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-makedev.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mmap64.c += $(config-cflags-wno-ignored-attributes)
# Called during static library initialization, so turn stack-protection
# off for non-shared builds.
diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..695e8a0a55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -248,9 +248,9 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-sleep.c += -fexceptions
CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables
@@ -279,7 +279,7 @@ CFLAGS-execl.os = -fomit-frame-pointer
CFLAGS-execvp.os = -fomit-frame-pointer
CFLAGS-execlp.os = -fomit-frame-pointer
CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes)
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
diff --git a/resolv/Makefile b/resolv/Makefile
index 438672786f..a5dd0dc69f 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -213,6 +213,7 @@ LOCALES := en_US.UTF-8 en_US.ISO-8859-1
include ../gen-locales.mk
CFLAGS-res_hconf.c += -fexceptions
+CFLAGS-inet_pton.c += $(config-cflags-wno-ignored-attributes)
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resource/Makefile b/resource/Makefile
index d3d230a538..29056a84d8 100644
--- a/resource/Makefile
+++ b/resource/Makefile
@@ -28,3 +28,5 @@ routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
tests = tst-getrlimit bug-ulimit1
include ../Rules
+
+CFLAGS-getrlimit64.c += $(config-cflags-wno-ignored-attributes)
diff --git a/socket/Makefile b/socket/Makefile
index 156eec6c85..c6abc24bee 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -48,11 +48,11 @@ aux := sa_len
include ../Rules
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5510ce5ae7..35492fc1dd 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -212,6 +212,14 @@ CFLAGS-strfromd.c += $(libio-mtsafe)
CFLAGS-strfromf.c += $(libio-mtsafe)
CFLAGS-strfroml.c += $(libio-mtsafe)
+CFLAGS-strtof.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtof_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtod_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strtold_l.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-secure-getenv.c += $(config-cflags-wno-ignored-attributes)
+
CFLAGS-tst-bsearch.c += $(stack-align-test-flags)
CFLAGS-tst-qsort.c += $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
diff --git a/string/Makefile b/string/Makefile
index 641e062bbb..8a88261729 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -231,6 +231,14 @@ LDFLAGS-tst-xbzero-opt = -z now
CFLAGS-memcpy.c += $(no-stack-protector)
CFLAGS-wordcopy.c += $(no-stack-protector)
+CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
+CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
+
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
cmp $^ > $@; \
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)
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2024-04-17 20:06 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15 18:41 [glibc/azanella/clang] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases Adhemerval Zanella
-- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:06 Adhemerval Zanella
2024-04-02 15:52 Adhemerval Zanella
2024-02-09 17:30 Adhemerval Zanella
2024-02-07 14:06 Adhemerval Zanella
2024-01-29 17:56 Adhemerval Zanella
2023-12-21 18:53 Adhemerval Zanella
2023-09-28 17:51 Adhemerval Zanella
2023-08-30 12:36 Adhemerval Zanella
2023-02-09 19:47 Adhemerval Zanella
2022-10-28 17:40 Adhemerval Zanella
2022-10-28 17:38 Adhemerval Zanella
2022-10-04 12:58 Adhemerval Zanella
2022-10-04 12:56 Adhemerval Zanella
2022-06-09 21:19 Adhemerval Zanella
2022-06-09 13:16 Adhemerval Zanella
2022-06-03 14:05 Adhemerval Zanella
2022-05-13 14:19 Adhemerval Zanella
2022-05-12 19:33 Adhemerval Zanella
2022-05-10 18:23 Adhemerval Zanella
2022-04-29 14:03 Adhemerval Zanella
2022-04-04 12:54 Adhemerval Zanella
2022-03-31 19:06 Adhemerval Zanella
2022-03-29 20:29 Adhemerval Zanella
2022-03-16 18:03 Adhemerval Zanella
2022-03-11 17:25 Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).