Move UBSan to clang compile target and run that as a separate test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/Makefile b/Makefile
index 0518ccb..267e497 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,8 @@ CFLAGS.debug += -g3
CFLAGS.debug += -DSMTP_TEST
CFLAGS.debug += -Wno-missing-prototypes
CFLAGS.debug += -fprofile-arcs -ftest-coverage
-CFLAGS.debug += -fsanitize=undefined
+
+CFLAGS.clang += -fsanitize=undefined
CFLAGS.release += $(CFLAGS)
CFLAGS.release += -O3
@@ -96,10 +97,9 @@ CPPFLAGS += -fpermissive
CPPFLAGS.release = $(CPPFLAGS)
-CFLAGS.gcc.debug += $(CFLAGS.debug) $(CWARN.gcc)
+CFLAGS.gcc.debug += $(CFLAGS.debug) $(CWARN.gcc)
CFLAGS.gcc.release += $(CFLAGS.release) $(CWARN.gcc)
-CFLAGS.clang.debug += $(CFLAGS.debug) $(CWARN.clang)
-CFLAGS.clang.release += $(CFLAGS.release) $(CWARN.clang)
+CFLAGS.clang.debug += $(CFLAGS.debug) $(CFLAGS.clang) $(CWARN.clang)
VFLAGS += -q
VFLAGS += --error-exitcode=1
@@ -171,6 +171,7 @@ install: all
test: all \
test_unit
$(VALGRIND_MEMCHECK) $(BDIR)/debug/test
+ $(VALGRIND_MEMCHECK) $(BDIR)/debug/clang_test
$(VALGRIND_MEMCHECK) $(BDIR)/release/test_nossl
$(BDIR)/release/test_cpp_wrapper
@@ -246,7 +247,7 @@ $(BDIR)/release/smtp.o: src/smtp.c | $(BDIR)/release
$(BDIR)/debug/test: $(BDIR)/debug/seams.o \
$(BDIR)/debug/smtp.o \
$(BDIR)/debug/test.o
- $(LINK.c.debug) -lssl -lcrypto -lgcov -lubsan
+ $(LINK.c.debug) -lssl -lcrypto -lgcov
$(BDIR)/debug/test.o: test/test.c | $(BDIR)/debug
$(COMPILE.c.debug) -Isrc/