summaryrefslogtreecommitdiff
path: root/gcc/common
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2021-09-21 11:14:46 +0100
committerRichard Earnshaw <rearnsha@arm.com>2021-09-21 11:20:37 +0100
commit4e7a92c0ff3871d955ca8fb133f869b216d7224d (patch)
treeac7903abe5b4ca3934ecbd4f8c9059ca990afb6b /gcc/common
parent55b989de7679a486ad674fb154408de26ac96467 (diff)
downloadgcc-4e7a92c0ff3871d955ca8fb133f869b216d7224d.tar.gz
arm: pass architecture extensions to assembler if supported
When I originally added the new extended architecture features support to GCC, the assembler was unable to parse the new feature lists on the command-line and would throw an error. This has now been fixed in GAS and the behaviour is the same as GCC. So this patch adds a configure-time test for the assembler in use to detect that it is recent enough to support this behaviour and then enables passing the architecture extensions to the assembler when this is the case. Although the assembly output generated by GCC does not rely on this, this should ease some issues when using GCC as a driver for compiling source written directly in assembly language when the programmer was expecting the appropriate options to be passed on the command line. gcc/ChangeLog: * configure.ac: Detect when the assembler supports new-style architecture extensions. * common/config/arm/arm-common.c (arm_rewrite_mcpu): Return the full CPU string if the assembler can grok it. (arm_rewrite_march): Likewise but for the architecture. * config.in: Regenerate. * configure: Regenerate.
Diffstat (limited to 'gcc/common')
-rw-r--r--gcc/common/config/arm/arm-common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c
index 481aa9e43d9..de898a74165 100644
--- a/gcc/common/config/arm/arm-common.c
+++ b/gcc/common/config/arm/arm-common.c
@@ -115,7 +115,12 @@ const char *
arm_rewrite_mcpu (int argc, const char **argv)
{
gcc_assert (argc);
+
+#ifdef HAVE_GAS_ARM_EXTENDED_ARCH
+ return argv[argc - 1];
+#else
return arm_rewrite_selected_cpu (argv[argc - 1]);
+#endif
}
/* Comparator for arm_rewrite_selected_arch. Compare the two arch extension
@@ -223,7 +228,12 @@ const char *
arm_rewrite_march (int argc, const char **argv)
{
gcc_assert (argc);
+
+#ifdef HAVE_GAS_ARM_EXTENDED_ARCH
+ return argv[argc - 1];
+#else
return arm_rewrite_selected_arch (argv[argc - 1]);
+#endif
}
#include "arm-cpu-cdata.h"