diff --git a/Makefile b/Makefile index f30f0d8..e793ab5 100644 --- a/Makefile +++ b/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 $@