work around -Wcast-align=strict error with old GCC

pull/65/head
Daniel Micay 2018-10-23 07:23:07 -04:00
parent 0b963078d5
commit 05ac717cf2
1 changed files with 5 additions and 1 deletions

View File

@ -2,8 +2,12 @@ CONFIG_CXX_ALLOCATOR := true
CONFIG_UBSAN := false
CONFIG_SEAL_METADATA := false
define safe_flag
$(shell $(CC) -E $1 - </dev/null &>/dev/null && echo $1)
endef
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
CXXFLAGS := -std=c++14 $(SHARED_FLAGS)
LDFLAGS := -Wl,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text