diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-03-21 22:00:38 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-03-22 09:12:40 -0700 |
commit | 05f092079853d0444af227edc6e4c91a4d374ee7 (patch) | |
tree | bdbe8a0dac1f137453f48ac6f8be5c9063dabd2a | |
parent | c9136de654419d9b13871500a96e8744059b4020 (diff) | |
download | meta-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.bb | 1 | ||||
-rw-r--r-- | meta-oe/recipes-test/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch | 43 |
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" | |||
9 | SRCREV = "a01cc69ee9536f90e57c61a198f2d1944d3d4313" | 9 | SRCREV = "a01cc69ee9536f90e57c61a198f2d1944d3d4313" |
10 | PV .= "+git${SRCPV}" | 10 | PV .= "+git${SRCPV}" |
11 | SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=stable-1.1 \ | 11 | SRC_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 @@ | |||
1 | From a54e035f802e79e3292d8ad39a14bd7c060eb7b1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Breno Leitao <breno.leitao@gmail.com> | ||
3 | Date: Tue, 21 Mar 2023 21:58:28 -0700 | ||
4 | Subject: [PATCH] include: Check for previous declaration of uintptr_t | ||
5 | |||
6 | Adding a extra check before declaring uintptr_t. Currently musl uses | ||
7 | macro __DEFINED_uintptr_t once it defines uintptr_t type. Checking | ||
8 | this macro before defining it, and, defining it when uintptr_t is | ||
9 | defined. | ||
10 | |||
11 | Taken from Alpine | ||
12 | |||
13 | Upstream-Status: Pending | ||
14 | Signed-off-by: Breno Leitao <breno.leitao@gmail.com> | ||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | include/cmocka.h | 3 ++- | ||
18 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/include/cmocka.h b/include/cmocka.h | ||
21 | index 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 | -- | ||
42 | 2.40.0 | ||
43 | |||