debian: xdiff: Do not enable XDL_FAST_HASH by default
[git/debian.git] / debian / patches / xdiff-Do-not-enable-XDL_FAST_HASH-by-default.diff
blob2d90425129e2940d37dcd74ca85c553a292d4c34
1 From e8afea585132816b0024d74fc40a9294eb2afe1d Mon Sep 17 00:00:00 2001
2 From: Anders Kaseorg <andersk@mit.edu>
3 Date: Wed, 30 Nov 2016 23:10:53 -0500
4 Subject: xdiff: Do not enable XDL_FAST_HASH by default
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Although XDL_FAST_HASH computes hashes slightly faster on some
10 architectures, its collision characteristics are much worse, resulting
11 in some pathological diffs running over 100x slower
12 (http://public-inbox.org/git/20141222041944.GA441@peff.net/).
14 Furthermore, it was being enabled when ‘uname -m’ returns x86_64, even
15 if we are cross-compiling for a different architecture. This mistake
16 was also causing the Debian build reproducibility test to fail
17 (https://tests.reproducible-builds.org/debian/index_variations.html).
18 Future architecture-specific definitions should be based on compiler
19 macros such as __x86_64__ rather than uname.
21 Signed-off-by: Anders Kaseorg <andersk@mit.edu>
22 ---
23 Makefile | 1 -
24 config.mak.uname | 5 -----
25 2 files changed, 6 deletions(-)
27 diff --git a/Makefile b/Makefile
28 index f53fcc90d..c237d4f91 100644
29 --- a/Makefile
30 +++ b/Makefile
31 @@ -341,7 +341,6 @@ all::
32 # Define XDL_FAST_HASH to use an alternative line-hashing method in
33 # the diff algorithm. It gives a nice speedup if your processor has
34 # fast unaligned word loads. Does NOT work on big-endian systems!
35 -# Enabled by default on x86_64.
37 # Define GIT_USER_AGENT if you want to change how git identifies itself during
38 # network interactions. The default is "git/$(GIT_VERSION)".
39 diff --git a/config.mak.uname b/config.mak.uname
40 index b232908f8..2831a68c3 100644
41 --- a/config.mak.uname
42 +++ b/config.mak.uname
43 @@ -1,10 +1,8 @@
44 # Platform specific Makefile tweaks based on uname detection
46 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
47 -uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
48 uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
49 uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
50 -uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
51 uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
53 ifdef MSVC
54 @@ -17,9 +15,6 @@ endif
55 # because maintaining the nesting to match is a pain. If
56 # we had "elif" things would have been much nicer...
58 -ifeq ($(uname_M),x86_64)
59 - XDL_FAST_HASH = YesPlease
60 -endif
61 ifeq ($(uname_S),OSF1)
62 # Need this for u_short definitions et al
63 BASIC_CFLAGS += -D_OSF_SOURCE
64 --
65 2.11.0