Skip to content

Commit fd1ec82

Browse files
committed
Merge branch 'ab/retire-ppc-sha1'
Remove the assembly version of SHA-1 implementation for PPC. * ab/retire-ppc-sha1: Makefile: use $(OBJECTS) instead of $(C_OBJ) Makefile + hash.h: remove PPC_SHA1 implementation
2 parents 00b0199 + 3221597 commit fd1ec82

File tree

8 files changed

+9
-350
lines changed

8 files changed

+9
-350
lines changed

INSTALL

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ Issues of note:
135135

136136
By default, git uses OpenSSL for SHA1 but it will use its own
137137
library (inspired by Mozilla's) with either NO_OPENSSL or
138-
BLK_SHA1. Also included is a version optimized for PowerPC
139-
(PPC_SHA1).
138+
BLK_SHA1.
140139

141140
- "libcurl" library is used for fetching and pushing
142141
repositories over http:// or https://, as well as by

Makefile

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,6 @@ include shared.mak
155155
# Define BLK_SHA1 environment variable to make use of the bundled
156156
# optimized C SHA1 routine.
157157
#
158-
# Define PPC_SHA1 environment variable when running make to make use of
159-
# a bundled SHA1 routine optimized for PowerPC.
160-
#
161158
# Define DC_SHA1 to unconditionally enable the collision-detecting sha1
162159
# algorithm. This is slower, but may detect attempted collision attacks.
163160
# Takes priority over other *_SHA1 knobs.
@@ -1803,6 +1800,10 @@ ifdef APPLE_COMMON_CRYPTO
18031800
SHA1_MAX_BLOCK_SIZE = 1024L*1024L*1024L
18041801
endif
18051802

1803+
ifdef PPC_SHA1
1804+
$(error the PPC_SHA1 flag has been removed along with the PowerPC-specific SHA-1 implementation.)
1805+
endif
1806+
18061807
ifdef OPENSSL_SHA1
18071808
EXTLIBS += $(LIB_4_CRYPTO)
18081809
BASIC_CFLAGS += -DSHA1_OPENSSL
@@ -1811,10 +1812,6 @@ ifdef BLK_SHA1
18111812
LIB_OBJS += block-sha1/sha1.o
18121813
BASIC_CFLAGS += -DSHA1_BLK
18131814
else
1814-
ifdef PPC_SHA1
1815-
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
1816-
BASIC_CFLAGS += -DSHA1_PPC
1817-
else
18181815
ifdef APPLE_COMMON_CRYPTO
18191816
COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
18201817
BASIC_CFLAGS += -DSHA1_APPLE
@@ -1848,7 +1845,6 @@ endif
18481845
endif
18491846
endif
18501847
endif
1851-
endif
18521848

18531849
ifdef OPENSSL_SHA256
18541850
EXTLIBS += $(LIB_4_CRYPTO)
@@ -2595,13 +2591,7 @@ missing_compdb_dir =
25952591
compdb_args =
25962592
endif
25972593

2598-
ASM_SRC := $(wildcard $(OBJECTS:o=S))
2599-
ASM_OBJ := $(ASM_SRC:S=o)
2600-
C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))
2601-
2602-
$(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
2603-
$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
2604-
$(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
2594+
$(OBJECTS): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
26052595
$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
26062596

26072597
%.s: %.c GIT-CFLAGS FORCE
@@ -3093,7 +3083,7 @@ t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) $(REFTABLE_TEST_LIB)
30933083
check-sha1:: t/helper/test-tool$X
30943084
t/helper/test-sha1.sh
30953085

3096-
SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
3086+
SP_OBJ = $(patsubst %.o,%.sp,$(OBJECTS))
30973087

30983088
$(SP_OBJ): %.sp: %.c %.o
30993089
$(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \

block-sha1/sha1.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
* try to do the silly "optimize away loads" part because it won't
2929
* see what the value will be).
3030
*
31-
* Ben Herrenschmidt reports that on PPC, the C version comes close
32-
* to the optimized asm with this (ie on PPC you don't want that
33-
* 'volatile', since there are lots of registers).
34-
*
3531
* On ARM we get the best code generation by forcing a full memory barrier
3632
* between each SHA_ROUND, otherwise gcc happily get wild with spilling and
3733
* the stack frame size simply explode and performance goes down the drain.

configure.ac

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,6 @@ AC_MSG_NOTICE([CHECKS for site configuration])
237237
# tests. These tests take up a significant amount of the total test time
238238
# but are not needed unless you plan to talk to SVN repos.
239239
#
240-
# Define PPC_SHA1 environment variable when running make to make use of
241-
# a bundled SHA1 routine optimized for PowerPC.
242-
#
243240
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
244241
#
245242
# Define OPENSSLDIR=/foo/bar if your openssl header and library files are in

hash.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
#include "git-compat-util.h"
55
#include "repository.h"
66

7-
#if defined(SHA1_PPC)
8-
#include "ppc/sha1.h"
9-
#elif defined(SHA1_APPLE)
7+
#if defined(SHA1_APPLE)
108
#include <CommonCrypto/CommonDigest.h>
119
#elif defined(SHA1_OPENSSL)
1210
#include <openssl/sha.h>
@@ -32,7 +30,7 @@
3230
* platform's underlying implementation of SHA-1; could be OpenSSL,
3331
* blk_SHA, Apple CommonCrypto, etc... Note that the relevant
3432
* SHA-1 header may have already defined platform_SHA_CTX for our
35-
* own implementations like block-sha1 and ppc-sha1, so we list
33+
* own implementations like block-sha1, so we list
3634
* the default for OpenSSL compatible SHA-1 implementations here.
3735
*/
3836
#define platform_SHA_CTX SHA_CTX

ppc/sha1.c

Lines changed: 0 additions & 72 deletions
This file was deleted.

ppc/sha1.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)