libpayload: Add compiler.h to compiler parameters
Headers in libpayload define various structs like so: struct struct_name { ... } __packed; However, these header files do not include the compiler.h macro that defines what __packed is, so they are actually defining a variable named __packed and *not* declaring a packed struct. This leads to defining the same variable multiple times, which was caught by GCC 10. Add compiler.h to the compiler parameters so it is included in all files automatically. Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Change-Id: Ia67182520dc94149e06fe9e03a14b3fc2ee29973 Reviewed-on: https://review.coreboot.org/c/coreboot/+/47153 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
parent
3190ba863d
commit
c98baa7a80
|
@ -55,7 +55,8 @@ subdirs-$(CONFIG_LP_CBFS) += libcbfs
|
|||
subdirs-$(CONFIG_LP_LZMA) += liblzma
|
||||
subdirs-$(CONFIG_LP_LZ4) += liblz4
|
||||
|
||||
INCLUDES := -Iinclude -Iinclude/$(ARCHDIR-y) -I$(obj) -include include/kconfig.h
|
||||
INCLUDES := -Iinclude -Iinclude/$(ARCHDIR-y) -I$(obj)
|
||||
INCLUDES += -include include/kconfig.h -include include/compiler.h
|
||||
|
||||
CFLAGS += $(EXTRA_CFLAGS) $(INCLUDES) -Os -pipe -nostdinc -ggdb3
|
||||
CFLAGS += -nostdlib -fno-builtin -ffreestanding -fomit-frame-pointer
|
||||
|
|
|
@ -152,7 +152,8 @@ fi
|
|||
trygccoption -fno-stack-protector
|
||||
[ $? -eq 0 ] && _CFLAGS="$_CFLAGS -fno-stack-protector"
|
||||
|
||||
_CFLAGS="$_CFLAGS -include $BASE/../include/kconfig.h -I`$DEFAULT_CC $_ARCHEXTRA -print-search-dirs | head -n 1 | cut -d' ' -f2`include"
|
||||
_CFLAGS="$_CFLAGS -include $BASE/../include/kconfig.h -include $BASE/../include/compiler.h"
|
||||
_CFLAGS="$_CFLAGS -I`$DEFAULT_CC $_ARCHEXTRA -print-search-dirs | head -n 1 | cut -d' ' -f2`include"
|
||||
|
||||
_LDFLAGS="-L$BASE/../lib -L$_LIBDIR $_LDSCRIPT -static"
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <compiler.h>
|
||||
|
||||
/** These are standard values for the known compression
|
||||
alogrithms that coreboot knows about for stages and
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
#include <libpayload-config.h>
|
||||
#include <compiler.h>
|
||||
#include <cbgfx.h>
|
||||
#include <ctype.h>
|
||||
#include <die.h>
|
||||
|
|
Loading…
Reference in New Issue