Re: [PATCH 0/3] BaseTools GCC: pass CC flags to linker

Ard Biesheuvel

On 3 August 2016 at 10:58, Gao, Liming <> wrote:
I see Steven says it doesn't work, yet. So, I am curious what real issue is resolved by this patch?
For example, when building ArmVirtQemu for ARM, you may get warnings
(or errors when -Werror is enabled) like

lto1: warning: switch -mcpu=cortex-a15 conflicts with -march=armv7-a switch

where cortex-a15 is the target set by the platform .DSC, and armv7-a
is the default target of the compiler.
In this particular example, that does not cause any issues, since
cortex-a15 is compatible with armv7-a. However, if you are building
for ARM11, the code generation performed by the linker will generate
incompatible code unless we pass it the -mcpu=arm11 option as well.

The same applies to things like -mstrict-alignment and -mcmodel=xxx. I
suppose the same issue exists for IA32, where the -march/-mcpu options
in the platform may deviate from the compiler's default.


Join to automatically receive all group messages.