[PATCH, GAS/ARM] Fix selected_cpu with default CPU and -mcpu

Ramana Radhakrishnan ramana.gcc@googlemail.com
Fri Mar 24 09:45:00 GMT 2017


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



More information about the Binutils mailing list