Merge branch 'rj/sparse-flags'
authorJunio C Hamano <gitster@pobox.com>
Thu, 7 Feb 2019 06:05:30 +0000 (22:05 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Feb 2019 06:05:30 +0000 (22:05 -0800)
Use of the sparse tool got easier to customize from the command
line to help developers.

* rj/sparse-flags:
Makefile: improve SPARSE_FLAGS customisation
config.mak.uname: remove obsolete SPARSE_FLAGS setting

1  2 
Makefile
config.mak.uname
diff --combined Makefile
index 45e6d700a73b52746e54c69c69ca7f6dcd9cb112,fced94cb733380cca5ea4820615ec2cc320aae35..571160a2c4dde4b89f3cbddafdcb2d168f9446c1
+++ b/Makefile
@@@ -186,12 -186,6 +186,12 @@@ all:
  # in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO
  # wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined.
  #
 +# Define BLK_SHA256 to use the built-in SHA-256 routines.
 +#
 +# Define GCRYPT_SHA256 to use the SHA-256 routines in libgcrypt.
 +#
 +# Define OPENSSL_SHA256 to use the SHA-256 routines in OpenSSL.
 +#
  # Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin).
  #
  # Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
@@@ -574,7 -568,11 +574,11 @@@ SPATCH = spatc
  
  export TCL_PATH TCLTK_PATH
  
- SPARSE_FLAGS =
+ # user customisation variable for 'sparse' target
+ SPARSE_FLAGS ?=
+ # internal/platform customisation variable for 'sparse'
+ SP_EXTRA_FLAGS =
  SPATCH_FLAGS = --all-includes --patch .
  
  
@@@ -634,6 -632,7 +638,6 @@@ SCRIPT_LIB += git-parse-remot
  SCRIPT_LIB += git-rebase--am
  SCRIPT_LIB += git-rebase--common
  SCRIPT_LIB += git-rebase--preserve-merges
 -SCRIPT_LIB += git-rebase--merge
  SCRIPT_LIB += git-sh-setup
  SCRIPT_LIB += git-sh-i18n
  
@@@ -689,7 -688,6 +693,7 @@@ SCRIPTS = $(SCRIPT_SH_INS) 
  
  ETAGS_TARGET = TAGS
  
 +FUZZ_OBJS += fuzz-commit-graph.o
  FUZZ_OBJS += fuzz-pack-headers.o
  FUZZ_OBJS += fuzz-pack-idx.o
  
@@@ -730,9 -728,7 +734,9 @@@ TEST_BUILTINS_OBJS += test-dump-split-i
  TEST_BUILTINS_OBJS += test-dump-untracked-cache.o
  TEST_BUILTINS_OBJS += test-example-decorate.o
  TEST_BUILTINS_OBJS += test-genrandom.o
 +TEST_BUILTINS_OBJS += test-hash.o
  TEST_BUILTINS_OBJS += test-hashmap.o
 +TEST_BUILTINS_OBJS += test-hash-speed.o
  TEST_BUILTINS_OBJS += test-index-version.o
  TEST_BUILTINS_OBJS += test-json-writer.o
  TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
@@@ -755,7 -751,6 +759,7 @@@ TEST_BUILTINS_OBJS += test-run-command.
  TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
  TEST_BUILTINS_OBJS += test-sha1.o
  TEST_BUILTINS_OBJS += test-sha1-array.o
 +TEST_BUILTINS_OBJS += test-sha256.o
  TEST_BUILTINS_OBJS += test-sigchain.o
  TEST_BUILTINS_OBJS += test-strcmp-offset.o
  TEST_BUILTINS_OBJS += test-string-list.o
@@@ -763,7 -758,6 +767,7 @@@ TEST_BUILTINS_OBJS += test-submodule-co
  TEST_BUILTINS_OBJS += test-submodule-nested-repo-config.o
  TEST_BUILTINS_OBJS += test-subprocess.o
  TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
 +TEST_BUILTINS_OBJS += test-xml-encode.o
  TEST_BUILTINS_OBJS += test-wildmatch.o
  TEST_BUILTINS_OBJS += test-windows-named-pipe.o
  TEST_BUILTINS_OBJS += test-write-cache.o
@@@ -1656,19 -1650,6 +1660,19 @@@ endi
  endif
  endif
  
 +ifdef OPENSSL_SHA256
 +      EXTLIBS += $(LIB_4_CRYPTO)
 +      BASIC_CFLAGS += -DSHA256_OPENSSL
 +else
 +ifdef GCRYPT_SHA256
 +      BASIC_CFLAGS += -DSHA256_GCRYPT
 +      EXTLIBS += -lgcrypt
 +else
 +      LIB_OBJS += sha256/block/sha256.o
 +      BASIC_CFLAGS += -DSHA256_BLK
 +endif
 +endif
 +
  ifdef SHA1_MAX_BLOCK_SIZE
        LIB_OBJS += compat/sha1-chunked.o
        BASIC_CFLAGS += -DSHA1_MAX_BLOCK_SIZE="$(SHA1_MAX_BLOCK_SIZE)"
@@@ -2370,10 -2351,10 +2374,10 @@@ gettext.sp gettext.s gettext.o: GIT-PRE
  gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
        -DGIT_LOCALE_PATH='"$(localedir_relative_SQ)"'
  
- http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \
+ http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SP_EXTRA_FLAGS += \
        -DCURL_DISABLE_TYPECHECK
  
- pack-revindex.sp: SPARSE_FLAGS += -Wno-memcpy-max-count
+ pack-revindex.sp: SP_EXTRA_FLAGS += -Wno-memcpy-max-count
  
  ifdef NO_EXPAT
  http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
@@@ -2387,7 -2368,7 +2391,7 @@@ endi
  ifdef USE_NED_ALLOCATOR
  compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
        -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR
- compat/nedmalloc/nedmalloc.sp: SPARSE_FLAGS += -Wno-non-pointer-null
+ compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
  endif
  
  git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
@@@ -2711,7 -2692,7 +2715,7 @@@ SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ)
  
  $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
        $(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \
-               $(SPARSE_FLAGS) $<
+               $(SPARSE_FLAGS) $(SP_EXTRA_FLAGS) $<
  
  .PHONY: sparse $(SP_OBJ)
  sparse: $(SP_OBJ)
@@@ -2949,16 -2930,6 +2953,16 @@@ rpm:
        @false
  .PHONY: rpm
  
 +artifacts-tar:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) \
 +              GIT-BUILD-OPTIONS $(TEST_PROGRAMS) $(test_bindir_programs) \
 +              $(NO_INSTALL) $(MOFILES)
 +      $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) \
 +              SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)'
 +      test -n "$(ARTIFACTS_DIRECTORY)"
 +      mkdir -p "$(ARTIFACTS_DIRECTORY)"
 +      $(TAR) czf "$(ARTIFACTS_DIRECTORY)/artifacts.tar.gz" $^ templates/blt/
 +.PHONY: artifacts-tar
 +
  htmldocs = git-htmldocs-$(GIT_VERSION)
  manpages = git-manpages-$(GIT_VERSION)
  .PHONY: dist-doc distclean
@@@ -3136,7 -3107,7 +3140,7 @@@ cover_db_html: cover_d
  # An example command to build against libFuzzer from LLVM 4.0.0:
  #
  # make CC=clang CXX=clang++ \
 -#      FUZZ_CXXFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address" \
 +#      CFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address" \
  #      LIB_FUZZING_ENGINE=/usr/lib/llvm-4.0/lib/libFuzzer.a \
  #      fuzz-all
  #
diff --combined config.mak.uname
index 7b36a1dfe7dc245ab0e9e9d431ee1d7c562915cb,d0ebe3c5702a33d91cb76942878faf80daaa9ca4..786bb2f913ac36371d37b4ee3fb7b03547a4f45c
@@@ -187,7 -187,7 +187,7 @@@ ifeq ($(uname_O),Cygwin
        UNRELIABLE_FSTAT = UnfortunatelyYes
        OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
        MMAP_PREVENTS_DELETE = UnfortunatelyYes
 -      COMPAT_OBJS += compat/cygwin.o
 +      COMPAT_OBJS += compat/win32/path-utils.o
        FREAD_READS_DIRECTORIES = UnfortunatelyYes
  endif
  ifeq ($(uname_S),FreeBSD)
@@@ -233,7 -233,6 +233,7 @@@ ifeq ($(uname_S),OpenBSD
        HAVE_BSD_SYSCTL = YesPlease
        HAVE_BSD_KERN_PROC_SYSCTL = YesPlease
        PROCFS_EXECUTABLE_PATH = /proc/curproc/file
 +      FREAD_READS_DIRECTORIES = UnfortunatelyYes
  endif
  ifeq ($(uname_S),MirBSD)
        NO_STRCASESTR = YesPlease
@@@ -442,43 -441,26 +442,43 @@@ ifeq ($(uname_S),NONSTOP_KERNEL
        # INLINE='' would just replace one set of warnings with another and
        # still not compile in c89 mode, due to non-const array initializations.
        CC = cc -c99
 +      # Build down-rev compatible objects that don't use our new getopt_long.
 +      ifeq ($(uname_R).$(uname_V),J06.21)
 +              CC += -WRVU=J06.20
 +      endif
 +      ifeq ($(uname_R).$(uname_V),L17.02)
 +              CC += -WRVU=L16.05
 +      endif
        # Disable all optimization, seems to result in bad code, with -O or -O2
        # or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects
        # abends on "git push". Needs more investigation.
 -      CFLAGS = -g -O0
 +      CFLAGS = -g -O0 -Winline
        # We'd want it to be here.
        prefix = /usr/local
 -      # Our's are in ${prefix}/bin (perl might also be in /usr/bin/perl).
 -      PERL_PATH = ${prefix}/bin/perl
 -      PYTHON_PATH = ${prefix}/bin/python
 -
 +      # perl and python must be in /usr/bin on NonStop - supplied by HPE
 +      # with operating system in that managed directory.
 +      PERL_PATH = /usr/bin/perl
 +      PYTHON_PATH = /usr/bin/python
 +      # The current /usr/coreutils/rm at lowest support level does not work
 +      # with the git test structure. Long paths as in
 +      # 'trash directory...' cause rm to terminate prematurely without fully
 +      # removing the directory at OS releases J06.21 and L17.02.
 +      # Default to the older rm until those two releases are deprecated.
 +      RM = /bin/rm -f
        # As detected by './configure'.
        # Missdetected, hence commented out, see below.
        #NO_CURL = YesPlease
        # Added manually, see above.
 +      NEEDS_SSL_WITH_CURL = YesPlease
 +      NEEDS_CRYPTO_WITH_SSL = YesPlease
 +      HAVE_DEV_TTY = YesPlease
        HAVE_LIBCHARSET_H = YesPlease
        HAVE_STRINGS_H = YesPlease
        NEEDS_LIBICONV = YesPlease
        NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
        NO_SYS_SELECT_H = UnfortunatelyYes
        NO_D_TYPE_IN_DIRENT = YesPlease
 +      NO_GETTEXT = YesPlease
        NO_HSTRERROR = YesPlease
        NO_STRCASESTR = YesPlease
        NO_MEMMEM = YesPlease
        NO_MKDTEMP = YesPlease
        # Currently libiconv-1.9.1.
        OLD_ICONV = UnfortunatelyYes
 -      NO_REGEX = YesPlease
 +      NO_REGEX = NeedsStartEnd
        NO_PTHREADS = UnfortunatelyYes
  
        # Not detected (nor checked for) by './configure'.
@@@ -545,7 -527,6 +545,7 @@@ ifneq (,$(findstring MINGW,$(uname_S))
        COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
        COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
        COMPAT_OBJS += compat/mingw.o compat/winansi.o \
 +              compat/win32/path-utils.o \
                compat/win32/pthread.o compat/win32/syslog.o \
                compat/win32/dirent.o
        BASIC_CFLAGS += -DWIN32 -DPROTECT_NTFS_DEFAULT=1
        RC = windres -O coff
        NATIVE_CRLF = YesPlease
        X = .exe
-       SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
  ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
        htmldir = doc/git/html/
        prefix =