diff mbox series

[13/30,arm] Force a CPU default in the config args defaults list.

Message ID d4b5044029af8a88f5e0e4116820a56472217bca.1497004220.git.Richard.Earnshaw@arm.com
State New
Headers show
Series Reworking the -mcpu, -march and -mfpu options | expand

Commit Message

Richard Earnshaw (lists) June 9, 2017, 12:53 p.m. UTC
Currently if the user does not specify a default CPU or architecture
the compiler provieds no default values in the spec defaults.  We can
try to work from TARGET_CPU_DEFAULT but pulling that into the driver
is a bit crufty and doesn't really work well with the general
spec-processing model.  A better way is to ensure that with_cpu is
always set appropirately during configure.  To avoid problems with the
multilib fragment processing we defer this until after we have
processed any required fragments before selecting the default.

	* config.gcc (arm*-*-*): Ensure both target_cpu_cname and with_cpu
	are set after handling multilib fragments.  Set target_cpu_default2
	from with_cpu.
---
 gcc/config.gcc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 4d0f7ec..8524a5f 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3859,6 +3859,8 @@  case "${target}" in
 				TM_MULTILIB_CONFIG="$with_multilib_list"
 			fi
 		fi
+		target_cpu_cname=${target_cpu_cname:-arm6}
+		with_cpu=${with_cpu:-$target_cpu_cname}
 		;;
 
 	fr*-*-*linux*)
@@ -4492,11 +4494,12 @@  case ${target} in
 		;;
 
 	arm*-*-*)
-		if test x$target_cpu_cname = x
+		if test x$with_cpu = x
 		then
-			target_cpu_default2="\\\"arm6\\\""
+			echo "Don't know the target cpu" 1>&2
+			exit 1
 		else
-			target_cpu_default2="\\\"$target_cpu_cname\\\""
+			target_cpu_default2="\\\"$with_cpu\\\""
 		fi
 		;;