On 11/03/14 20:54, Bruce Cran wrote:
> On 11/3/2014 9:21 AM, Laszlo Ersek wrote:
> 
>> So Scott's patch seems to be aligned with the
>> tradition. (Currently no gcc optimizations are enabled at all when
>> building for X64, neither for speed nor for size.)
> 
> Doesn't the following cause X64 builds to use -Os (and IA32 to use -O2, 
> if it wasn't overridden by -Os by later, version-specific flags)?
> 
> DEFINE GCC_ALL_CC_FLAGS            = -g -Os -fshort-wchar 
> -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -c -include AutoGen.h
> 
> DEFINE GCC_IA32_CC_FLAGS           = DEF(GCC_ALL_CC_FLAGS) -m32 
> -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 
> -mno-stack-arg-probe
> 
> DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone 
> -Wno-address -mno-stack-arg-probeq
> 

No; GCC_X64_CC_FLAGS is an "internal use" define. Its name doesn't
follow the

  (DEBUG|RELEASE|NOOPT)_<TOOLCHAIN>_<ARCH>_CC_FLAGS

pattern, hence it has no direct effect. It only has an effect via
assignment to macros that *do* follow the above pattern, and such
assignments don't seem to exist (for the cases that we presently care
about):

*_GCC44_X64_CC_FLAGS             = DEF(GCC44_X64_CC_FLAGS)
*_GCC45_X64_CC_FLAGS             = DEF(GCC45_X64_CC_FLAGS)
*_GCC46_X64_CC_FLAGS             = DEF(GCC46_X64_CC_FLAGS)
*_GCC47_X64_CC_FLAGS             = DEF(GCC47_X64_CC_FLAGS)
*_GCC48_X64_CC_FLAGS             = DEF(GCC48_X64_CC_FLAGS)
*_GCC49_X64_CC_FLAGS             = DEF(GCC49_X64_CC_FLAGS)

The RHS macros all chain to GCC44_ALL_CC_FLAGS (recursively), which is
ultimately open-coded as:

DEFINE GCC44_ALL_CC_FLAGS            = -g -fshort-wchar
-fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections
-fdata-sections -c -include AutoGen.h
-DSTRING_ARRAY_NAME=$(BASE_NAME)Strings

In short, GCC_X64_CC_FLAGS is not used where it would matter (for this
case).

Thanks
Laszlo


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to