From ceb7e68c48eafbfa9b735842159e01e8d2123a93 Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Tue, 19 Nov 2019 00:27:13 +0100 Subject: xcompile: Explicitly disable warning address-of-packed-member With GCC 9.x has a new warning *address-of-packed-member*. > -Waddress-of-packed-member > > Warn when the address of packed member of struct or union is > taken, which usually results in an unaligned pointer value. > This is enabled by default. This results in the build errors below, for example, with GCC 9.2 from Debian Sid/unstable. src/southbridge/intel/common/spi.c: In function 'spi_init': src/southbridge/intel/common/spi.c:298:19: error: taking address of packed member of 'struct ich7_spi_regs' may result in an unaligned pointer value [-Werror=address-of-packed-member] 298 | cntlr->optype = &ich7_spi->optype; | ^~~~~~~~~~~~~~~~~ Therefore, explicitly disable the warning. Change-Id: I01d0dcdd0f8252ab65b91f40bb5f5c5e8177a293 Signed-off-by: Elyes HAOUAS Signed-off-by: Paul Menzel Reviewed-on: https://review.coreboot.org/c/coreboot/+/36940 Reviewed-by: Patrick Georgi Reviewed-by: Jacob Garber Tested-by: build bot (Jenkins) --- util/xcompile/xcompile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index f431625878..2d3da1e00e 100755 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -227,7 +227,7 @@ SUBARCH_SUPPORTED+=${TSUPP-${TARCH}} GCC_CC_${TARCH}:=${GCC} GCC_CFLAGS_${TARCH}:=${CFLAGS_GCC} # Generally available for GCC's cc1: -GCC_CFLAGS_${TARCH}+=-Wlogical-op +GCC_CFLAGS_${TARCH}+=-Wlogical-op -Wno-address-of-packed-member GCC_ADAFLAGS_${TARCH}:=${CFLAGS_GCC} GCC_COMPILER_RT_${TARCH}:=${CC_RT_GCC} GCC_COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_GCC} -- cgit v1.2.3