From 4f57219a2247a807e2b65f61501a48e37e261ab8 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 17 Sep 2020 16:49:21 -0700 Subject: [PATCH] fixed ubsan tests with dynamic library --- Makefile | 9 ++++++--- tests/.gitignore | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6bf952c..c1869f6 100644 --- a/Makefile +++ b/Makefile @@ -124,8 +124,8 @@ check: .PHONY: test test: - CFLAGS="$(CFLAGS)" $(MAKE) -C $(TESTDIR) $@ - CFLAGS="$(CFLAGS)" $(MAKE) -C $(EXDIR) $@ + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) -C $(TESTDIR) $@ + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) -C $(EXDIR) $@ clangtest: CFLAGS ?= -O3 clangtest: CFLAGS += -Werror -Wconversion -Wno-sign-conversion @@ -142,8 +142,11 @@ clangtest-native: clean @CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(PRGDIR) native CC=clang @CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(TESTDIR) native CC=clang +usan: CC = clang +usan: CFLAGS = -O3 -g -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-recover=pointer-overflow +usan: LDFLAGS = $(CFLAGS) usan: clean - CC=clang CFLAGS="-O3 -g -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-recover=pointer-overflow" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1 + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1 usan32: clean CFLAGS="-m32 -O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1 diff --git a/tests/.gitignore b/tests/.gitignore index 0d13df8..99351af 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -11,6 +11,7 @@ fasttest roundTripTest checkTag checkFrame +decompress-partial # test artefacts tmp*