On 10/04/2020 14:55, Christophe Lyon via Gcc-patches wrote:
For arm-linux-gnueabi* targets, a toolchain cannot support the
float-abi opposite to the one it has been configured for: since glibc
does not support such multilibs, we end up lacking gnu/stubs-*.h when
including stdint.h for instance.

This patch introduces two new effective targets to detect whether we
can compile tests with -mfloat-abi=softfp or -mfloat-abi=hard.

This enables to make such tests unsupported rather than fail.
Hi Christophe,

LGTM, but you need to wait for maintainer approval.

Cheers,
Andre
2020-04-10  Christophe Lyon  <christophe.l...@linaro.org>

        gcc/testsuite/
        * lib/target-supports.exp (arm_softfp_ok): New effective target.
        (arm_hard_ok): Likewise.
---
  gcc/testsuite/lib/target-supports.exp | 20 ++++++++++++++++++++
  1 file changed, 20 insertions(+)

diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index 3758bb3..6c8dd01 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4739,6 +4739,26 @@ proc check_effective_target_default_branch_protection { 
} {
      return [check_configured_with "enable-standard-branch-protection"]
  }
+# Return 1 if this is an ARM target supporting -mfloat-abi=softfp.
+
+proc check_effective_target_arm_softfp_ok { } {
+    return [check_no_compiler_messages arm_softfp_ok object {
+       #include <stdint.h>
+       int dummy;
+       int main (void) { return 0; }
+       } "-mfloat-abi=softfp"]
+}
+
+# Return 1 if this is an ARM target supporting -mfloat-abi=hard.
+
+proc check_effective_target_arm_hard_ok { } {
+    return [check_no_compiler_messages arm_hard_ok object {
+       #include <stdint.h>
+       int dummy;
+       int main (void) { return 0; }
+       } "-mfloat-abi=hard"]
+}
+
  # Return 1 if the target supports ARMv8.1-M MVE with floating point
  # instructions, 0 otherwise.  The test is valid for ARM.
  # Record the command line options needed.

Reply via email to