From: Rich Felker Date: Fri, 16 Aug 2013 21:09:07 +0000 (-0400) Subject: fix detection of arm hardfloat X-Git-Tag: v0.9.13~44 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4918c2bb206bfaaf5a1f7d3448c2f63d5e2b7d56;p=oweals%2Fmusl.git fix detection of arm hardfloat it turns out that __SOFTFP__ does not indicate the ABI in use but rather that fpu instructions are not to be used at all. this is specified in ARM's documentation so I'm unclear on how I previously got the wrong idea. unfortunately, this resulted in the 0.9.12 release producing a dynamic linker with the wrong name. fortunately, there do not yet seem to be any public toolchain builds using the wrong name. the __ARM_PCS_VFP macro does not seem to be official from ARM, and in fact it was missing from the very earliest gcc versions (around 4.5.x) that added -mfloat-abi=hard. it would be possible on such versions to perform some ugly linker-based tests instead in hopes that the linker will reject ABI-mismatching object files, if there is demand for supporting such versions. I would probably prefer to document which versions are broken and warn users to manually add -D__ARM_PCS_VFP if using such a version. there's definitely an argument to be made that the fenv macros should be exposed even in -mfloat-abi=softfp mode. for now, I have chosen not to expose them in this case, since the math library will not necessarily have the capability to raise exceptions (it depends on the CFLAGS used to compile it), and since exceptions are officially excluded from the ARM EABI, which the plain "arm" arch aims to follow. --- diff --git a/arch/arm/bits/fenv.h b/arch/arm/bits/fenv.h index 1d990221..d85fc86d 100644 --- a/arch/arm/bits/fenv.h +++ b/arch/arm/bits/fenv.h @@ -1,4 +1,4 @@ -#ifdef __SOFTFP__ +#ifndef __ARM_PCS_VFP #define FE_ALL_EXCEPT 0 #define FE_TONEAREST 0 #else diff --git a/configure b/configure index 7aae7d4d..949fb03d 100755 --- a/configure +++ b/configure @@ -381,7 +381,7 @@ t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS_AUTO $CFLAGS" if test "$ARCH" = "arm" ; then trycppif __ARMEB__ "$t" && SUBARCH=${SUBARCH}eb -trycppif __SOFTFP__ "$t" || SUBARCH=${SUBARCH}hf +trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf fi test "$ARCH" = "mips" && trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" \