From 05f092079853d0444af227edc6e4c91a4d374ee7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 21 Mar 2023 22:00:38 -0700 Subject: cmocka: Check for previous declaration of uintptr_t Fix build with musl/aarch64 Signed-off-by: Khem Raj --- meta-oe/recipes-test/cmocka/cmocka_1.1.7.bb | 1 + ...eck-for-previous-declaration-of-uintptr_t.patch | 43 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 meta-oe/recipes-test/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch 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 308d5ca1fb..44077a0d35 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" SRCREV = "a01cc69ee9536f90e57c61a198f2d1944d3d4313" PV .= "+git${SRCPV}" SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=stable-1.1 \ + file://0001-include-Check-for-previous-declaration-of-uintptr_t.patch \ file://run-ptest \ " 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 0000000000..65d30ea993 --- /dev/null +++ b/meta-oe/recipes-test/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch @@ -0,0 +1,43 @@ +From a54e035f802e79e3292d8ad39a14bd7c060eb7b1 Mon Sep 17 00:00:00 2001 +From: Breno Leitao +Date: Tue, 21 Mar 2023 21:58:28 -0700 +Subject: [PATCH] include: Check for previous declaration of uintptr_t + +Adding a extra check before declaring uintptr_t. Currently musl uses +macro __DEFINED_uintptr_t once it defines uintptr_t type. Checking +this macro before defining it, and, defining it when uintptr_t is +defined. + +Taken from Alpine + +Upstream-Status: Pending +Signed-off-by: Breno Leitao +Signed-off-by: Khem Raj +--- + include/cmocka.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/include/cmocka.h b/include/cmocka.h +index a21d965..f540793 100644 +--- a/include/cmocka.h ++++ b/include/cmocka.h +@@ -121,7 +121,7 @@ typedef uintmax_t LargestIntegralType; + ((LargestIntegralType)(value)) + + /* Smallest integral type capable of holding a pointer. */ +-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T) ++#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T) && !defined(__DEFINED_uintptr_t) + # if defined(_WIN32) + /* WIN32 is an ILP32 platform */ + typedef unsigned int uintptr_t; +@@ -147,6 +147,7 @@ typedef uintmax_t LargestIntegralType; + + # define _UINTPTR_T + # define _UINTPTR_T_DEFINED ++# define __DEFINED_uintptr_t + #endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */ + + /* Perform an unsigned cast to uintptr_t. */ +-- +2.40.0 + -- cgit 1.2.3-korg