summaryrefslogtreecommitdiff
path: root/user/z3/_trailing_zeros32.patch
diff options
context:
space:
mode:
authorMax Rees <maxcrees@me.com>2020-06-15 21:54:20 -0500
committerMax Rees <maxcrees@me.com>2020-06-16 15:41:03 -0500
commitbf59364ccef65000e448eaae4791efc630e10a09 (patch)
treeba3edef7d43cffc5577250a8e9f93148e44d8763 /user/z3/_trailing_zeros32.patch
parentb638af19ae2d31c0e9eff1d9c70197cd14180ac8 (diff)
downloadpackages-bf59364ccef65000e448eaae4791efc630e10a09.tar.gz
packages-bf59364ccef65000e448eaae4791efc630e10a09.tar.bz2
packages-bf59364ccef65000e448eaae4791efc630e10a09.tar.xz
packages-bf59364ccef65000e448eaae4791efc630e10a09.zip
user/z3: fix build on 32-bit arches
../src/util/mpz.cpp:57:30: error: definition of ‘uint32_t __builtin_ctz(uint32_t)’ ambiguates built-in declaration ‘int __builtin_ctz(unsigned int)’ #define _trailing_zeros32(X) __builtin_ctz(X) ^~~~~~~~~~~~~ ../src/util/mpz.cpp:76:17: note: in expansion of macro ‘_trailing_zeros32’ inline uint32_t _trailing_zeros32(uint32_t x) { ^~~~~~~~~~~~~~~~~ make: *** [Makefile:216: util/mpz.o] Error 1 make: *** Waiting for unfinished jobs.... make: Leaving directory '/af/build/user/z3/src/z3-z3-4.8.7/build' >>> ERROR: z3: build failed Upstream issues: https://github.com/Z3Prover/z3/issues/2727 https://github.com/Z3Prover/z3/issues/2776
Diffstat (limited to 'user/z3/_trailing_zeros32.patch')
-rw-r--r--user/z3/_trailing_zeros32.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/user/z3/_trailing_zeros32.patch b/user/z3/_trailing_zeros32.patch
new file mode 100644
index 000000000..05b977f51
--- /dev/null
+++ b/user/z3/_trailing_zeros32.patch
@@ -0,0 +1,23 @@
+From e212159f4e941c78fc03239e0884f2f0454f581f Mon Sep 17 00:00:00 2001
+From: Nikolaj Bjorner <nbjorner@microsoft.com>
+Date: Wed, 20 Nov 2019 15:01:04 -0800
+Subject: [PATCH] fix #2727
+
+Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
+---
+ src/util/mpz.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/util/mpz.cpp b/src/util/mpz.cpp
+index a8190df1b0..9c2d3d5ffb 100644
+--- a/src/util/mpz.cpp
++++ b/src/util/mpz.cpp
+@@ -72,6 +72,8 @@ inline uint64_t _trailing_zeros64(uint64_t x) {
+
+ #if defined(_WINDOWS) && !defined(_M_ARM) && !defined(_M_ARM64)
+ // _trailing_zeros32 already defined using intrinsics
++#elif defined(__GNUC__)
++// _trailing_zeros32 already defined using intrinsics
+ #else
+ inline uint32_t _trailing_zeros32(uint32_t x) {
+ uint32_t r = 0;