summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-03-21 22:00:38 -0700
committerKhem Raj <raj.khem@gmail.com>2023-03-22 09:12:40 -0700
commit05f092079853d0444af227edc6e4c91a4d374ee7 (patch)
treebdbe8a0dac1f137453f48ac6f8be5c9063dabd2a
parentc9136de654419d9b13871500a96e8744059b4020 (diff)
downloadmeta-openembedded-05f092079853d0444af227edc6e4c91a4d374ee7.tar.gz
cmocka: Check for previous declaration of uintptr_t
Fix build with musl/aarch64 Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-test/cmocka/cmocka_1.1.7.bb1
-rw-r--r--meta-oe/recipes-test/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch43
2 files changed, 44 insertions, 0 deletions
diff --git a/meta-oe/recipes-test/cmocka/cmocka_1.1.7.bb b/meta-oe/recipes-test/cmocka/cmocka_1.1.7.bb
index 308d5ca1f..44077a0d3 100644
--- a/meta-oe/recipes-test/cmocka/cmocka_1.1.7.bb
+++ b/meta-oe/recipes-test/cmocka/cmocka_1.1.7.bb
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
9SRCREV = "a01cc69ee9536f90e57c61a198f2d1944d3d4313" 9SRCREV = "a01cc69ee9536f90e57c61a198f2d1944d3d4313"
10PV .= "+git${SRCPV}" 10PV .= "+git${SRCPV}"
11SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=stable-1.1 \ 11SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=stable-1.1 \
12 file://0001-include-Check-for-previous-declaration-of-uintptr_t.patch \
12 file://run-ptest \ 13 file://run-ptest \
13 " 14 "
14 15
diff --git a/meta-oe/recipes-test/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch b/meta-oe/recipes-test/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch
new file mode 100644
index 000000000..65d30ea99
--- /dev/null
+++ b/meta-oe/recipes-test/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch
@@ -0,0 +1,43 @@
1From a54e035f802e79e3292d8ad39a14bd7c060eb7b1 Mon Sep 17 00:00:00 2001
2From: Breno Leitao <breno.leitao@gmail.com>
3Date: Tue, 21 Mar 2023 21:58:28 -0700
4Subject: [PATCH] include: Check for previous declaration of uintptr_t
5
6Adding a extra check before declaring uintptr_t. Currently musl uses
7macro __DEFINED_uintptr_t once it defines uintptr_t type. Checking
8this macro before defining it, and, defining it when uintptr_t is
9defined.
10
11Taken from Alpine
12
13Upstream-Status: Pending
14Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 include/cmocka.h | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20diff --git a/include/cmocka.h b/include/cmocka.h
21index a21d965..f540793 100644
22--- a/include/cmocka.h
23+++ b/include/cmocka.h
24@@ -121,7 +121,7 @@ typedef uintmax_t LargestIntegralType;
25 ((LargestIntegralType)(value))
26
27 /* Smallest integral type capable of holding a pointer. */
28-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T)
29+#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T) && !defined(__DEFINED_uintptr_t)
30 # if defined(_WIN32)
31 /* WIN32 is an ILP32 platform */
32 typedef unsigned int uintptr_t;
33@@ -147,6 +147,7 @@ typedef uintmax_t LargestIntegralType;
34
35 # define _UINTPTR_T
36 # define _UINTPTR_T_DEFINED
37+# define __DEFINED_uintptr_t
38 #endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
39
40 /* Perform an unsigned cast to uintptr_t. */
41--
422.40.0
43