add configuration option for testing with UBSan
parent
535466fdfd
commit
d728afae8e
6
Makefile
6
Makefile
|
@ -1,4 +1,5 @@
|
|||
CONFIG_CXX_ALLOCATOR := true
|
||||
CONFIG_UBSAN := false
|
||||
|
||||
CPPFLAGS := -D_GNU_SOURCE
|
||||
SHARED_FLAGS := -O2 -flto -fPIC -fvisibility=hidden -fno-plt -pipe -Wall -Wextra
|
||||
|
@ -16,6 +17,11 @@ ifeq ($(CONFIG_CXX_ALLOCATOR),true)
|
|||
OBJECTS += new.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_UBSAN),true)
|
||||
CFLAGS += -fsanitize=undefined
|
||||
CXXFLAGS += -fsanitize=undefined
|
||||
endif
|
||||
|
||||
hardened_malloc.so: $(OBJECTS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -shared $^ $(LDLIBS) -o $@
|
||||
|
||||
|
|
Loading…
Reference in New Issue