Re: [edk2] GCC 4.9 build issue - Re: Error building OvmfPkg

Subject: Re: [edk2] GCC 4.9 build issue - Re: Error building OvmfPkg

From: Andrew Fish <afish@apple.com>

To: Jordan Justen <jljusten@gmail.com>

Date: 2014-07-21 22:44:40


On Jul 21, 2014, at 2:42 PM, Jordan Justen  wrote:

> On Sun, Jul 20, 2014 at 9:28 AM, Andrew Fish  wrote:
>> On Jul 19, 2014, at 9:42 PM, Jordan Justen  wrote:
>>> Anyway, I figured out what the issue is, but I don't have a solution yet.
>>> https://gcc.gnu.org/ml/gcc-help/2014-07/msg00075.html
>>> 
>>> Basically GCC 4.9 creates a 64-byte aligned section in the elf image,
>>> but we instruct the linker to use 32 byte alignment. Then GenFw (which
>>> also assumes 32 byte alignment) complains while trying to convert the
>>> ELF image to PE/COFF.
>>> 
>> 
>> The default alignment for image  (PE/COFF, ELF, etc.) sections is usually 4K (page aligned).  We cranked the alignment down to 32 bytes (0x20) to make the images smaller. There  is nothing magic about 32 bytes, it was just the smallest alignment we could make work with VC++.
>> 
>> I think if you set the section alignment to 64 bytes everything would just work.
>> 
>> I think that means you would need a different linker script fro GCC 4.9.
>> https://svn.code.sf.net/p/edk2/code/trunk/edk2/BaseTools/Scripts/gcc4.4-ld-script
> 
> Ok. I'll do this.
> 
> If we find a way to get GCC 4.9 to cap the alignment at 32 bytes, then
> we can adjust the toolchain to save some space.
> 

Is it all CPU architectures? Maybe you only need to change the ones that fail?

Thanks,

Andrew Fish

> Thanks,
> 
> -Jordan


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel