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: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
96b1f7e078
commit
53bf2d0f91
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user