From d59ee314a89863fa06f91eb59b2211585f3ebac9 Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Fri, 16 Jun 2017 21:05:46 +0000 Subject: [PATCH] [arm] Update t-rtems for new option framework [This patch has only been fairly lightly tested (I've built a compiler with all the relevant multilibs and smoke-tested a few combinations to check that the tools still produce a sensible object file).] This patch updates the RTEMS build to use the new option framework. It tries as far as possible to keep the existing supported options, but there are two necessary changes and one cleanup. I've also restructed the file slightly to make it slightly easier (IMO) to understand. Necessary changes: 1: ARMv4t does not support a hard-float ABI, the earliest supported architecture with floating-point support is ARMv5te, so I've rebased the original fpu/hard libraries to that revision of the architecture. 2: Similarly, the earliest version of the -m profile to support hardware floating-point is armv7e-m (not armv7-m), so the base architecture for m-profile with FP has been correspondingly updated. Clean-up: 1: For greater consistency I've changed the -mcpu=cortex-m7/-mfpu=fpv5-d16/-mhard-float to -march=armv7e-m+fp.dp/-mhard-float. The built-in -mcpu rewrite rules take care of mapping the existing option sets onto the architecture string to ensure compatibility. Since the existing rule set does not contain any MULTILIB_REUSE rules, I have not added any here this time around, but it would be worth the maintainers of this file considering whether adding some rules would make their toolchain more friendly to users. Finally, I've added lines to reset all the multilib variables at the head of the file. I found during testing that some definitions from t-arm-elf were leaking through and causing unexpected behviour. * config/arm/t-rtems: Rewrite for new option framework. From-SVN: r249301 --- gcc/ChangeLog | 4 ++++ gcc/config/arm/t-rtems | 49 +++++++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 730d7e96d66..f603df53075 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2017-06-16 Richard Earnshaw + + * config/arm/t-rtems: Rewrite for new option framework. + 2017-06-16 Richard Earnshaw * config/arm/t-aprofile (v7_a_nosimd_variants, v7_a_simd_variants) diff --git a/gcc/config/arm/t-rtems b/gcc/config/arm/t-rtems index 026a5895662..c07378657c8 100644 --- a/gcc/config/arm/t-rtems +++ b/gcc/config/arm/t-rtems @@ -1,22 +1,37 @@ # Custom RTEMS multilibs for ARM -MULTILIB_OPTIONS = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m/mcpu=cortex-m7 mfpu=neon/mfpu=vfp/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16/mfpu=fpv5-d16 mfloat-abi=hard -MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m cortex-m7 neon vfp vfpv3-d16 fpv4-sp-d16 fpv5-d16 hard +# Reset all MULTILIB variables + +MULTILIB_OPTIONS = +MULTILIB_DIRNAMES = +MULTILIB_EXCEPTIONS = +MULTILIB_REUSE = +MULTILIB_MATCHES = +MULTILIB_REQUIRED = # Enumeration of multilibs -MULTILIB_EXCEPTIONS = - -MULTILIB_REQUIRED = -MULTILIB_REQUIRED += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard -MULTILIB_REQUIRED += mbig-endian/mthumb/march=armv7-r -MULTILIB_REQUIRED += mfpu=vfp/mfloat-abi=hard -MULTILIB_REQUIRED += mthumb/march=armv6-m -MULTILIB_REQUIRED += mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard -MULTILIB_REQUIRED += mthumb/march=armv7-a -MULTILIB_REQUIRED += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard -MULTILIB_REQUIRED += mthumb/march=armv7-r -MULTILIB_REQUIRED += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard -MULTILIB_REQUIRED += mthumb/mcpu=cortex-m7/mfpu=fpv5-d16/mfloat-abi=hard -MULTILIB_REQUIRED += mthumb/march=armv7-m -MULTILIB_REQUIRED += mthumb +MULTILIB_OPTIONS += mbig-endian +MULTILIB_DIRNAMES += eb + +MULTILIB_OPTIONS += mthumb +MULTILIB_DIRNAMES += thumb + +MULTILIB_OPTIONS += march=armv5te+fp/march=armv6-m/march=armv7-a/march=armv7-a+simd/march=armv7-r/march=armv7-r+fp/march=armv7-m/march=armv7e-m+fp/march=armv7e-m+fp.dp +MULTILIB_DIRNAMES += armv5te+fp armv6-m armv7-a armv7-a+simd armv7-r armv7-r+fp armv7-m armv7e-m+fp armv7e-m+fp.dp + +MULTILIB_OPTIONS += mfloat-abi=hard +MULTILIB_DIRNAMES += hard + +MULTILIB_REQUIRED += mbig-endian/mthumb/march=armv7-r+fp/mfloat-abi=hard +MULTILIB_REQUIRED += mbig-endian/mthumb/march=armv7-r +MULTILIB_REQUIRED += march=armv5te+fp/mfloat-abi=hard +MULTILIB_REQUIRED += mthumb/march=armv6-m +MULTILIB_REQUIRED += mthumb/march=armv7-a+simd/mfloat-abi=hard +MULTILIB_REQUIRED += mthumb/march=armv7-a +MULTILIB_REQUIRED += mthumb/march=armv7-r+fp/mfloat-abi=hard +MULTILIB_REQUIRED += mthumb/march=armv7-r +MULTILIB_REQUIRED += mthumb/march=armv7e-m+fp/mfloat-abi=hard +MULTILIB_REQUIRED += mthumb/march=armv7e-m+fp.dp/mfloat-abi=hard +MULTILIB_REQUIRED += mthumb/march=armv7-m +MULTILIB_REQUIRED += mthumb -- 2.30.2