diff mbox

[ARM] check value of --with-arch against arm-arches.def

Message ID 000001cf0504$291c1cb0$7b545610$@arm.com
State New
Headers show

Commit Message

Terry Guo Dec. 30, 2013, 2:09 a.m. UTC
Hi There,

This patch intends to check value of --with-arch against the arm-arches.def,
rather than current solution that use hard coded things in config.gcc.
Tested with various values of --with-arch and it works. Is it ok to trunk?

BR,
Terry

2013-12-30  Terry Guo  <terry.guo@arm.com>

     * config.gcc (arm*-*-*): Check --with-arch against arm-arches.def.

Comments

Richard Earnshaw Jan. 2, 2014, 11:37 a.m. UTC | #1
On 30/12/13 02:09, Terry Guo wrote:
> Hi There,
> 
> This patch intends to check value of --with-arch against the arm-arches.def,
> rather than current solution that use hard coded things in config.gcc.
> Tested with various values of --with-arch and it works. Is it ok to trunk?
> 
> BR,
> Terry
> 
> 2013-12-30  Terry Guo  <terry.guo@arm.com>
> 
>      * config.gcc (arm*-*-*): Check --with-arch against arm-arches.def.
> 
> 

OK.

R.
diff mbox

Patch

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 24dbaf9..7c4a0b9 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3455,19 +3455,17 @@  case "${target}" in
 			fi
 		done
 
-		case "$with_arch" in
-		"" \
-		| armv[23456] | armv2a | armv3m | armv4t | armv5t \
-		| armv5te | armv6j |armv6k | armv6z | armv6zk | armv6-m \
-		| armv7 | armv7-a | armv7-r | armv7-m | armv8-a \
-		| iwmmxt | ep9312)
-			# OK
-			;;
-		*)
-			echo "Unknown arch used in --with-arch=$with_arch" 1>&2
-			exit 1
-			;;
-		esac
+		# See if it matches any of the entries in arm-arches.def
+		if [ x"$with_arch" = x ] \
+		    || grep "^ARM_ARCH(\"$with_arch\"," \
+			    ${srcdir}/config/arm/arm-arches.def \
+			    > /dev/null; then
+		  # OK
+		  true
+		else
+		  echo "Unknown arch used in --with-arch=$with_arch" 1>&2
+		  exit 1
+		fi
 
 		case "$with_float" in
 		"" \