]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/asan-build-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 14 Feb 2020 20:42:29 +0000 (12:42 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Feb 2020 20:42:29 +0000 (12:42 -0800)
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

1  2 
Makefile
compat/regex/regex.h

diff --combined Makefile
index 09f98b777cae1dc9226f13c182011adacfd8b2fc,6ca9f4dd22c55216c1e2f362cc0adbe8c9ff72c3..9cd9826800bc9077b74a0bc5bf0097117212dd73
+++ b/Makefile
@@@ -481,7 -481,7 +481,7 @@@ all:
  #
  # When DEVELOPER is set, DEVOPTS can be used to control compiler
  # options.  This variable contains keywords separated by
 -# whitespace. The following keywords are are recognized:
 +# whitespace. The following keywords are recognized:
  #
  #    no-error:
  #
@@@ -727,7 -727,6 +727,7 @@@ TEST_BUILTINS_OBJS += test-prio-queue.
  TEST_BUILTINS_OBJS += test-progress.o
  TEST_BUILTINS_OBJS += test-reach.o
  TEST_BUILTINS_OBJS += test-read-cache.o
 +TEST_BUILTINS_OBJS += test-read-graph.o
  TEST_BUILTINS_OBJS += test-read-midx.o
  TEST_BUILTINS_OBJS += test-ref-store.o
  TEST_BUILTINS_OBJS += test-regex.o
@@@ -824,8 -823,6 +824,8 @@@ LIB_H := $(sort $(patsubst ./%,%,$(shel
        -name '*.h' -print)))
  
  LIB_OBJS += abspath.o
 +LIB_OBJS += add-interactive.o
 +LIB_OBJS += add-patch.o
  LIB_OBJS += advice.o
  LIB_OBJS += alias.o
  LIB_OBJS += alloc.o
@@@ -1128,7 -1125,6 +1128,7 @@@ BUILTIN_OBJS += builtin/shortlog.
  BUILTIN_OBJS += builtin/show-branch.o
  BUILTIN_OBJS += builtin/show-index.o
  BUILTIN_OBJS += builtin/show-ref.o
 +BUILTIN_OBJS += builtin/sparse-checkout.o
  BUILTIN_OBJS += builtin/stash.o
  BUILTIN_OBJS += builtin/stripspace.o
  BUILTIN_OBJS += builtin/submodule--helper.o
@@@ -1220,6 -1216,9 +1220,9 @@@ endi
  ifneq ($(filter leak,$(SANITIZERS)),)
  BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS
  endif
+ ifneq ($(filter address,$(SANITIZERS)),)
+ NO_REGEX = NeededForASAN
+ endif
  endif
  
  ifndef sysconfdir
@@@ -2781,7 -2780,8 +2784,7 @@@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORC
  .PHONY: sparse $(SP_OBJ)
  sparse: $(SP_OBJ)
  
 -GEN_HDRS := command-list.h unicode-width.h
 -EXCEPT_HDRS := $(GEN_HDRS) compat/% xdiff/%
 +EXCEPT_HDRS := command-list.h unicode-width.h compat/% xdiff/%
  ifndef GCRYPT_SHA256
        EXCEPT_HDRS += sha256/gcrypt.h
  endif
@@@ -3106,7 -3106,7 +3109,7 @@@ clean: profile-clean coverage-clean coc
        $(RM) $(HCC)
        $(RM) -r bin-wrappers $(dep_dirs)
        $(RM) -r po/build/
 -      $(RM) *.pyc *.pyo */*.pyc */*.pyo command-list.h $(ETAGS_TARGET) tags cscope*
 +      $(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
        $(RM) -r $(GIT_TARNAME) .doc-tmp-dir
        $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
        $(RM) $(htmldocs).tar.gz $(manpages).tar.gz
diff --combined compat/regex/regex.h
index 08a26096637712689a071bf58586939bb6ff7c75,bd113cfc0e1c416794e51c2bfcc60ea0b2979a11..2d3412860d4d3a10cb989a769260496326055924
  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
@@@ -322,7 -327,7 +327,7 @@@ typedef enu
    /* POSIX regcomp return error codes.  (In the order listed in the
       standard.)  */
    REG_BADPAT,         /* Invalid pattern.  */
 -  REG_ECOLLATE,               /* Inalid collating element.  */
 +  REG_ECOLLATE,               /* Invalid collating element.  */
    REG_ECTYPE,         /* Invalid character class name.  */
    REG_EESCAPE,                /* Trailing backslash.  */
    REG_ESUBREG,                /* Invalid back reference.  */