From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47159 invoked by alias); 19 May 2016 21:42:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 47113 invoked by uid 89); 19 May 2016 21:42:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=BAYES_00,KAM_LOTSOFHASH,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:D*at, owner@gcc.gnu.org, ownergccgnuorg, sk:ownerg X-HELO: mail.anw.at Received: from ns1.anw.at (HELO mail.anw.at) (195.234.101.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 19 May 2016 21:42:30 +0000 Received: from [192.168.23.40] (anwhome.anw.at [195.234.103.23]) by mail.anw.at (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u4JLgLOp012312; Thu, 19 May 2016 23:42:22 +0200 From: "Jasmin J." Subject: Re: [PATCH, ARM, 3/3] Add multilib support for bare-metal ARM architectures To: "Thomas Preud'homme" , Ramana Radhakrishnan , Richard Earnshaw , Kyrylo Tkachov , gcc-patches References: <000601d137f9$ec63c180$c52b4480$@foss.arm.com> <56D8D493.4010000@anw.at> Message-ID: <573E334E.4050907@anw.at> Date: Thu, 19 May 2016 21:42:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <56D8D493.4010000@anw.at> Content-Type: multipart/mixed; boundary="------------030101000804050701080504" X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg01578.txt.bz2 This is a multi-part message in MIME format. --------------030101000804050701080504 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 17992 Hi! Ping! Attached is a rebased version of my patch due to commit 33ac16c8cc870229a6a08cd7037275b01e7a0b9d *** gcc/ChangeLog *** 2016-04-19 Thomas Preud'homme Jasmin Jessich * config.gcc: Handle bare-metal multilibs in --with-multilib-list option. * config/arm/t-baremetal: New file. * configure.ac: added comment for ARM in --with-multilib-list option. * configure: added comment for ARM in --with-multilib-list option. BR Jasmin *************************************************************************** On 03/04/2016 01:19 AM, Jasmin J. wrote: > Hi all! > >> As to the need to modify Makefile.in and >> configure.ac, this is because the patch aims to let control to the user >> as to what multilib should be built. > As Ramana asked in his answer to my first version of the patch: Why? > The GCC mechanism to forward this to the t-* makefile is "TM_MULTILIB_CONFIG" > (as far as I have understand it). It is not necessary to introduce a new > variable to configure and Makefile. > > Ramana mentioned also: >>> ... as well as comments up top to explain what multilibs are being >>> built . > > Additionally the error message "You cannot use any of ..." didn't print the > the right text in any case. > > Attached is an improved version of this patch: > - it uses TM_MULTILIB_CONFIG > - fixed the error message "You cannot use any of ..." > - made the error message "Error: .... not supported." more clear > - added a FSF copyright header to t-baremetal file and described what is > built there > - commented out armv8-m.base and armv8-m.main, because this is currently not > available in GCC mainline and gcc 5.3.0 release, but will be added soon > (I guess) > > Ramana mentioned in another message a test of the new options: > - I did test it with "test_arm_none_eabi.sh"; procedure taken from this > message: https://gcc.gnu.org/ml/gcc-patches/2013-10/msg00659.html > - The result is in "test_result.txt". > (both files attached also) > > My copyright assignment number: 1059920 > > Please note, that the patch > "[PATCH, GCC/ARM, 2/3] Error out for incompatible ARM multilibs" > from 12/16/2015 12:58 PM > needs to be applied before my new version of this patch. > > BR > Jasmin > > ************************************************************************** > > On 12/16/2015 01:04 PM, Thomas Preud'homme wrote: >> Hi Ramana, >> >> As suggested in your initial answer to this thread, we updated the multilib >> patch provided in ARM's embedded branch to be up-to-date with regards to >> supported CPUs in GCC. As to the need to modify Makefile.in and >> configure.ac, this is because the patch aims to let control to the user >> as to what multilib should be built. To this effect, it takes a list of >> architecture at configure time and that list needs to be passed down to >> t-baremetal Makefile to set the multilib variables appropriately. >> >> ChangeLog entry is as follows: >> >> >> *** gcc/ChangeLog *** >> >> 2015-12-15 Thomas Preud'homme >> >> * Makefile.in (with_multilib_list): New variables substituted by >> configure. >> * config.gcc: Handle bare-metal multilibs in --with-multilib-list >> option. >> * config/arm/t-baremetal: New file. >> * configure.ac (with_multilib_list): New AC_SUBST. >> * configure: Regenerate. >> * doc/install.texi (--with-multilib-list): Update description for >> arm*-*-* targets to mention bare-metal multilibs. >> >> >> diff --git a/gcc/Makefile.in b/gcc/Makefile.in >> index 1f698798aa2df3f44d6b3a478bb4bf48e9fa7372..18b790afa114aa7580be0662d3ac9ffbc94e919d 100644 >> --- a/gcc/Makefile.in >> +++ b/gcc/Makefile.in >> @@ -546,6 +546,7 @@ lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt >> lang_specs_files=@lang_specs_files@ >> lang_tree_files=@lang_tree_files@ >> target_cpu_default=@target_cpu_default@ >> +with_multilib_list=@with_multilib_list@ >> OBJC_BOEHM_GC=@objc_boehm_gc@ >> extra_modes_file=@extra_modes_file@ >> extra_opt_files=@extra_opt_files@ >> diff --git a/gcc/config.gcc b/gcc/config.gcc >> index af948b5e203f6b4f53dfca38e9d02d060d00c97b..d8098ed3cefacd00cb10590db1ec86d48e9fcdbc 100644 >> --- a/gcc/config.gcc >> +++ b/gcc/config.gcc >> @@ -3787,15 +3787,25 @@ case "${target}" in >> default) >> ;; >> *) >> - echo "Error: --with-multilib-list=${with_multilib_list} not supported." 1>&2 >> - exit 1 >> + for arm_multilib in ${arm_multilibs}; do >> + case ${arm_multilib} in >> + armv6-m | armv7-m | armv7e-m | armv7-r | armv8-m.base | armv8-m.main) >> + tmake_profile_file="arm/t-baremetal" >> + ;; >> + *) >> + echo "Error: --with-multilib-list=${with_multilib_list} not supported." 1>&2 >> + exit 1 >> + ;; >> + esac >> + done >> ;; >> esac >> >> if test "x${tmake_profile_file}" != x ; then >> - # arm/t-aprofile is only designed to work >> - # without any with-cpu, with-arch, with-mode, >> - # with-fpu or with-float options. >> + # arm/t-aprofile and arm/t-baremetal are only >> + # designed to work without any with-cpu, >> + # with-arch, with-mode, with-fpu or with-float >> + # options. >> if test "x$with_arch" != x \ >> || test "x$with_cpu" != x \ >> || test "x$with_float" != x \ >> diff --git a/gcc/config/arm/t-baremetal b/gcc/config/arm/t-baremetal >> new file mode 100644 >> index 0000000000000000000000000000000000000000..ffd29815e6ec22c747e77747ed9b69e0ae21b63a >> --- /dev/null >> +++ b/gcc/config/arm/t-baremetal >> @@ -0,0 +1,130 @@ >> +# A set of predefined MULTILIB which can be used for different ARM targets. >> +# Via the configure option --with-multilib-list, user can customize the >> +# final MULTILIB implementation. >> + >> +comma := , >> + >> +with_multilib_list := $(subst $(comma), ,$(with_multilib_list)))) >> + >> +MULTILIB_OPTIONS = mthumb/marm >> +MULTILIB_DIRNAMES = thumb arm >> +MULTILIB_OPTIONS += march=armv6s-m/march=armv7-m/march=armv7e-m/march=armv7/march=armv8-m.base/march=armv8-m.main >> +MULTILIB_DIRNAMES += armv6-m armv7-m armv7e-m armv7-ar armv8-m.base armv8-m.main >> +MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard >> +MULTILIB_DIRNAMES += softfp fpu >> +MULTILIB_OPTIONS += mfpu=fpv5-sp-d16/mfpu=fpv5-d16/mfpu=fpv4-sp-d16/mfpu=vfpv3-d16 >> +MULTILIB_DIRNAMES += fpv5-sp-d16 fpv5-d16 fpv4-sp-d16 vfpv3-d16 >> + >> +MULTILIB_MATCHES = march?armv6s-m=mcpu?cortex-m0 >> +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0.small-multiply >> +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0plus >> +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0plus.small-multiply >> +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m1 >> +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m1.small-multiply >> +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?armv7e-m=mcpu?cortex-m7 >> +MULTILIB_MATCHES += march?armv7e-m=mcpu?marvell-pj4 >> +MULTILIB_MATCHES += march?armv7=march?armv7-r >> +MULTILIB_MATCHES += march?armv7=march?armv7-a >> +MULTILIB_MATCHES += march?armv7=march?armv8-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?generic-armv7-a >> +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-a12 >> +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a15 >> +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a17 >> +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a15.cortex-a7 >> +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a17.cortex-a7 >> +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a53 >> +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a57 >> +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a72 >> +MULTILIB_MATCHES += march?armv7=mcpu?exynos-m1 >> +MULTILIB_MATCHES += march?armv7=mcpu?xgene1 >> +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a57.cortex-a53 >> +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a72.cortex-a53 >> +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,$(with_multilib_list))) >> +MULTILIB_REQUIRED += mthumb/march=armv6s-m >> +MULTILIB_OSDIRNAMES += mthumb/march.armv6s-m=!armv6-m >> +endif >> + >> +ifneq (,$(findstring armv8-m.base,$(with_multilib_list))) >> +MULTILIB_REQUIRED += mthumb/march=armv8-m.base >> +MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.base=!armv8-m.base >> +endif >> + >> +ifneq (,$(findstring armv7-m,$(with_multilib_list))) >> +MULTILIB_REQUIRED += mthumb/march=armv7-m >> +MULTILIB_OSDIRNAMES += mthumb/march.armv7-m=!armv7-m >> +endif >> + >> +ifneq (,$(findstring armv7e-m,$(with_multilib_list))) >> +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_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=softfp/mfpu=fpv5-d16 >> +MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=hard/mfpu=fpv5-d16 >> +MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=softfp/mfpu=fpv5-sp-d16 >> +MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=hard/mfpu=fpv5-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 >> +MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.hard/mfpu.fpv5-d16=!armv7e-m/fpu/fpv5-d16 >> +MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.softfp/mfpu.fpv5-d16=!armv7e-m/softfp/fpv5-d16 >> +MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.hard/mfpu.fpv5-sp-d16=!armv7e-m/fpu/fpv5-sp-d16 >> +MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.softfp/mfpu.fpv5-sp-d16=!armv7e-m/softfp/fpv5-sp-d16 >> +endif >> + >> +ifneq (,$(findstring armv8-m.main,$(with_multilib_list))) >> +MULTILIB_REQUIRED += mthumb/march=armv8-m.main >> +MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfloat-abi=softfp/mfpu=fpv5-d16 >> +MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfloat-abi=hard/mfpu=fpv5-d16 >> +MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfloat-abi=softfp/mfpu=fpv5-sp-d16 >> +MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfloat-abi=hard/mfpu=fpv5-sp-d16 >> +MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main=!armv8-m.main >> +MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main/mfloat-abi.hard/mfpu.fpv5-d16=!armv8-m.main/fpu/fpv5-d16 >> +MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main/mfloat-abi.softfp/mfpu.fpv5-d16=!armv8-m.main/softfp/fpv5-d16 >> +MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main/mfloat-abi.hard/mfpu.fpv5-sp-d16=!armv8-m.main/fpu/fpv5-sp-d16 >> +MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main/mfloat-abi.softfp/mfpu.fpv5-sp-d16=!armv8-m.main/softfp/fpv5-sp-d16 >> +endif >> + >> +ifneq (,$(filter armv7 armv7-r armv7-a,$(with_multilib_list))) >> +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 23f92c3ceeb4c2e171f0cf7f83346b7575e134c0..e55125cfb6e6a79e2ed3c274e05d9d420a220d62 100755 >> --- a/gcc/configure >> +++ b/gcc/configure >> @@ -767,6 +767,7 @@ LN >> LN_S >> AWK >> SET_MAKE >> +with_multilib_list >> accel_dir_suffix >> real_target_noncanonical >> enable_as_accelerator >> @@ -7730,6 +7731,7 @@ else >> fi >> >> >> + >> # ------------------------- >> # Checks for other programs >> # ------------------------- >> diff --git a/gcc/configure.ac b/gcc/configure.ac >> index a2caf298d3302a2be3bfebd192101a94df7d1b65..408f772578cd5ef65310a26f6d65c3a82f3533a8 100644 >> --- a/gcc/configure.ac >> +++ b/gcc/configure.ac >> @@ -960,6 +960,7 @@ AC_ARG_WITH(multilib-list, >> [AS_HELP_STRING([--with-multilib-list], [select multilibs (AArch64, SH and x86-64 only)])], >> :, >> with_multilib_list=default) >> +AC_SUBST(with_multilib_list) >> >> # ------------------------- >> # Checks for other programs >> diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi >> index 50d6133794874c6b5ec7e2b2c947c991fadbb3a4..c6d65b177696bbf897dc0dcc7dc25ea3777ac6fa 100644 >> --- a/gcc/doc/install.texi >> +++ b/gcc/doc/install.texi >> @@ -1106,14 +1106,23 @@ Currently only implemented for arm*-*-*, sh*-*-* and x86-64-*-linux*. >> >> @table @code >> @item arm*-*-* >> -@var{list} is either @code{default} or @code{aprofile}. Specifying >> -@code{default} is equivalent to omitting this option while specifying >> -@code{aprofile} builds multilibs for each combination of ISA (@code{-marm} or >> -@code{-mthumb}), architecture (@code{-march=armv7-a}, @code{-march=armv7ve}, >> -or @code{-march=armv8-a}), FPU available (none, @code{-mfpu=vfpv3-d16}, >> -@code{neon}, @code{vfpv4-d16}, @code{neon-vfpv4} or @code{neon-fp-armv8} >> -depending on architecture) and floating-point ABI (@code{-mfloat-abi=softfp} >> -or @code{-mfloat-abi=hard}). >> +@var{list} is one of: >> + >> +@itemize @bullet >> + @item @code{default} >> + @item @code{aprofile} >> + @item any combination of @code{armv6-m}, @code{armv7-m}, @code{armv7e-m}, >> + @code{armv7-r}, @code{armv8-m.base} and @code{armv8-m.main} >> +@end itemize >> + >> +Specifying @code{default} is equivalent to omitting this option while >> +specifying @code{aprofile} builds multilibs for each combination of ISA >> +(@code{-marm} or @code{-mthumb}), architecture (@code{-march=armv7-a}, >> +@code{-march=armv7ve}, or @code{-march=armv8-a}), FPU available (none, >> +@code{-mfpu=vfpv3-d16}, @code{neon}, @code{vfpv4-d16}, @code{neon-vfpv4} or >> +@code{neon-fp-armv8} depending on architecture) and floating-point ABI >> +(@code{-mfloat-abi=softfp} or @code{-mfloat-abi=hard}). The last option >> +specifies a list of bare-metal multilibs that must be built. >> >> @item sh*-*-* >> @var{list} is a comma separated list of CPU names. These must be of the >> >> >> Is this ok for trunk? >> >> Best regards, >> >> Thomas >> >>> -----Original Message----- >>> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches- >>> owner@gcc.gnu.org] On Behalf Of Ramana Radhakrishnan >>> Sent: Wednesday, November 04, 2015 3:47 PM >>> To: Jasmin J. >>> Cc: gcc-patches >>> Subject: Re: [PATCH] Add support for ARM embedded multilibs >>> >>> On Wed, Nov 4, 2015 at 12:29 AM, Jasmin J. wrote: >>> >>>> >>> >>> Thank you for your patch - In this case before you make any more >>> changes to this patch - comparing your patch and Terry's patch here >>> https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00729.html shows no >>> real >>> differences, I would like to ask if you have a copyright assignment >>> on file with the FSF - Please also read >>> https://gcc.gnu.org/contribute.html for more context on this. >>> >>> How was your patch tested - see for example how I added t-aprofile to >>> the backend and the kind of testing it underwent - I would prefer >>> something like that to be done for all the cpus listed in t-rmprofile >>> (https://gcc.gnu.org/ml/gcc-patches/2013-10/msg00659.html). >>> >>>> Ported from svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded- >>> 4_9-branch >>>> >>>> * config.gcc (--with-multilib-list): Accept arm embedded cores. >>>> * configure.ac (with_multilib_list): Export for being used in arm >>>> embedded multilib fragment. >>> >>> This is already being used in config.gcc - why do you need this >>> additional hunk ? >>> >>>> * configure: Regenerated. >>>> * Makefile.in (with_multilib_list): Import for being used in >>>> multilib fragment. >>> >>> Again why ? >>> >>>> * config/arm/t-rmprofile: New multilib fragment for arm embedded >>>> cores. >>> >>> New file is sufficient here in the Changelog entry. >>> >>> >>> The t-rmprofile file will need updating to newer values for -mcpu and >>> march as well as comments up top to explain what multilibs are being >>> built . >>> >>> Ramana >> >> >> --------------030101000804050701080504 Content-Type: text/x-patch; name="0001-Add-multilib-support-for-bare-metal-ARM-architecture.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Add-multilib-support-for-bare-metal-ARM-architecture.pa"; filename*1="tch" Content-length: 12507 >From 9cf7aec2fda78bdd75beb29456ffe82108867a75 Mon Sep 17 00:00:00 2001 From: Jasmin Jessich Date: Thu, 3 Mar 2016 23:54:03 +0100 Subject: [PATCH] Add multilib support for bare-metal ARM architectures Based on svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-5-branch commit r231749 and r231750 from Thomas Preud'homme Thomas did export with_multilib_list and used it in the Makefile. I changed it to using TM_MULTILIB_CONFIG instead, which is the preferred GCC pattern. Additionally, I commented out armv8-m.base and armv8-m.main, because this is currently not available in GCC mainline and gcc 5.3.0 release. gcc/ * config.gcc: Handle bare-metal multilibs in --with-multilib-list option. * config/arm/t-baremetal: New file. * configure.ac: added comment for ARM in --with-multilib-list option. * configure: added comment for ARM in --with-multilib-list option. Signed-off-by: Jasmin Jessich Signed-off-by: Thomas Preud'homme --- gcc/config.gcc | 22 ++++-- gcc/config/arm/t-baremetal | 165 +++++++++++++++++++++++++++++++++++++++++++++ gcc/configure | 2 +- gcc/configure.ac | 2 +- 4 files changed, 184 insertions(+), 7 deletions(-) create mode 100644 gcc/config/arm/t-baremetal diff --git a/gcc/config.gcc b/gcc/config.gcc index 51af122a..a54f685 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -3779,15 +3779,26 @@ case "${target}" in default) ;; *) - echo "Error: --with-multilib-list=${with_multilib_list} not supported." 1>&2 - exit 1 + for arm_multilib in ${arm_multilibs}; do + case ${arm_multilib} in + armv6-m | armv7-m | armv7e-m | armv7-r) # armv8-m.base | armv8-m.main) + tmake_profile_file="arm/t-baremetal" + TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${arm_multilib}" + ;; + *) + echo "Error: --with-multilib-list=${with_multilib_list}: '${arm_multilib}' not supported." 1>&2 + exit 1 + ;; + esac + done ;; esac if test "x${tmake_profile_file}" != x ; then - # arm/t-aprofile is only designed to work - # without any with-cpu, with-arch, with-mode, - # with-fpu or with-float options. + # arm/t-aprofile and arm/t-baremetal are only + # designed to work without any with-cpu, + # with-arch, with-mode, with-fpu or with-float + # options. if test "x$with_arch" != x \ || test "x$with_cpu" != x \ || test "x$with_float" != x \ @@ -3798,6 +3809,7 @@ case "${target}" in fi tmake_file="${tmake_file} ${tmake_profile_file}" + TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'` fi fi ;; diff --git a/gcc/config/arm/t-baremetal b/gcc/config/arm/t-baremetal new file mode 100644 index 0000000..6d98ea8 --- /dev/null +++ b/gcc/config/arm/t-baremetal @@ -0,0 +1,165 @@ +# Copyright (C) 2012-2016 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 +# . + +# This is a target makefile fragment that attempts to get +# multilibs built for ARM embedded CPU's. 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. +# Via the configure option --with-multilib-list, user can customize the +# final MULTILIB implementation. +# TM_MULTILIB_CONFIG is set in config.gcc . + +comma := , + +tm_ml_conf := $(subst $(comma), ,$(TM_MULTILIB_CONFIG)) + +# We have the following hierachy: +# ISA: A32 (.) or T32 (thumb) +# Architecture: ARMv6-M (armv6-m), ARMv7-M (armv7-m), ARMv7E-M (armv7e-m) +# or ARMv7 (armv7-ar) +# Float-abi: Soft (.), softfp (softfp), or hard (fpu). +# FPU: VFPv5-SP-D16 (fpv5-sp-d16), VFPv5-D16 (fpv5-d16), +# VFPv4-SP-D16 (fpv4-sp-d16), VFPv3-D16 (vfpv3-d16), +# or None (.). + +MULTILIB_OPTIONS = mthumb/marm +MULTILIB_DIRNAMES = thumb arm +MULTILIB_OPTIONS += march=armv6s-m/march=armv7-m/march=armv7e-m/march=armv7 +MULTILIB_DIRNAMES += armv6-m armv7-m armv7e-m armv7-ar +# MULTILIB_OPTIONS += march=armv8-m.base/march=armv8-m.main +# MULTILIB_DIRNAMES += armv8-m.base armv8-m.main +MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard +MULTILIB_DIRNAMES += softfp fpu +MULTILIB_OPTIONS += mfpu=fpv5-sp-d16/mfpu=fpv5-d16/mfpu=fpv4-sp-d16/mfpu=vfpv3-d16 +MULTILIB_DIRNAMES += fpv5-sp-d16 fpv5-d16 fpv4-sp-d16 vfpv3-d16 + +MULTILIB_MATCHES = march?armv6s-m=mcpu?cortex-m0 +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0.small-multiply +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0plus +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0plus.small-multiply +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m1 +MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m1.small-multiply +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?armv7e-m=mcpu?cortex-m7 +MULTILIB_MATCHES += march?armv7e-m=mcpu?marvell-pj4 +MULTILIB_MATCHES += march?armv7=march?armv7-r +MULTILIB_MATCHES += march?armv7=march?armv7-a +MULTILIB_MATCHES += march?armv7=march?armv8-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?generic-armv7-a +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-a12 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a15 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a17 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a15.cortex-a7 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a17.cortex-a7 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a53 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a57 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a72 +MULTILIB_MATCHES += march?armv7=mcpu?exynos-m1 +MULTILIB_MATCHES += march?armv7=mcpu?xgene1 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a57.cortex-a53 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a72.cortex-a53 +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,$(tm_ml_conf))) +MULTILIB_REQUIRED += mthumb/march=armv6s-m +MULTILIB_OSDIRNAMES += mthumb/march.armv6s-m=!armv6-m +endif + +# ifneq (,$(findstring armv8-m.base,$(tm_ml_conf))) +# MULTILIB_REQUIRED += mthumb/march=armv8-m.base +# MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.base=!armv8-m.base +# endif + +ifneq (,$(findstring armv7-m,$(tm_ml_conf))) +MULTILIB_REQUIRED += mthumb/march=armv7-m +MULTILIB_OSDIRNAMES += mthumb/march.armv7-m=!armv7-m +endif + +ifneq (,$(findstring armv7e-m,$(tm_ml_conf))) +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_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=softfp/mfpu=fpv5-d16 +MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=hard/mfpu=fpv5-d16 +MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=softfp/mfpu=fpv5-sp-d16 +MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfloat-abi=hard/mfpu=fpv5-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 +MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.hard/mfpu.fpv5-d16=!armv7e-m/fpu/fpv5-d16 +MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.softfp/mfpu.fpv5-d16=!armv7e-m/softfp/fpv5-d16 +MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.hard/mfpu.fpv5-sp-d16=!armv7e-m/fpu/fpv5-sp-d16 +MULTILIB_OSDIRNAMES += mthumb/march.armv7e-m/mfloat-abi.softfp/mfpu.fpv5-sp-d16=!armv7e-m/softfp/fpv5-sp-d16 +endif + +# ifneq (,$(findstring armv8-m.main,$(tm_ml_conf))) +# MULTILIB_REQUIRED += mthumb/march=armv8-m.main +# MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfloat-abi=softfp/mfpu=fpv5-d16 +# MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfloat-abi=hard/mfpu=fpv5-d16 +# MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfloat-abi=softfp/mfpu=fpv5-sp-d16 +# MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfloat-abi=hard/mfpu=fpv5-sp-d16 +# MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main=!armv8-m.main +# MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main/mfloat-abi.hard/mfpu.fpv5-d16=!armv8-m.main/fpu/fpv5-d16 +# MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main/mfloat-abi.softfp/mfpu.fpv5-d16=!armv8-m.main/softfp/fpv5-d16 +# MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main/mfloat-abi.hard/mfpu.fpv5-sp-d16=!armv8-m.main/fpu/fpv5-sp-d16 +# MULTILIB_OSDIRNAMES += mthumb/march.armv8-m.main/mfloat-abi.softfp/mfpu.fpv5-sp-d16=!armv8-m.main/softfp/fpv5-sp-d16 +# endif + +ifneq (,$(filter armv7 armv7-r armv7-a,$(tm_ml_conf))) +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 c8d8abc..59f6d18 100755 --- a/gcc/configure +++ b/gcc/configure @@ -1716,7 +1716,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 ab91de6..2bc77bd 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -994,7 +994,7 @@ if test x"$enable_hsa" = x1 ; then 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 --------------030101000804050701080504--