From f833e6ee17d1d80aaac3a6bba54c1b0fa20ce27a Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Wed, 21 Dec 2022 12:54:11 +0100 Subject: [PATCH] BLD: Help raspian arm + clang 13 about `__builtin_mul_overflow` It seems on raspian arm with clang 13 `__builtin_mul_overflow` is defined for `int` but doesn't work for `ptrdiff_t` (and maybe others). This checks for `ptrdiff_t` instead of int, which was reported to work-around the issue. Closes gh-22811 --- numpy/core/setup_common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py index 085c0baf5085..d5e75a3ef2ba 100644 --- a/numpy/core/setup_common.py +++ b/numpy/core/setup_common.py @@ -129,7 +129,7 @@ def set_sig(sig): "floor", "ceil", "sqrt", "log10", "log", "exp", "asin", "acos", "atan", "fmod", 'modf', 'frexp', 'ldexp', "expm1", "log1p", "acosh", "asinh", "atanh", - "rint", "trunc", "exp2", + "rint", "trunc", "exp2", "copysign", "nextafter", "strtoll", "strtoull", "cbrt", "log2", "pow", "hypot", "atan2", "csin", "csinh", "ccos", "ccosh", "ctan", "ctanh", @@ -178,7 +178,9 @@ def set_sig(sig): ("__builtin_bswap32", '5u'), ("__builtin_bswap64", '5u'), ("__builtin_expect", '5, 0'), - ("__builtin_mul_overflow", '5, 5, (int*)5'), + # Test `long long` for arm+clang 13 (gh-22811, + # but we use all versions of __builtin_mul_overflow): + ("__builtin_mul_overflow", '(long long)5, 5, (int*)5'), # MMX only needed for icc, but some clangs don't have it ("_m_from_int64", '0', "emmintrin.h"), ("_mm_load_ps", '(float*)0', "xmmintrin.h"), # SSE