Use -O1 for Asan and UBsan
parent
2ee8e3b26d
commit
6a29d8c56f
|
|
@ -373,6 +373,9 @@ endif # No ASM
|
||||||
|
|
||||||
# Undefined Behavior Sanitizer (UBsan) testing. Issue 'make ubsan'.
|
# Undefined Behavior Sanitizer (UBsan) testing. Issue 'make ubsan'.
|
||||||
ifeq ($(findstring ubsan,$(MAKECMDGOALS)),ubsan)
|
ifeq ($(findstring ubsan,$(MAKECMDGOALS)),ubsan)
|
||||||
|
CXXFLAGS := $(CXXFLAGS:-g%=-g3)
|
||||||
|
CXXFLAGS := $(CXXFLAGS:-O%=-O1)
|
||||||
|
CXXFLAGS := $(CXXFLAGS:-xO%=-xO1)
|
||||||
ifeq ($(findstring -fsanitize=undefined,$(CXXFLAGS)),)
|
ifeq ($(findstring -fsanitize=undefined,$(CXXFLAGS)),)
|
||||||
CXXFLAGS += -fsanitize=undefined
|
CXXFLAGS += -fsanitize=undefined
|
||||||
endif # CXXFLAGS
|
endif # CXXFLAGS
|
||||||
|
|
@ -383,6 +386,9 @@ endif # UBsan
|
||||||
|
|
||||||
# Address Sanitizer (Asan) testing. Issue 'make asan'.
|
# Address Sanitizer (Asan) testing. Issue 'make asan'.
|
||||||
ifeq ($(findstring asan,$(MAKECMDGOALS)),asan)
|
ifeq ($(findstring asan,$(MAKECMDGOALS)),asan)
|
||||||
|
CXXFLAGS := $(CXXFLAGS:-g%=-g3)
|
||||||
|
CXXFLAGS := $(CXXFLAGS:-O%=-O1)
|
||||||
|
CXXFLAGS := $(CXXFLAGS:-xO%=-xO1)
|
||||||
ifeq ($(findstring -fsanitize=address,$(CXXFLAGS)),)
|
ifeq ($(findstring -fsanitize=address,$(CXXFLAGS)),)
|
||||||
CXXFLAGS += -fsanitize=address
|
CXXFLAGS += -fsanitize=address
|
||||||
endif # CXXFLAGS
|
endif # CXXFLAGS
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue