Commit 53bf2d0f authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

build: enable -fno-common



This flag prevents the compiler from merging multiple tenative global
variable declarations (e.g. 'int i;' without an assignment) into a
single copy later.  In the default (-fcommon) mode, this allows multiple
definitions of an uninitialized global variable to be linked into a
single program without any warnings.

Change-Id: I0339012a7164dccd311ab1f62d11111d24529fbd
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 96b1f7e0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -64,6 +64,9 @@ COMMON_CFLAGS += -fPIC
# Enable stack buffer overflow checking
COMMON_CFLAGS += -fstack-protector

# Prevent accidental multiple definitions of global variables
COMMON_CFLAGS += -fno-common

# Enable full RELRO - no lazy relocation (resolve everything at load time).
# This allows the GOT to be made read-only early in the loading process.
LDFLAGS += -Wl,-z,relro,-z,now