]> git.proxmox.com Git - mirror_edk2.git/commit - BaseTools/Conf/tools_def.template
BaseTools GCC5: disable warnings-as-errors for now
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 2 Aug 2016 14:15:31 +0000 (16:15 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 3 Aug 2016 15:41:54 +0000 (17:41 +0200)
commitf8d0b9662993796e89c200e9eaf38d1f54e5dd37
tree8205a27a94e4ff742a26af70b932dada563194fe
parent108c5b601860af0c3752d37e58e573e79a69c081
BaseTools GCC5: disable warnings-as-errors for now

GCC5 runs in LTO mode, which means it may generate code from an
intermediate representation during the link stage, at which time
additional diagnostics are run that may emit warnings.

Some of these warnings seem to be spurious, e.g., the following
warning which is emitted when building OVMF for IA32 or ArmVirtQemu
for ARM (but not for X64 resp. AARCH64)

  .../MdeModulePkg/Library/UefiHiiLib/HiiLib.c:
                 In function 'HiiCreateGuidOpCode.constprop':
  .../MdeModulePkg/Library/UefiHiiLib/HiiLib.c:3228:10:
                 error: function may return address of local variable
                                            [-Werror=return-local-addr]
     return (UINT8 *)OpCodePointer;
            ^
  .../MdeModulePkg/Library/UefiHiiLib/HiiLib.c:3208:17: note: declared here
     EFI_IFR_GUID  OpCode;
                   ^
  lto1: all warnings being treated as errors
  lto-wrapper: fatal error: gcc returned 1 exit status

So before adding the contents of CC_FLAGS to the linker command line,
defuse the default '-Werror' by adding '-Wno-error' to DLINK2_FLAGS
for GCC5.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Conf/tools_def.template