[arm] Force a CPU default in the config args defaults
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 16 Jun 2017 21:03:55 +0000 (21:03 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Fri, 16 Jun 2017 21:03:55 +0000 (21:03 +0000)
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.

From-SVN: r249291

gcc/ChangeLog
gcc/config.gcc

index 3299cdea1ac603fef7a3acc1bbd7860f9a9e730e..2cb85e8d2ec4b4ad3ffb87e85e15a37fd119de01 100644 (file)
@@ -1,3 +1,9 @@
+2017-06-16  Richard Earnshaw  <rearnsha@arm.com>
+
+       * config.gcc (arm*-*-*): Ensure both target_cpu_cname and with_cpu
+       are set after handling multilib fragments.  Set target_cpu_default2
+       from with_cpu.
+
 2017-06-16  Richard Earnshaw  <rearnsha@arm.com>
 
        * config.gcc (arm*-*-fucshia*): Set target_cpu_cname to the real
index 620a5b2360e69339b48e533441acb36685aa870a..f3923fdfde9e0eb42ab6bdcde05d72a2e98dde3c 100644 (file)
@@ -3861,6 +3861,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*)
@@ -4494,11 +4496,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
                ;;