Recent gcc versions define __ARM_PCS or __ARM_PCS_VFP to indicate the
VFP ABI in use, and ARM RVCT defines __SOFTFP__ when using this ABI.
If none of these are defined, check $cross_prefix and $cc for the
substring "hardfloat", and finally fall back to a linker test. This
gives the correct result in most configurations.
... | ... |
@@ -2526,10 +2526,18 @@ elif enabled arm; then |
2526 | 2526 |
check_cflags -marm |
2527 | 2527 |
nogas=die |
2528 | 2528 |
|
2529 |
- check_ld <<EOF && enable vfp_args |
|
2529 |
+ if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then |
|
2530 |
+ enable vfp_args |
|
2531 |
+ elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then |
|
2532 |
+ case "${cross_prefix:-$cc}" in |
|
2533 |
+ *hardfloat*) enable vfp_args; fpabi=vfp ;; |
|
2534 |
+ *) check_ld <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;; |
|
2530 | 2535 |
__asm__ (".eabi_attribute 28, 1"); |
2531 | 2536 |
int main(void) { return 0; } |
2532 | 2537 |
EOF |
2538 |
+ esac |
|
2539 |
+ warn "Compiler does not indicate floating-point ABI, guessing $fpabi." |
|
2540 |
+ fi |
|
2533 | 2541 |
|
2534 | 2542 |
# We have to check if pld is a nop and disable it. |
2535 | 2543 |
check_asm pld '"pld [r0]"' |