On Thu, Dec 31, 2015 at 12:01:15PM +0100, Ard Biesheuvel wrote:
> >>> > My GCC manpage claims that
> >>> > "-Os disables the following optimization flags: -falign-functions ..."
> >>> > and -Os is set in GCC_ALL_CC_FLAGS, and as far as I can see not
> >>> > overridden for AARCH64, except for DEBUG builds.
> >>>
> >>> OK, that means we will need to build the RELEASE Shell components with
> >>> -O2 rather than -Os if we ever hit the same issue for RELEASE builds.
> >>> Since those modules are not the ones where we are likely to care
> >>> deeply about code size, this is not a showstopper I think
> >>
> >> Could we move the -falign-functions=4 to DEBUG_GCCnn_AARCH64_CC_FLAGS
> >> instead then, next to the -O0? I'd prefer keeeping dead parameters off
> >> the command line where possible.
> >>
> >> Of course, could make sense to change the DEBUG_GCCnn_AARCH64_CC_FLAGS
> >> to include a common DEBUG_GCC_AARCH64_CC_FLAGS variable where these
> >> are set instead.
> >>
> >
> > Well, since this applies to GCC49 DEBUG only, let's add it only there
> > instead. GCC49 currently means '4.9 or later', and I hope we will not
> > have a need to introduce GCC5 etc, and if that does happen, let's
> > worry about it then.
> >
> 
> I double checked this, and it turns out that -Os implies
> -falign-functions=4, so while it does disable it usually, it does not
> in this particular case.

Well, it does disable it ... it just happens to also be the default
alignment for A64 code with -Os. (For T32 code, it may well default to
-falign-functions=2.) Since the value cannot be changed, it makes no
sense to explicitly have the option on RELEASE builds.

> I will still move it to the DEBUG flags, though, since that is the
> only place we need it.

That still resolves my issue with it, so go for it.

/
    Leif
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to