On 17 August 2015 at 19:53, Jordan Justen <jordan.l.jus...@intel.com> wrote:
> On 2015-08-17 07:24:57, Ard Biesheuvel wrote:
>> This got a bit out of hand after I noticed the ELFGCC and UNIXGCC
>> toolchains that needed some tlc as well.
>> Anyway, this series aims to refactor the toolchains definitions for
>> CYGGCC and CYGGCCxASL so that they share as much of the settings as
> UNIXGCC and CYGGCC are GCC 4.3 & mingw based. Did this get tested?

I sent some patches around to bring them up to date:


and with that version, it works fine. GCC 4.3 probably does not work
anymore for X64, since it incorrectly decorates symbol names with
underscores, which the MS ABI only specifies for 32-bit code.

> I think ELFGCC is unused at this point. (And has been since UnixPkg
> was deprecated.)
> I think we should deprecate all three of these toolchains. I would
> like to see us move them to BaseTools/Conf/tools_def.deprecated. I'll
> add Larry to this email, because I think he disagrees with deprecating
> toolchains...

I agree. It makes no sense to have dozens of toolchains when only a
couple are widely used by developers, especially with new features
like the 4 KB alignment for memory permissions that rely on options
that are only passed to some of them.

I already removed ARMGCC and ARMLINUXGCC last week, by the way, but I
don't suppose Larry would care about those?

> If you make these changes and it breaks those toolchains, I don't
> think we would be able to notice, because I don't think we test them
> in our build pool anymore. To me this is all the more reason to move
> them out of tools_def.template.

The only ones I did not test are the CYGGCC ones, which I cannot test
since it obviously only runs under Windows. Everything else seems to
work just fine, including mingw and IPF/ELF, although more coverage is
required of course.


>> possible. Currently, there is very little coordination between these,
>> which means for instance that the 4 KB alignment feature is only supported
>> on GCC4x at the moment.
>> The primary difference between these toolchains is that GCC4x and ELFGCC
>> are entirely ELF based, whereas the other are PE/COFF based (but only when
>> building for IA32 or X64)
>> Note that this series does not remove any toolchains, nor should it result
>> in major changes in the command lines that are passed to the various tools.
>> However, things may be reordered, and (in case of ELFGCC), missing 
>> functionality
>> such as increased section alignment has been added so there are some changes
>> there.
>> Patch #1 is a patch from Scott that I am reposting, but updated to cover
>> AARCH64 as well.
>> Patch #2 fixes a problem in the GenFv tool where it may access unallocated
>> memory while rebasing the FFS when using large section and file alignment.
>> Patch #3 removes an unused DEFINE from tools_def
>> Patch #4 moved some warning flags that were applied to GCC4x 4.6 and up to
>> all GCC versions.
>> Patch #5 is the first big refactor patch that introduces PE and ELF variants
>> for some CC flags.
>> Patch #6 unifies the IA32 and X64 CC flags for all toolchains listed above.
>> Patch #7 fixes the issue mentioned by Bill where the underscore decoration
>> is erroneously applied on X64 as well.
>> Patch #8 is the second refactor the introduces PE and ELF variants for the
>> various DLINK flags.
>> Patch #9 changes the way the start of the .data section is set in 
>> GccBase.lds.
>> This is needed since the linker will reorganize the internal layout of the 
>> .data
>> section rather than update its start address to ensure all objects that it
>> contains meet their respective alignments, even if the start address is not
>> aligned to the max value of all inputs.
>> Patch #10 removes the explicit 64 byte alignment applied to GCC 4.9. The 
>> latest
>> GenFw and linker script propagate the alignment automatically, i.e., if 
>> objects
>> with such alignment requirement are present, GCC will set the ELF header
>> accordingly, and this value will be used for the PE/COFF section alignment
>> as well.
>> Patch #11 unifies the IA32 and X64 linker flags for all toolchains listed 
>> above.
>> Patch #12 unifies the ARM and AARCH64 CC flags, i.e., it removes all the
>> redundant definitions.
>> Patch #13 as #11 but for the linker.
>> Patch #14 unifies the ASM flags for all archs.
>> Patch #15 brings the remaining configuration options of ELFGCC in line with
>> the GCC4x series.
>> Patch #16 is a PoC that allows Ovmf/X64 to be built with 4 KB section 
>> alignment
>> for DXE_RUNTIME modules using UNIXGCC and ELFGCC, as is required to support
>> the properties table memprotection feature.
>> Changes since v1:
>> - added patch #9 to address the IA32 and X86 failures on 4.9 reported by 
>> Scott
>> - don't pass -mno-unaligned-access to ARM 4.6 compiler (Scott)
>> - improved wording of commit messages of various patches
>> - rebased onto latest upstream, which includes a fix related to the ARM 4.6
>>   issue mentioned above
>> Branch can be found here
>> https://git.linaro.org/people/ard.biesheuvel/uefi-next.git/shortlog/refs/heads/unify-gcc-v2
>> Ard Biesheuvel (15):
>>   BaseTools/GenFv: use PE/COFF virtual section size if raw size is
>>     larger
>>   BaseTools GCC: remove unused definition of GCC_WINDRES_FLAGS
>>   BaseTools GCC: merge warning flags for all GCC versions
>>   BaseTools GCC: refactor tools_def internal GCC defines for CC flags
>>   BaseTools GCC: unify all IA32 and X64 CC flags for ELF based GCC
>>   BaseTools GCC: use leading underscore for symbol names where
>>     appropriate
>>   BaseTools GCC: refactor tools_def internal GCC defines for [AS]DLINK
>>   BaseTools GCC: don't set .data address explicitly
>>   BaseTools GCC: remove GCC 4.9 specific linker alignment override
>>   BaseTools GCC: unify all IA32 and X64 [AS]DLINK[2] flags for ELF based
>>     GCC
>>   BaseTools GCC: unify ARM and AARCH64 GCC compiler flags
>>   BaseTools GCC: unify ARM and AARCH64 DLINK flags for all GCC versions
>>   BaseTools GCC: unify ASM flags for all GCC versions
>>   BaseTools GCC: align ELFGCC with GCC4x toolchains
>>   OvmfPkg/X64: enable 4 KB alignment for DXE_RUNTIME modules
>> Scott Duplichan (1):
>>   BaseTools GCC: Fix GCC49 build failure
>>  BaseTools/Conf/tools_def.template           | 412 ++++++++------------
>>  BaseTools/Scripts/GccBase.lds               |   3 +-
>>  BaseTools/Source/C/GenFv/GenFvInternalLib.c |   2 +-
>>  OvmfPkg/OvmfPkgX64.dsc                      |   7 +
>>  4 files changed, 183 insertions(+), 241 deletions(-)
>> --
>> 1.9.1
edk2-devel mailing list

Reply via email to