From 7c241325d67af9e24ff03d4c6f6280c17ea181f8 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 9 Jul 2021 20:09:14 +0200 Subject: Force building with -fno-common As a result, is not necessary to specify __attribute__ ((nocommon)) on individual definitions. GCC 10 defaults to -fno-common on all architectures except ARC, but this change is compatible with older GCC versions and ARC, too. Reviewed-by: Carlos O'Donell --- Makeconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Makeconfig') diff --git a/Makeconfig b/Makeconfig index efc7351d71..68663d984e 100644 --- a/Makeconfig +++ b/Makeconfig @@ -923,8 +923,12 @@ ifeq "$(strip $(+cflags))" "" +cflags := $(default_cflags) endif # $(+cflags) == "" +# Force building with -fno-common because hidden_def, compat_symbol +# and other constructs do not work for common symbols (and would +# otherwise require specifying __attribute__ ((nocommon)) on a +# case-by-case basis). +cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) \ - $(+stack-protector) + $(+stack-protector) -fno-common +gcc-nowarn := -w # Each sysdeps directory can contain header files that both will be -- cgit 1.4.1