You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
math: extend non-glibc guard to Clang and add exp10 guard
The previous fix (#1398) guarded __builtin_roundeven only for GCC 10+,
assuming Clang always lowers it to an inline llvm.roundeven.* intrinsic.
That assumption is wrong: Clang emits a roundeven()/roundevenf() libm
call on targets without a native rounding instruction (x86 without
SSE4.1, powerpc, sparc, i386, etc.). On non-glibc systems (musl,
OpenBSD, FreeBSD, MinGW) the symbol is absent, causing:
undefined reference to 'roundevenf'
Fix: drop the GCC-only restriction and apply the glibc >= 2.25 guard to
all compilers. Non-glibc platforms fall through to the existing portable
inline fallback.
Also guard __builtin_exp10 / __builtin_exp10f: exp10() is a GNU
extension present only in glibc, so the builtin produces the same class
of link error on musl and other non-glibc libcs. The fallback
simde_math_pow(10.0, v) / simde_math_powf(10.0f, v) is already present
and correct.
Reported by brad0 in issue #1396.
0 commit comments