aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arm/arm.h
diff options
context:
space:
mode:
authorSrinath Parvathaneni <srinath.parvathaneni@arm.com>2021-06-18 13:21:51 +0100
committerSrinath Parvathaneni <srinath.parvathaneni@arm.com>2021-06-18 13:22:02 +0100
commitf58d03b5df25f9eab06b7eacea8da780fc2e0219 (patch)
tree3f9215230806ed15b6bb3ee2c17ef9dc4a8cc954 /gcc/config/arm/arm.h
parentcfa1f8226f275447015e2cb3fb0d876133e6509b (diff)
downloadgcc-f58d03b5df25f9eab06b7eacea8da780fc2e0219.zip
gcc-f58d03b5df25f9eab06b7eacea8da780fc2e0219.tar.gz
gcc-f58d03b5df25f9eab06b7eacea8da780fc2e0219.tar.bz2
arm: Fix multilib mapping for CDE extensions [PR100856].
On passing +cdecp[0-7] extension to the -march string in command line options, multilib linking is failing as mentioned in PR100856. This patch fixes this issue by generating a separate canonical string by removing compiler options which are not required for multilib linking from march string and assign the new string to mlibarch option. This mlibarch string is used for multilib comparison. gcc/ChangeLog: 2021-06-10 Srinath Parvathaneni <srinath.parvathaneni@arm.com> PR target/100856 * common/config/arm/arm-common.c (arm_canon_arch_option_1): New function derived from arm_canon_arch. (arm_canon_arch_option): Call it. (arm_canon_arch_multilib_option): New function. * config/arm/arm-cpus.in (IGNORE_FOR_MULTILIB): New fgroup. * config/arm/arm.h (arm_canon_arch_multilib_option): New prototype. (CANON_ARCH_MULTILIB_SPEC_FUNCTION): New macro. (MULTILIB_ARCH_CANONICAL_SPECS): New macro. (DRIVER_SELF_SPECS): Add MULTILIB_ARCH_CANONICAL_SPECS. * config/arm/arm.opt (mlibarch): New option. * config/arm/t-rmprofile (MULTILIB_MATCHES): For armv8*-m, replace use of march on RHS with mlibarch. gcc/testsuite/ChangeLog: 2021-06-10 Srinath Parvathaneni <srinath.parvathaneni@arm.com> PR target/100856 * gcc.target/arm/acle/pr100856.c: New test. * gcc.target/arm/multilib.exp: Add tests for cde options.
Diffstat (limited to 'gcc/config/arm/arm.h')
-rw-r--r--gcc/config/arm/arm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 8e5bd57..015299c 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -2444,10 +2444,14 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#endif
const char *arm_canon_arch_option (int argc, const char **argv);
+const char *arm_canon_arch_multilib_option (int argc, const char **argv);
#define CANON_ARCH_SPEC_FUNCTION \
{ "canon_arch", arm_canon_arch_option },
+#define CANON_ARCH_MULTILIB_SPEC_FUNCTION \
+ { "canon_arch_multilib", arm_canon_arch_multilib_option },
+
const char *arm_be8_option (int argc, const char **argv);
#define BE8_SPEC_FUNCTION \
{ "be8_linkopt", arm_be8_option },
@@ -2456,6 +2460,7 @@ const char *arm_be8_option (int argc, const char **argv);
MCPU_MTUNE_NATIVE_FUNCTIONS \
ASM_CPU_SPEC_FUNCTIONS \
CANON_ARCH_SPEC_FUNCTION \
+ CANON_ARCH_MULTILIB_SPEC_FUNCTION \
TARGET_MODE_SPEC_FUNCTIONS \
BE8_SPEC_FUNCTION
@@ -2476,12 +2481,22 @@ const char *arm_be8_option (int argc, const char **argv);
" %{mfloat-abi=*: abi %*}" \
" %<march=*) "
+/* Generate a canonical string to represent the architecture selected ignoring
+ the options not required for multilib linking. */
+#define MULTILIB_ARCH_CANONICAL_SPECS \
+ "-mlibarch=%:canon_arch_multilib(%{mcpu=*: cpu %*} " \
+ " %{march=*: arch %*} " \
+ " %{mfpu=*: fpu %*} " \
+ " %{mfloat-abi=*: abi %*}" \
+ " %<mlibarch=*) "
+
/* Complete set of specs for the driver. Commas separate the
individual rules so that any option suppression (%<opt...)is
completed before starting subsequent rules. */
#define DRIVER_SELF_SPECS \
MCPU_MTUNE_NATIVE_SPECS, \
TARGET_MODE_SPECS, \
+ MULTILIB_ARCH_CANONICAL_SPECS, \
ARCH_CANONICAL_SPECS
#define TARGET_SUPPORTS_WIDE_INT 1