This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, GAS/ARM] Fix selected_cpu with default CPU and -mcpu
- From: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- To: Thomas Preudhomme <thomas dot preudhomme at foss dot arm dot com>
- Cc: Richard Earnshaw <richard dot earnshaw at arm dot com>, Nick Clifton <nickc at redhat dot com>, Alan Modra <amodra at gmail dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Fri, 24 Mar 2017 09:45:31 +0000
- Subject: Re: [PATCH, GAS/ARM] Fix selected_cpu with default CPU and -mcpu
- Authentication-results: sourceware.org; auth=none
- References: <ed975398-af44-8f0e-8b16-e2e31f7d50ea@foss.arm.com>
On Fri, Mar 24, 2017 at 9:38 AM, Thomas Preudhomme
<thomas.preudhomme@foss.arm.com> wrote:
> Hi,
>
> When GAS is compiled with DEFAULT_CPU set and then run with a -mcpu or
> -march option, selected_cpu will be set to the default CPU. This means
> the -mcpu is ignored which is surprising behavior. This patch instead
> sets selected_cpu from the value passed to -mcpu/-march.
>
> ChangeLog entry is as follows:
>
> *** gas/ChangeLog ***
>
> 2017-02-03 Thomas preud'homme <thomas.preudhomme@arm.com>
>
> * config/tc-arm.: (md_begin): Set selected_cpu from *mcpu_cpu_opt
> when
> CPU_DEFAULT is defined.
>
>
> Testing: GAS was configured with CFLAGS="-DCPU_DEFAULT=ARM_ARCH_V6SM"
> and then assembling gas/testsuite/gas/arm/blank.s with -mcpu=cortex-a57.
> Without the patch, the build attributes are:
>
> Tag_CPU_name: "Cortex-A57"
> Tag_CPU_arch: v6S-M
> Tag_CPU_arch_profile: Microcontroller
> Tag_THUMB_ISA_use: Thumb-1
>
> With the patch, the build attributes are as expected:
>
> File Attributes
> Tag_CPU_name: "Cortex-A57"
> Tag_CPU_arch: v8
> Tag_CPU_arch_profile: Application
> Tag_ARM_ISA_use: Yes
> Tag_THUMB_ISA_use: Thumb-2
> Tag_MPextension_use: Allowed
> Tag_Virtualization_use: TrustZone and Virtualization Extensions
>
>
> Is this ok for master?
The change came in as part of a fix for PR17852 but this correction
looks good to me. Unfortunately there's no easy way of testing this in
the testsuite as I'm not sure how many folks are going to build gas
with CPU_DEFAULT set to something.
I'd give Nick 24 working hours to respond before checking it in since
he wrote the original patch. Otherwise OK.
Ramana
>
> Best regards,
>
> Thomas