work around -Wcast-align=strict error with old GCC
This commit is contained in:
parent
0b963078d5
commit
05ac717cf2
6
Makefile
6
Makefile
@ -2,8 +2,12 @@ CONFIG_CXX_ALLOCATOR := true
|
|||||||
CONFIG_UBSAN := false
|
CONFIG_UBSAN := false
|
||||||
CONFIG_SEAL_METADATA := false
|
CONFIG_SEAL_METADATA := false
|
||||||
|
|
||||||
|
define safe_flag
|
||||||
|
$(shell $(CC) -E $1 - </dev/null &>/dev/null && echo $1)
|
||||||
|
endef
|
||||||
|
|
||||||
CPPFLAGS := -D_GNU_SOURCE
|
CPPFLAGS := -D_GNU_SOURCE
|
||||||
SHARED_FLAGS := -O2 -flto -fPIC -fvisibility=hidden -fno-plt -pipe -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings
|
SHARED_FLAGS := -O2 -flto -fPIC -fvisibility=hidden -fno-plt -pipe -Wall -Wextra $(call safe_flag,-Wcast-align=strict) -Wcast-qual -Wwrite-strings
|
||||||
CFLAGS := -std=c11 $(SHARED_FLAGS) -Wmissing-prototypes
|
CFLAGS := -std=c11 $(SHARED_FLAGS) -Wmissing-prototypes
|
||||||
CXXFLAGS := -std=c++14 $(SHARED_FLAGS)
|
CXXFLAGS := -std=c++14 $(SHARED_FLAGS)
|
||||||
LDFLAGS := -Wl,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text
|
LDFLAGS := -Wl,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text
|
||||||
|
Loading…
Reference in New Issue
Block a user