Red Hat Bugzilla – Bug 1307439
edk2: FTBFS in rawhide
Last modified: 2016-02-15 13:08:40 EST
Your package edk2 failed to build from source in current rawhide.
For details on mass rebuild see https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
Created attachment 1124387 [details]
Created attachment 1124388 [details]
Created attachment 1124389 [details]
The error is:
Sdk/C/LzmaEnc.c: In function 'GetOptimum':
Sdk/C/LzmaEnc.c:1376:9: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
Sdk/C/LzmaEnc.c:1372:7: note: ...this 'if' clause, but it is not
if (repIndex == 0)
cc1: all warnings being treated as errors
Laszlo, do you know if that particular warning is fixed upstream?
If so, suggestion for a particular git commit to rebase Fedora too? Probably doesn't matter much since we are just shipping the tools, but figured I'd ask
I think this is a new warning class that is only detected / emitted by gcc-6. Is that right?
The current upstream edk2 source has the same wart, but it's never been reported, because the latest gcc version upstream edk2 supports is gcc-4.9. (OVMF happens to build with gcc-5.* too, using the gcc-4.9 settings.)
So, I can try to write a patch for this (both upstream & Fedora), which might make this exact warning go away, but there's no telling in advance what else will break -- other new warnings could be triggered, and even runtime issues could surface.
Earlier we saw a case when building BaseTools on ArchLinux, with a pre-6.0, but still "modern", gcc toolchain triggered preexistent undefined behavior in one of the edk2 utilities. The bug was really in the edk2 code, but it lay dormant until it was compiled with the then-newest gcc.
So porting edk2, both BaseTools and the real code, forward to a new compiler release (no matter if it's about Visual Studio, clang / xcode, or gcc), is always a dedicated upstream effort. But, as I said, we can start with a simple patch here; I'll attach it soon.
Created attachment 1126964 [details]
BaseTools: LzmaCompress: eliminate _maxMode and bogus indentation
Can you please test if this builds, Cole? If so, I will submit it to the upstream list. Thanks.
(In reply to Laszlo Ersek from comment #6)
> Created attachment 1126964 [details]
> BaseTools: LzmaCompress: eliminate _maxMode and bogus indentation
> Can you please test if this builds, Cole? If so, I will submit it to the
> upstream list. Thanks.
Yup it works! Thanks a lot Laszlo!
I've built it in rawhide now, so closing