This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] [ping] Add support for ARM embedded multilibs
- From: "Jasmin J." <jasmin at anw dot at>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 27 Nov 2015 23:25:25 +0100
- Subject: [PATCH] [ping] Add support for ARM embedded multilibs
- Authentication-results: sourceware.org; auth=none
- References: <56395178 dot 8000006 at anw dot at> <CAJA7tRbQPN2HDtP3HjASn6W5s=Lg83k9+DDDJ92_GjDAs95BBw at mail dot gmail dot com> <5639C54F dot 5070700 at anw dot at> <5639D355 dot 7080900 at foss dot arm dot com>
Hello !
Did rebase the patch (sent at 11/08/2015 01:24 AM) to latest trunk
(335ce86cb6cea8046993ab93d573316fd9ff798c).
The patch is originally from Terry Guo
(see https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00729.html).
SVN commit r210320 on svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-4_9-branch .
The original was using "with_multilib_list" instead of TM_MULTILIB_CONFIG.
Moreover, it did not check each argument of "$with_multilib_list".
I simplified the patch and reworked it to use TM_MULTILIB_CONFIG. Additionally
each argument of "$with_multilib_list" is now checked.
I added missing "armv7".
I added the FSF header to t-rmprofile and a little explanation.
I have now a copyright assignment: #1059920
> see for example how I added t-aprofile to the backend and the kind of
> testing it underwent
If this patch is now in principle acceptable, I will start working on your
suggested test scripts.
> The t-rmprofile file will need updating to newer values for -mcpu and
> march
I will let this for open for other people, because I am not familiar with
the different CPU and ARCH variants. Keep in mind, that I am porting
Terry's patch only. But if someone it telling me what is required, I can add
it now and include it to the test scripts.
Regards,
Jasmin
>From 69e0a3852b2c1adb9648ae5c5725d63f6e16b488 Mon Sep 17 00:00:00 2001
From: Jasmin Jessich <jasmin@anw.at>
Date: Sat, 24 Oct 2015 00:43:48 +0200
Subject: [PATCH] Add support for ARM embedded multilibs
Based on svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-4_9-branch
commit r210320 from Terry Guo <terry.guo@arm.com> .
* config.gcc (--with-multilib-list): Accept arm embedded cores.
* configure/configure.ac: Helptext.
* config/arm/t-rmprofile: New file.
Signed-off-by: Terry Guo <terry.guo@arm.com>
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
gcc/config.gcc | 14 ++++++
gcc/config/arm/t-rmprofile | 121 +++++++++++++++++++++++++++++++++++++++++++++
gcc/configure | 2 +-
gcc/configure.ac | 2 +-
4 files changed, 137 insertions(+), 2 deletions(-)
create mode 100644 gcc/config/arm/t-rmprofile
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 59aee2c..63841d2 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3796,6 +3796,18 @@ case "${target}" in
tmake_file="${tmake_file} arm/t-aprofile"
break
;;
+ armv6-m|armv7|armv7-m|armv7e-m|armv7-r|armv7-a|cortex-m7)
+ if test "x$with_arch" != x \
+ || test "x$with_cpu" != x \
+ || test "x$with_float" != x \
+ || test "x$with_fpu" != x \
+ || test "x$with_mode" != x ; then
+ echo "Error: You cannot use any of --with-arch/cpu/fpu/float/mode with --with-multilib-list=${with_multilib_list}" 1>&2
+ exit 1
+ fi
+ tmake_file_ml=" arm/t-rmprofile"
+ TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${arm_multilib}"
+ ;;
default)
;;
*)
@@ -3804,6 +3816,8 @@ case "${target}" in
;;
esac
done
+ tmake_file="${tmake_file}${tmake_file_ml}"
+ TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
fi
;;
diff --git a/gcc/config/arm/t-rmprofile b/gcc/config/arm/t-rmprofile
new file mode 100644
index 0000000..65d60c0
--- /dev/null
+++ b/gcc/config/arm/t-rmprofile
@@ -0,0 +1,121 @@
+# Copyright (C) 2012-2015 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# This is a target makefile fragment that attempts to get
+# multilibs built for the range of CPU's, FPU's and ABI's the user did
+# customize via the configure option --with-multilib-list.
+# It should not be used in conjunction with another make file fragment and
+# assumes --with-arch, --with-cpu, --with-fpu, --with-float, --with-mode
+# have their default values during the configure step. We enforce
+# this during the top-level configury.
+
+comma := ,
+space :=
+space +=
+
+MULTILIB_OPTIONS = mthumb/marm
+MULTILIB_DIRNAMES = thumb arm
+MULTILIB_OPTIONS += march=armv6s-m/march=armv7-m/march=armv7e-m/march=armv7/mcpu=cortex-m7
+MULTILIB_DIRNAMES += armv6-m armv7-m armv7e-m armv7-ar cortex-m7
+MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard
+MULTILIB_DIRNAMES += softfp fpu
+MULTILIB_OPTIONS += mfpu=fpv4-sp-d16/mfpu=vfpv3-d16/mfpu=fpv5-sp-d16/mfpu=fpv5-d16
+MULTILIB_DIRNAMES += fpv4-sp-d16 vfpv3-d16 fpv5-sp-d16 fpv5-d16
+
+MULTILIB_MATCHES = march?armv6s-m=mcpu?cortex-m0
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0plus
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m1
+MULTILIB_MATCHES += march?armv6s-m=march?armv6-m
+MULTILIB_MATCHES += march?armv7-m=mcpu?cortex-m3
+MULTILIB_MATCHES += march?armv7e-m=mcpu?cortex-m4
+MULTILIB_MATCHES += march?armv7=march?armv7-r
+MULTILIB_MATCHES += march?armv7=march?armv7-a
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4f
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-r5
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-r7
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a5
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a7
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a8
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a9
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a15
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3-fp16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3-d16-fp16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3xd
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3xd-fp16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv4
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv4-d16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?neon
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?neon-fp16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?neon-vfpv4
+
+MULTILIB_EXCEPTIONS =
+MULTILIB_REUSE =
+
+MULTILIB_REQUIRED = mthumb
+MULTILIB_REQUIRED += marm
+MULTILIB_REQUIRED += mfloat-abi=hard
+
+MULTILIB_OSDIRNAMES = mthumb=!thumb
+MULTILIB_OSDIRNAMES += marm=!arm
+MULTILIB_OSDIRNAMES += mfloat-abi.hard=!fpu
+
+ifneq (,$(findstring armv6-m,$(subst $(comma),$(space),$(TM_MULTILIB_CONFIG))))
+MULTILIB_REQUIRED += mthumb/march=armv6s-m
+MULTILIB_OSDIRNAMES += mthumb/march.armv6s-m=!armv6-m
+endif
+
+ifneq (,$(findstring armv7-m,$(subst $(comma),$(space),$(TM_MULTILIB_CONFIG))))
+MULTILIB_REQUIRED += mthumb/march=armv7-m
+MULTILIB_OSDIRNAMES += mthumb/march.armv7-m=!armv7-m
+endif
+
+ifneq (,$(findstring armv7e-m,$(subst $(comma),$(space),$(TM_MULTILIB_CONFIG))))
+MULTILIB_REQUIRED += mthumb/march=armv7e-m
+MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=softfp/mfpu=fpv4-sp-d16
+MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=hard/mfpu=fpv4-sp-d16
+MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m=!armv7e-m
+MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.hard/mfpu.fpv4-sp-d16=!armv7e-m/fpu
+MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.softfp/mfpu.fpv4-sp-d16=!armv7e-m/softfp
+endif
+
+ifneq (,$(findstring cortex-m7,$(subst $(comma),$(space),$(TM_MULTILIB_CONFIG))))
+MULTILIB_REQUIRED += mthumb/mcpu=cortex-m7
+MULTILIB_REQUIRED += mthumb/mcpu=cortex-m7/mfloat-abi=softfp/mfpu=fpv5-sp-d16
+MULTILIB_REQUIRED += mthumb/mcpu=cortex-m7/mfloat-abi=hard/mfpu=fpv5-sp-d16
+MULTILIB_REQUIRED += mthumb/mcpu=cortex-m7/mfloat-abi=softfp/mfpu=fpv5-d16
+MULTILIB_REQUIRED += mthumb/mcpu=cortex-m7/mfloat-abi=hard/mfpu=fpv5-d16
+MULTILIB_OSDIRNAMES += mthumb/mcpu.cortex-m7=!cortex-m7
+MULTILIB_OSDIRNAMES += mthumb/mcpu.cortex-m7/mfloat-abi.hard/mfpu.fpv5-sp-d16=!cortex-m7/fpu/fpv5-sp-d16
+MULTILIB_OSDIRNAMES += mthumb/mcpu.cortex-m7/mfloat-abi.softfp/mfpu.fpv5-sp-d16=!cortex-m7/softfp/fpv5-sp-d16
+MULTILIB_OSDIRNAMES += mthumb/mcpu.cortex-m7/mfloat-abi.hard/mfpu.fpv5-d16=!cortex-m7/fpu/fpv5-d16
+MULTILIB_OSDIRNAMES += mthumb/mcpu.cortex-m7/mfloat-abi.softfp/mfpu.fpv5-d16=!cortex-m7/softfp/fpv5-d16
+endif
+
+ifneq (,$(filter armv7 armv7-r armv7-a,$(subst $(comma),$(space),$(TM_MULTILIB_CONFIG))))
+MULTILIB_REQUIRED += mthumb/march=armv7
+MULTILIB_REQUIRED += mthumb/march=armv7/mfloat-abi=softfp/mfpu=vfpv3-d16
+MULTILIB_REQUIRED += mthumb/march=armv7/mfloat-abi=hard/mfpu=vfpv3-d16
+MULTILIB_OSDIRNAMES += mthumb/march.armv7=!armv7-ar/thumb
+MULTILIB_OSDIRNAMES += mthumb/march.armv7/mfloat-abi.hard/mfpu.vfpv3-d16=!armv7-ar/thumb/fpu
+MULTILIB_OSDIRNAMES += mthumb/march.armv7/mfloat-abi.softfp/mfpu.vfpv3-d16=!armv7-ar/thumb/softfp
+MULTILIB_REUSE += mthumb/march.armv7=marm/march.armv7
+MULTILIB_REUSE += mthumb/march.armv7/mfloat-abi.softfp/mfpu.vfpv3-d16=marm/march.armv7/mfloat-abi.softfp/mfpu.vfpv3-d16
+MULTILIB_REUSE += mthumb/march.armv7/mfloat-abi.hard/mfpu.vfpv3-d16=marm/march.armv7/mfloat-abi.hard/mfpu.vfpv3-d16
+endif
diff --git a/gcc/configure b/gcc/configure
index bb5e02b..be5ff24 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1713,7 +1713,7 @@ Optional Packages:
--with-specs=SPECS add SPECS to driver command-line processing
--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 (AArch64, SH and x86-64 only)
+ --with-multilib-list select multilibs (AArch64, ARM, SH and x86-64 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
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 5990b7c..da36282 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -957,7 +957,7 @@ else
fi
AC_ARG_WITH(multilib-list,
-[AS_HELP_STRING([--with-multilib-list], [select multilibs (AArch64, SH and x86-64 only)])],
+[AS_HELP_STRING([--with-multilib-list], [select multilibs (AArch64, ARM, SH and x86-64 only)])],
:,
with_multilib_list=default)
--
1.9.1