Patchwork [arm-embedded] Make GCC more easier for user to build extra libraries for ARM.

login
register
mail settings
Submitter Terry Guo
Date Sept. 11, 2011, 2:34 a.m.
Message ID <003501cc702b$5ae1e4c0$10a5ae40$@guo@arm.com>
Download mbox | patch
Permalink /patch/114206/
State New
Headers show

Comments

Terry Guo - Sept. 11, 2011, 2:34 a.m.
Hello,

This patch adds a little bit extension to current GCC configure system to
make it more convenient for user to select and build extra libraries for ARM
embedded targets. Typically a comma-separated target list is supported.
Extra libraries will be built for targets in that list. Committed into
ARM/embedded-4_6-branch.

BR,
Terry

2011-09-08  Terry Guo  <terry.guo@arm.com>
 
	* config.gcc: Support --with-extra-multilibs option for ARM EABI.
	* configure.ac: Handle --with-extra-multilibs option.
	* configure: Add help message and support for that option. 
	* doc/install.texi: Document that option.
	* config/arm/t-arm-elf (MULTILIB_OSDIRNAMES): Added to support
	build extra multilibs with user-specified directory name.
	* config/arm/t-armv6s-m: New fragment for building extra multilib
for
	ARM armv6s-m architecture.
	* config/arm/t-armv7-m: New fragment for building extra multilib for
	ARM armv7-m architecture.
	* config/arm/t-armv7e-m: New fragment for building extra multilib
for
	ARM armv7e-m architecture.
	* config/arm/t-thumb1: New fragment for building extra multilib for
	ARM Thumb-1.
	* config/arm/t-thumb2: New fragment for building extra multilib for
	ARM Thumb-2.


 #MULTILIB_DIRNAMES    += fa526 fa626 fa606te fa626te fmp626 fa726te
@@ -56,6 +57,7 @@
 MULTILIB_OPTIONS       += mfloat-abi=hard
 MULTILIB_DIRNAMES      += fpu
 MULTILIB_EXCEPTIONS    += *mthumb/*mfloat-abi=hard*
+MULTILIB_OSDIRNAMES    += mfloat-abi.hard=!fpu
marm/mfloat-abi.hard=!arm/fpu
 #MULTILIB_EXCEPTIONS    += *mcpu=fa526/*mfloat-abi=hard*
 #MULTILIB_EXCEPTIONS    += *mcpu=fa626/*mfloat-abi=hard*

Patch

Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi	(revision 178754)
+++ gcc/doc/install.texi	(working copy)
@@ -1068,6 +1068,24 @@ 
 --with-multilib-list=sh4al,!mb/m4al
 @end smallexample
 
+@item --with-extra-multilibs=@var{list}
+@itemx --without-extra-multilibs
+Specify what extra multilibs to build besides the default library set.
+Currently only implemented for arm*-*-eabi.
+
+@var{list} is a comma separated list of ARM architecture names.
+Currently the available names are thumb1, thumb2, armv6s-m, armv7-m
+and armv7e-m.
+
+If @option{--with-extra-multilibs} or @var{list} is not given,
+then no extra multilibs will be built.
+
+Example: to configure a compiler for arm-none-eabi with additional multilib
+support for thumb1, thumb2 and armv6s-m:
+@smallexample
+--target=arm-none-eabi --with-extra-multilibs=thumb1,thumb2,armv6s-m
+@end smallexample
+
 @item --with-endian=@var{endians}
 Specify what endians to use.
 Currently only implemented for sh*-*-*.
Index: gcc/configure
===================================================================
--- gcc/configure	(revision 178754)
+++ gcc/configure	(working copy)
@@ -1650,6 +1650,7 @@ 
   --with-pkgversion=PKG   Use PKG in the version string in place of "GCC"
   --with-bugurl=URL       Direct users to URL to report a bug
   --with-multilib-list    Select multilibs (SH only)
+  --with-extra-multilibs  Select extra multilibs (ARM only)
   --with-gnu-ld           assume the C compiler uses GNU ld default=no
   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and
DIR/lib
   --without-libiconv-prefix     don't search for libiconv in includedir and
libdir
@@ -7198,6 +7199,12 @@ 
   with_multilib_list=default
 fi
 
+# Check whether --with-extra-multilibs was given.
+if test "${with_extra_multilibs+set}" = set; then :
+  withval=$with_extra_multilibs; :
+else
+  with_extra_multilibs=default
+fi
 
 # -------------------------
 # Checks for other programs
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 178754)
+++ gcc/configure.ac	(working copy)
@@ -790,6 +790,11 @@ 
 :,
 with_multilib_list=default)
 
+AC_ARG_WITH(extra-multilibs,
+[  --with-extra-multilibs    Select extra multilibs (ARM only)],
+:,
+with_extra_multilibs=default)
+
 # -------------------------
 # Checks for other programs
 # -------------------------
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 178754)
+++ gcc/config.gcc	(working copy)
@@ -883,6 +883,32 @@ 
 	arm*-*-eabi*)
 	  tm_file="$tm_file newlib-stdint.h"
 	  tmake_file="${tmake_file} arm/t-bpabi"
+	  arm_multilibs="${with_extra_multilibs}"
+	  if test $arm_multilibs != "default"; then
+		arm_multilibs=`echo $arm_multilibs | sed -e 's/,/ /g'`
+		for arm_multilib in ${arm_multilibs}; do
+		    case ${arm_multilib} in
+		    thumb1)
+			tmake_file="${tmake_file} arm/t-thumb1"
+			;;
+		    thumb2)
+			tmake_file="${tmake_file} arm/t-thumb2"
+			;;
+		    armv6s-m)
+			tmake_file="${tmake_file} arm/t-armv6s-m"
+			;;
+		    armv7-m)
+			tmake_file="${tmake_file} arm/t-armv7-m"
+			;;
+		    armv7e-m)
+			tmake_file="${tmake_file} arm/t-armv7e-m"
+			;;
+		    *)
+			echo "--with-extra-multilibs=${arm_multilib} not
supported."
+			exit 1
+		    esac
+		done
+	  fi
 	  use_gcc_stdint=wrap
 	  ;;
 	arm*-*-symbianelf*)
Index: gcc/config/arm/t-arm-elf
===================================================================
--- gcc/config/arm/t-arm-elf	(revision 178754)
+++ gcc/config/arm/t-arm-elf	(working copy)
@@ -35,6 +35,7 @@ 
 MULTILIB_DIRNAMES    = arm thumb
 MULTILIB_EXCEPTIONS  = 
 MULTILIB_MATCHES     =
+MULTILIB_OSDIRNAMES  = marm=!arm mthumb=!thumb
 
 #MULTILIB_OPTIONS     +=
mcpu=fa526/mcpu=fa626/mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te