[coreboot] Cbfstool compilation error with gcc 5.1

Anatol Pomozov anatol.pomozov at gmail.com
Sat Jul 11 02:42:25 CEST 2015


Hi

Sorry for a long delay

On Wed, Jun 10, 2015 at 6:38 PM, Stefan Reinauer
<stefan.reinauer at coreboot.org> wrote:
> * Anatol Pomozov <anatol.pomozov at gmail.com> [150531 08:49]:
>> Hi
>>
>> I am trying to compile coreboot cbfstool on Arch where gcc 5.1 is used. And I
>> see following compilation error. I wonder if it is coreboot or gcc issue.

That's indeed looks like a false positive from GCC 5.1. And it happens
only if "-O2" flag present.

Here is what Ron proposed and it makes GCC happy again
http://review.coreboot.org/#/c/10881/

>>
>> ==> Starting build()...
>> make: Entering directory '/home/anatol/sources/archpackages/coreboot-utils-git/
>> src/coreboot/util/cbfstool'
>> mkdir -p ./
>> cc -D_FORTIFY_SOURCE=2 -D_DEFAULT_SOURCE  -D_POSIX_C_SOURCE=200809L  -Iflashmap
>> -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=
>> ssp-buffer-size=4 -g3 -std=c99 -Werror -Wall -Wextra -Wcast-qual
>> -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes
>> -Wwrite-strings -c -o rmodule.o rmodule.c
>> rmodule.c: In function ‘rmodule_create’:
>> rmodule.c:286:29: error: ‘phdr’ may be used uninitialized in this function
>> [-Werror=maybe-uninitialized]
>>         (phdr->p_vaddr + phdr->p_memsz))) {
>>                              ^
>> rmodule.c:203:14: note: ‘phdr’ was declared here
>>   Elf64_Phdr *phdr;
>>               ^
>> cc1: all warnings being treated as errors
>> Makefile:55: recipe for target 'rmodule.o' failed
>> make: *** [rmodule.o] Error 1
>> make: Leaving directory '/home/anatol/sources/archpackages/coreboot-utils-git/
>> src/coreboot/util/cbfstool'
>> ==> ERROR: A failure occurred in build().
>
> Looks like a false positive. ctx-phdr only gets passed on if nelements
> is 1, in which we know that phdr was set.
>
> Stefan
>



More information about the coreboot mailing list