mirror of
git://git.musl-libc.org/musl
synced 2025-01-18 04:41:24 +00:00
work around regression building for armhf with clang (compiler bug)
commit e4355bd6be
moved the math asm
from external source files to inline asm, but unfortunately, all
current releases of clang use the wrong inline asm constraint codes
for float and double ("w" and "P" instead of "t" and "w",
respectively). this patch adds detection for the bug in configure,
and, for now, just disables the affected asm on broken clang versions.
This commit is contained in:
parent
ed97dfd979
commit
71c334f951
14
configure
vendored
14
configure
vendored
@ -588,6 +588,20 @@ fi
|
||||
if test "$ARCH" = "arm" ; then
|
||||
trycppif __ARMEB__ "$t" && SUBARCH=${SUBARCH}eb
|
||||
trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf
|
||||
# Versions of clang up until at least 3.8 have the wrong constraint codes
|
||||
# for floating point operands to inline asm. Detect this so the affected
|
||||
# source files can just disable the asm.
|
||||
if test "$cc_family" = clang ; then
|
||||
printf "checking whether clang's vfp asm constraints work... "
|
||||
echo 'float f(float x) { __asm__("":"+t"(x)); return x; }' > "$tmpc"
|
||||
if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
|
||||
printf "yes\n"
|
||||
else
|
||||
printf "no\n"
|
||||
CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_VFP_ASM"
|
||||
CFLAGS_AUTO="${CFLAGS_AUTO# }"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ARCH" = "aarch64" ; then
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <math.h>
|
||||
|
||||
#if __ARM_PCS_VFP
|
||||
#if __ARM_PCS_VFP && !BROKEN_VFP_ASM
|
||||
|
||||
float fabsf(float x)
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <math.h>
|
||||
|
||||
#if __ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__)
|
||||
#if (__ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__)) && !BROKEN_VFP_ASM
|
||||
|
||||
float sqrtf(float x)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user