This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[AArch64][4.8 backport] Fix default CPU architecture flags


Hi all,

A latent issue was recently exposed in the 4.8 branch. Due to the recently fixed TARGET_FLOAT macro on that branch (r210004), we now hit the bug that the configure-time default architecture flags do not include FP and SIMD even though the default cpu target mandates them in aarch64-arches.def. The issue appears when trying to build gcc without any --with-cpu or --with-arch flags.


My patch to fix that issue for trunk (then 4.9) was posted at
http://gcc.gnu.org/ml/gcc-patches/2014-02/msg01487.html but was not backported to 4.8

This patch is a backport of the config.gcc change for that. This fixes the build by properly using the architecture flags in aarch64-arches.def when configuring gcc.

Ok to propose upstream for backport?

Tested aarch64-none-elf built with various combinations of --with-cpu and --with-arch. Note, this fixes a build error when no --with-cpu or --with-arch is given on the configure line. That variation has been tested as well.

Ok to commit to the 4.8 branch?

Thanks,
Kyrill

2014-05-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * config.gcc (aarch64*-*-*): Use ISA flags from aarch64-arches.def.
    Do not define target_cpu_default2 to generic.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index a4fb77d..2b54dd9 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3150,6 +3150,11 @@ case "${target}" in
 				  ${srcdir}/config/aarch64/$def | \
 				  sed -e 's/^[^,]*,[ 	]*//' | \
 				  sed -e 's/,.*$//'`
+				# Extract the architecture flags from aarch64-arches.def
+				ext_mask=`grep "^$pattern(\"$base_val\"," \
+				   ${srcdir}/config/aarch64/$def | \
+				   sed -e 's/)$//' | \
+				   sed -e 's/^.*,//'`
 			  else
 				base_id=`grep "^$pattern(\"$base_val\"," \
 				  ${srcdir}/config/aarch64/$def | \
@@ -3699,10 +3704,8 @@ esac
 target_cpu_default2=
 case ${target} in
 	aarch64*-*-*)
-		if test x$target_cpu_cname = x
+		if test x"$target_cpu_cname" != x
 		then
-			target_cpu_default2=TARGET_CPU_generic
-		else
 			target_cpu_default2=$target_cpu_cname
 		fi
 		;;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]