about summary refs log tree commit diff
path: root/Makeconfig
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-07-09 20:09:14 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-07-09 20:09:14 +0200
commit7c241325d67af9e24ff03d4c6f6280c17ea181f8 (patch)
tree5667f94ae80c6e75dc1bac29ab4c51d48cfad084 /Makeconfig
parentdc76a059fded7a203c82dbb91d4fc1f43d3250db (diff)
downloadglibc-7c241325d67af9e24ff03d4c6f6280c17ea181f8.tar.gz
glibc-7c241325d67af9e24ff03d4c6f6280c17ea181f8.tar.xz
glibc-7c241325d67af9e24ff03d4c6f6280c17ea181f8.zip
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 <carlos@redhat.com>
Diffstat (limited to 'Makeconfig')
-rw-r--r--Makeconfig6
1 files changed, 5 insertions, 1 deletions
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