diff options
author | Ross Burton <ross.burton@arm.com> | 2025-03-27 21:36:26 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-28 11:19:40 +0000 |
commit | 847f0f2346b8c0cd386a0283a9dbd5c844291729 (patch) | |
tree | ab7cc2488d87a27dc6ee2be02ce61ff2dd0fbbb2 | |
parent | d1f59f72673d08d813f1c6a31389255fa1f4d871 (diff) | |
download | poky-847f0f2346b8c0cd386a0283a9dbd5c844291729.tar.gz |
coreutils: fix cksum on musl
musl has subtly different type definitions to glibc, which broke cksum
under musl. Backport a patch from upstream to fix this.
(From OE-Core rev: b177a9d5676cf0cfbaca3c589c513d7d89a2035c)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/coreutils/coreutils/0001-cksum-port-to-32-bit-uint_fast32_t.patch | 47 | ||||
-rw-r--r-- | meta/recipes-core/coreutils/coreutils_9.6.bb | 1 |
2 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-core/coreutils/coreutils/0001-cksum-port-to-32-bit-uint_fast32_t.patch b/meta/recipes-core/coreutils/coreutils/0001-cksum-port-to-32-bit-uint_fast32_t.patch new file mode 100644 index 0000000000..95d7aca809 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils/0001-cksum-port-to-32-bit-uint_fast32_t.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 7eada35b4fbb48e7fe430d1b18dae7d191f84f8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggert <eggert@cs.ucla.edu> | ||
3 | Date: Mon, 17 Feb 2025 02:27:09 -0800 | ||
4 | Subject: [PATCH 2/2] cksum: port to 32-bit uint_fast32_t | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | * src/cksum_vmull.c (cksum_vmull): Don’t assume | ||
10 | uint_fast32_t can hold 64 bits. | ||
11 | Problem reported by Alyssa Ross (Bug#76360). | ||
12 | |||
13 | Upstream-Status: Backport [7eada35b4fbb48e7fe430d1b18dae7d191f84f8e] | ||
14 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
15 | --- | ||
16 | NEWS | 3 +++ | ||
17 | src/cksum_vmull.c | 7 +++++-- | ||
18 | 2 files changed, 8 insertions(+), 2 deletions(-) | ||
19 | |||
20 | diff --git a/src/cksum_vmull.c b/src/cksum_vmull.c | ||
21 | index 7611c4244..0ff81e225 100644 | ||
22 | --- a/src/cksum_vmull.c | ||
23 | +++ b/src/cksum_vmull.c | ||
24 | @@ -92,7 +92,9 @@ cksum_vmull (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out) | ||
25 | data = bswap_neon (data); | ||
26 | /* XOR in initial CRC value (for us 0 so no effect), or CRC value | ||
27 | calculated for previous BUFLEN buffer from fread */ | ||
28 | - xor_crc = vcombine_u64 (vcreate_u64 (0), vcreate_u64 (crc << 32)); | ||
29 | + | ||
30 | + uint64_t wcrc = crc; | ||
31 | + xor_crc = vcombine_u64 (vcreate_u64 (0), vcreate_u64 (wcrc << 32)); | ||
32 | crc = 0; | ||
33 | data = veorq_u64 (data, xor_crc); | ||
34 | data3 = vld1q_u64 ((uint64_t *) (datap + 1)); | ||
35 | @@ -193,7 +195,8 @@ cksum_vmull (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out) | ||
36 | { | ||
37 | data = vld1q_u64 ((uint64_t *) (datap)); | ||
38 | data = bswap_neon (data); | ||
39 | - xor_crc = vcombine_u64 (vcreate_u64 (0), vcreate_u64 (crc << 32)); | ||
40 | + uint64_t wcrc = crc; | ||
41 | + xor_crc = vcombine_u64 (vcreate_u64 (0), vcreate_u64 (wcrc << 32)); | ||
42 | crc = 0; | ||
43 | data = veorq_u64 (data, xor_crc); | ||
44 | while (bytes_read >= 32) | ||
45 | -- | ||
46 | 2.45.2 | ||
47 | |||
diff --git a/meta/recipes-core/coreutils/coreutils_9.6.bb b/meta/recipes-core/coreutils/coreutils_9.6.bb index d89c75ba66..b876a8fdd0 100644 --- a/meta/recipes-core/coreutils/coreutils_9.6.bb +++ b/meta/recipes-core/coreutils/coreutils_9.6.bb | |||
@@ -18,6 +18,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \ | |||
18 | file://0001-local.mk-fix-cross-compiling-problem.patch \ | 18 | file://0001-local.mk-fix-cross-compiling-problem.patch \ |
19 | file://intermittent-testfailure.patch \ | 19 | file://intermittent-testfailure.patch \ |
20 | file://0001-ls-fix-crash-with-context.patch \ | 20 | file://0001-ls-fix-crash-with-context.patch \ |
21 | file://0001-cksum-port-to-32-bit-uint_fast32_t.patch \ | ||
21 | file://run-ptest \ | 22 | file://run-ptest \ |
22 | " | 23 | " |
23 | SRC_URI[sha256sum] = "7a0124327b398fd9eb1a6abde583389821422c744ffa10734b24f557610d3283" | 24 | SRC_URI[sha256sum] = "7a0124327b398fd9eb1a6abde583389821422c744ffa10734b24f557610d3283" |