summaryrefslogtreecommitdiffstats
path: root/net/samba4/patches/104-fix-build-on-aarch64-and-riscv64.patch
blob: c6b2b8f8be3e999833e253438e1f70ee22e11340 (plain)
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
From da434dc13dc6c7b0dc1cec13737e5d2d472d5d65 Mon Sep 17 00:00:00 2001
From: John Audia <therealgraysky@proton.me>
Date: Wed, 18 Jun 2025 02:06:00 +0000
Subject: [PATCH] Fix build on aarch64 and riscv64

For aarch64 and risc64, the discard_const macro is used to remove const
qualifiers from string literals, but casting a string literal’s address
to uintptr_t and then to void * is not a constant expression in some
compilers or environments e.g. the musl libc and aarch64/risc64
combination seems to enforce stricter rules for constant initializers or
pointer/integer size handling compared to glibc-based systems.

Signed-off-by: John Audia <therealgraysky@proton.me>
---
--- a/lib/ldb/tests/test_ldb_comparison_fold.c
+++ b/lib/ldb/tests/test_ldb_comparison_fold.c
@@ -53,7 +53,7 @@ struct ranked_value {
 	int rank;
 };
 
-#define STR_VAL(s, r) { { discard_const(s), sizeof(s) - 1 }, r}
+#define STR_VAL(s, r) { { (void *)s, sizeof(s) - 1 }, r}
 
 static const struct ranked_value values_common[] = {
 	STR_VAL("", 0),