From d728afae8e2d162c63fced7293192e4e0f724810 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 14 Oct 2018 18:58:54 -0400 Subject: [PATCH] add configuration option for testing with UBSan --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) 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 $@