From edd222428715125b9ef2a9a8a064fc32a0d0bd24 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sat, 21 Nov 2020 10:53:08 +0000 Subject: Split UI parts out of fwlib for host builds They're not needed on the host (except for tests) and they trigger a bug in GCC 4.9 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49132). This way futility remains buildable with such an old host compiler, even if firmware builds and serious work (with tests) needs a newer compiler. Error message averted (sample): firmware/2lib/2ui_screens.c:17:32: error: initializer element is not constant #define MENU_ITEMS(a) ((struct vb2_menu){ \ ^ firmware/2lib/2ui_screens.c:1231:10: note: in expansion of macro 'MENU_ITEMS' .menu = MENU_ITEMS(diagnostics_memory_items), ^ Change-Id: Ic5bd16e4d252df4297d57c5d41436f4322a1445c Signed-off-by: Patrick Georgi Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2553422 Tested-by: Patrick Georgi Commit-Queue: Patrick Georgi Reviewed-by: Julius Werner --- Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index f508a386..3a30c166 100644 --- a/Makefile +++ b/Makefile @@ -387,24 +387,28 @@ FWLIB_SRCS = \ firmware/2lib/2sha_utility.c \ firmware/2lib/2stub_hwcrypto.c \ firmware/2lib/2tpm_bootmode.c \ - firmware/2lib/2ui.c \ - firmware/2lib/2ui_screens.c \ firmware/lib/cgptlib/cgptlib.c \ firmware/lib/cgptlib/cgptlib_internal.c \ firmware/lib/cgptlib/crc32.c \ firmware/lib/gpt_misc.c \ firmware/lib/vboot_api_kernel.c \ - firmware/lib/vboot_audio.c \ firmware/lib/vboot_kernel.c \ - firmware/lib/vboot_ui_legacy.c \ - firmware/lib/vboot_ui_legacy_clamshell.c \ - firmware/lib/vboot_ui_legacy_menu.c \ - firmware/lib/vboot_ui_legacy_wilco.c \ firmware/lib20/api_kernel.c \ firmware/lib20/kernel.c \ firmware/lib20/misc.c \ firmware/lib20/packed_key.c +# Only add these to firmware and test builds, +# as regular host builds don't need them +$(if ${FIRMWARE_ARCH},FWLIB_SRCS,TESTLIB_SRCS) += \ + firmware/2lib/2ui.c \ + firmware/2lib/2ui_screens.c \ + firmware/lib/vboot_audio.c \ + firmware/lib/vboot_ui_legacy.c \ + firmware/lib/vboot_ui_legacy_clamshell.c \ + firmware/lib/vboot_ui_legacy_menu.c \ + firmware/lib/vboot_ui_legacy_wilco.c + # TPM lightweight command library ifeq (${TPM2_MODE},) TLCL_SRCS = \ @@ -677,7 +681,7 @@ ALL_OBJS += ${FUTIL_OBJS} # Library of handy test functions. TESTLIB = ${BUILD}/tests/test.a -TESTLIB_SRCS = \ +TESTLIB_SRCS += \ tests/test_common.c \ tests/timer_utils.c \ tests/crc32_test.c -- cgit v1.2.1