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


Liming Gao
 

Ard:
Thanks for your detail explain. I understand it. I add my rb for this patch set.


Reviewed-by: Liming Gao <liming.gao@intel.com<mailto:liming.gao@intel.com>>

Thanks
Liming
From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
Sent: Wednesday, August 3, 2016 5:24 PM
To: Gao, Liming <liming.gao@intel.com>
Cc: Zhu, Yonghong <yonghong.zhu@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; edk2-devel@lists.01.org; leif.lindholm@linaro.org; sigmaepsilon92@gmail.com
Subject: Re: [PATCH 0/3] BaseTools GCC: pass CC flags to linker

On 3 August 2016 at 10:58, Gao, Liming wrote:
Ard:
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.

--
Ard.

Join devel@edk2.groups.io to automatically receive all group messages.