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