summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-14 20:42:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-14 20:42:29 (GMT)
commit54bbadaeca930183989bcd097bde7befa98dc2f9 (patch)
treefb8b156be7627ec4672c5a86cda98820894ed3f6
parent8dbeba198ee6759874bb68a74131d1d3adfd75ea (diff)
parentf65d07fffaadc556b1a18cda7bb611c7f68717ea (diff)
downloadgit-54bbadaeca930183989bcd097bde7befa98dc2f9.zip
git-54bbadaeca930183989bcd097bde7befa98dc2f9.tar.gz
git-54bbadaeca930183989bcd097bde7befa98dc2f9.tar.bz2
Merge branch 'jk/asan-build-fix' into maint
Work around test breakages caused by custom regex engine used in libasan, when address sanitizer is used with more recent versions of gcc and clang. * jk/asan-build-fix: Makefile: use compat regex with SANITIZE=address
-rw-r--r--Makefile3
-rw-r--r--compat/regex/regex.h5
2 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 09f98b7..9cd9826 100644
--- a/Makefile
+++ b/Makefile
@@ -1220,6 +1220,9 @@ endif
ifneq ($(filter leak,$(SANITIZERS)),)
BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS
endif
+ifneq ($(filter address,$(SANITIZERS)),)
+NO_REGEX = NeededForASAN
+endif
endif
ifndef sysconfdir
diff --git a/compat/regex/regex.h b/compat/regex/regex.h
index 08a2609..2d34128 100644
--- a/compat/regex/regex.h
+++ b/compat/regex/regex.h
@@ -41,6 +41,11 @@
extern "C" {
#endif
+#define regcomp git_regcomp
+#define regexec git_regexec
+#define regerror git_regerror
+#define regfree git_regfree
+
/* The following two types have to be signed and unsigned integer type
wide enough to hold a value of a pointer. For most ANSI compilers
ptrdiff_t and size_t should be likely OK. Still size of these two