When default-overriding options go in TOOL_OPTIONS, rather than in
site.exp's cflags or multilib_flags, we don't skip multilib.exp, but
those options may still interfere with multilib selection.
Add cpu and fpu resetting-to-default options before multilib options
under test, and set -mfloat-abi to a setting compatible with all
combinations of options under test that don't override it.
Arrange for -mfpu=* and -mfloat-abi=* options to negate each other,
like -march and -mcpu, so that the overridden options are eliminated
early on in prune_options, and don't affect multilib selection with
conflicting choices.
Regstrapped on x86_64-linux-gnu. Also tested with aarch64-elf and
arm-eabi with gcc-15. Ok to install?
for gcc/ChangeLog
* gcc/config/arm/arm.opt (mfloat-abi=, mfpu=): Set Negative.
for gcc/testsuite/ChangeLog
* gcc.target/arm/multilib.exp (check_multi_dir): Prepend
default-resetting options.
---
gcc/config/arm/arm.opt | 4 ++--
gcc/testsuite/gcc.target/arm/multilib.exp | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
index e92a813125260..2a2239245d7b1 100644
--- a/gcc/config/arm/arm.opt
+++ b/gcc/config/arm/arm.opt
@@ -115,7 +115,7 @@ Target Save RejectNegative Negative(mcpu=) ToLower Joined
Var(arm_cpu_string)
Specify the name of the target CPU.
mfloat-abi=
-Target RejectNegative Joined Enum(float_abi_type) Var(arm_float_abi)
Init(TARGET_DEFAULT_FLOAT_ABI)
+Target RejectNegative Negative(mfloat-abi=) Joined Enum(float_abi_type)
Var(arm_float_abi) Init(TARGET_DEFAULT_FLOAT_ABI)
Specify if floating point hardware should be used.
mcmse
@@ -157,7 +157,7 @@ EnumValue
Enum(arm_fp16_format_type) String(alternative)
Value(ARM_FP16_FORMAT_ALTERNATIVE)
mfpu=
-Target RejectNegative Joined Enum(arm_fpu) Var(arm_fpu_index)
Init(TARGET_FPU_auto) Save
+Target RejectNegative Negative(mfpu=) Joined Enum(arm_fpu) Var(arm_fpu_index)
Init(TARGET_FPU_auto) Save
Specify the name of the target floating point hardware/format.
mhard-float
diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp
b/gcc/testsuite/gcc.target/arm/multilib.exp
index b824173e79875..ea9baf4b01579 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -42,7 +42,9 @@ proc multilib_config {profile} {
proc check_multi_dir { gcc_opts multi_dir } {
global tool
- set options [list "additional_flags=[concat "--print-multi-directory"
$gcc_opts]"]
+ # Restore CPU, FPU and ABI defaults so that even if TOOL_OPTIONS
+ # set them, that won't affect our testing.
+ set options [list "additional_flags=[concat "--print-multi-directory
-mcpu=unset -mfpu=auto -mfloat-abi=soft" $gcc_opts]"]
set gcc_output [${tool}_target_compile "" "" "none" $options]
if { [string match "$multi_dir\n" $gcc_output] } {
pass "multilibdir $gcc_opts $multi_dir"
--
Alexandre Oliva, happy hacker https://blog.lx.oliva.nom.br/
Free Software Activist FSFLA co-founder GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!