Commit 045fc2ea authored by Timo Teräs's avatar Timo Teräs

main/cmocka: fix wordsize detection universally on musl, enable aarch64

parent 225ac308
......@@ -2,16 +2,16 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=cmocka
pkgver=1.1.1
pkgrel=0
pkgrel=1
pkgdesc="An elegant unit testing framework for C with support for mock objects"
url="https://cmocka.org/"
arch="all !aarch64"
arch="all"
license="ASL-2.0"
depends=""
makedepends="cmake"
subpackages="$pkgname-dev"
source="https://cmocka.org/files/${pkgver%.*}/$pkgname-$pkgver.tar.xz
s390x_wordsize.patch
wordsize.patch
musl_uintptr.patch"
builddir="$srcdir/$pkgname-$pkgver"
......@@ -49,5 +49,5 @@ package() {
}
sha512sums="801c4a3e1bb9047241b1cb5a90c1cbdee1b0aff5e3d0a84ec8b2dbaee79274618c24fbe5e9fedbf0b3ee18c6c98b55d93e135d037ac33ab872edc7665af41577 cmocka-1.1.1.tar.xz
f7db110909662dc1a185d09d1f00aef967eee99753f6929b1f0794422c1ca38f4a3643f39960813355b7da155f96325a30dfbe66ac6f19e55967a241a0e923de s390x_wordsize.patch
16dfd8e6e2b21bda549a31cae0e60405039ff3559c879bc35811b55b06d64dcc75402d6a0cb89d029d69faeaa6484329ce03788feb9e69c1a844e63ac8d21f69 wordsize.patch
b20b5c0d172a9df756ec093a3df4bf5bdf2a0c06a3d3ad39ec001248ccb86e6fd3dcedfc9ce42e8309cc01ea34fadffd4ebcc0fb3af9f5e795e7fe40c461ac60 musl_uintptr.patch"
diff --git a/include/cmocka.h b/include/cmocka.h
index bfcdd3f..60467b9 100644
--- a/include/cmocka.h
+++ b/include/cmocka.h
@@ -56,7 +56,7 @@ int __stdcall IsDebuggerPresent();
/* If __WORDSIZE is not set, try to figure it out and default to 32 bit. */
#ifndef __WORDSIZE
-# if defined(__x86_64__) && !defined(__ILP32__)
+# if ( defined(__x86_64__) && !defined(__ILP32__) ) || defined(__s390x__)
# define __WORDSIZE 64
# else
# define __WORDSIZE 32
musl defines __WORDSIZE in bits/reg.h so include that. Also
error out on if it's not defined, otherwise we might get wrong
assumption which causes weird failures.
--- cmocka-1.1.1.orig/include/cmocka.h
+++ cmocka-1.1.1/include/cmocka.h
@@ -55,12 +55,9 @@
*/
/* If __WORDSIZE is not set, try to figure it out and default to 32 bit. */
+#include <bits/reg.h>
#ifndef __WORDSIZE
-# if defined(__x86_64__) && !defined(__ILP32__)
-# define __WORDSIZE 64
-# else
-# define __WORDSIZE 32
-# endif
+#error __WORDSIZE not defined
#endif
#ifdef DOXYGEN
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment