Skip to content

Commit 6aaf49b

Browse files
cdleonardherbertx
authored andcommitted
crypto: arm,arm64 - Fix random regeneration of S_shipped
The decision to rebuild .S_shipped is made based on the relative timestamps of .S_shipped and .pl files but git makes this essentially random. This means that the perl script might run anyway (usually at most once per checkout), defeating the whole purpose of _shipped. Fix by skipping the rule unless explicit make variables are provided: REGENERATE_ARM_CRYPTO or REGENERATE_ARM64_CRYPTO. This can produce nasty occasional build failures downstream, for example for toolchains with broken perl. The solution is minimally intrusive to make it easier to push into stable. Another report on a similar issue here: https://lkml.org/lkml/2018/3/8/1379 Signed-off-by: Leonard Crestez <[email protected]> Cc: <[email protected]> Reviewed-by: Masahiro Yamada <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent eb428ee commit 6aaf49b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

arch/arm/crypto/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ crc32-arm-ce-y:= crc32-ce-core.o crc32-ce-glue.o
5656
chacha20-neon-y := chacha20-neon-core.o chacha20-neon-glue.o
5757
speck-neon-y := speck-neon-core.o speck-neon-glue.o
5858

59+
ifdef REGENERATE_ARM_CRYPTO
5960
quiet_cmd_perl = PERL $@
6061
cmd_perl = $(PERL) $(<) > $(@)
6162

@@ -64,5 +65,6 @@ $(src)/sha256-core.S_shipped: $(src)/sha256-armv4.pl
6465

6566
$(src)/sha512-core.S_shipped: $(src)/sha512-armv4.pl
6667
$(call cmd,perl)
68+
endif
6769

6870
.PRECIOUS: $(obj)/sha256-core.S $(obj)/sha512-core.S

arch/arm64/crypto/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ CFLAGS_aes-glue-ce.o := -DUSE_V8_CRYPTO_EXTENSIONS
6767
$(obj)/aes-glue-%.o: $(src)/aes-glue.c FORCE
6868
$(call if_changed_rule,cc_o_c)
6969

70+
ifdef REGENERATE_ARM64_CRYPTO
7071
quiet_cmd_perlasm = PERLASM $@
7172
cmd_perlasm = $(PERL) $(<) void $(@)
7273

@@ -75,5 +76,6 @@ $(src)/sha256-core.S_shipped: $(src)/sha512-armv8.pl
7576

7677
$(src)/sha512-core.S_shipped: $(src)/sha512-armv8.pl
7778
$(call cmd,perlasm)
79+
endif
7880

7981
.PRECIOUS: $(obj)/sha256-core.S $(obj)/sha512-core.S

0 commit comments

Comments
 (0)