Thanks for your detail explain. I understand it. I add my rb for this patch set.
Reviewed-by: Liming Gao <firstname.lastname@example.org<mailto:email@example.com>>
From: Ard Biesheuvel [mailto:firstname.lastname@example.org]
Sent: Wednesday, August 3, 2016 5:24 PM
To: Gao, Liming <email@example.com>
Cc: Zhu, Yonghong <firstname.lastname@example.org>; Justen, Jordan L <email@example.com>; firstname.lastname@example.org; email@example.com; firstname.lastname@example.org
Subject: Re: [PATCH 0/3] BaseTools GCC: pass CC flags to linker
On 3 August 2016 at 10:58, Gao, Liming wrote:
Ard: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.