all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 9fe78cb0bed74bb387134f5275ef71eea8c1be02 1997 bytes (raw)
name: gnu/packages/patches/busybox-add-missing-sha-NI-guard.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 
from https://lists.busybox.net/pipermail/busybox/2024-September/090899.html

The ENABLE_SHA1_HWACCEL Kconfig symbol is meant to be archicture
agnostic, so can be enabled regardless of whether your build
architecture provides hardware acceleration or not.
 At the moment only
x86 implements this, so every piece of optimised code should be guarded
by both ENABLE_SHA1_HWACCEL and (__x86_64__ || __i386__).
 This is missing
at one place, so compiling for arm64 breaks when ENABLE_SHA1_HWACCEL is
enabled:
================================
libbb/hash_md5_sha.c: In function ‘sha1_end’:
libbb/hash_md5_sha.c:1316:28: error: ‘sha1_process_block64_shaNI’ undeclared (first use in this function); did you mean ‘sha1_process_block64’?

 1316 |   || ctx->process_block == sha1_process_block64_shaNI
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            sha1_process_block64
libbb/hash_md5_sha.c:1316:28: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [scripts/Makefile.build:197: libbb/hash_md5_sha.o] Error 1
make: *** [Makefile:744: libbb] Error 2
================================

Add the missing guards around the call to sha1_process_block64_shaNI to
fix the build on other architectures with ENABLE_SHA1_HWACCEL enabled.

Change-Id: I40bba388422625f4230abf15a5de23e1fdc654fc
Signed-off-by: Andre Przywara <andre.przywara at arm.com>
---
 libbb/hash_md5_sha.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libbb/hash_md5_sha.c b/libbb/hash_md5_sha.c
index 57a801459..75a61c32c 100644
--- a/libbb/hash_md5_sha.c
+++ b/libbb/hash_md5_sha.c
@@ -1313,7 +1313,9 @@ unsigned FAST_FUNC sha1_end(sha1_ctx_t *ctx, void *resbuf)
 	hash_size = 8;
 	if (ctx->process_block == sha1_process_block64
 #if ENABLE_SHA1_HWACCEL
+# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
 	 || ctx->process_block == sha1_process_block64_shaNI
+# endif
 #endif
 	) {
 		hash_size = 5;
-- 
2.25.1

debug log:

solving 9fe78cb0bed ...
found 9fe78cb0bed in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.