[coreboot] Cbfstool compilation error with gcc 5.1

Stefan Reinauer stefan.reinauer at coreboot.org
Thu Jun 11 03:38:42 CEST 2015


* 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.
> 
> ==> 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