If both CONFIG_SEPARATE_ROMSTAGE and CONFIG_BOOTBLOCK_CONSOLE are not set, compilation will fail with errors indicating redefinitions of various console methods. When BOOTBLOCK_CONSOLE is not set, the __CONSOLE_ENABLE__ macro in include/console/console.h evaluates to zero when compiling the bootblock, resulting in various console methods being defined as stubs in the header. In a typical build with a separate bootblock and romstage, this will not cause a conflict as the non-stub definitions found in the console/*.c files are added conditionally to the bootblock depending on CONFIG_BOOTBLOCK_CONSOLE. When SEPARATE_ROMSTAGE is not set, the list of romstage objects gets added to the bootblock. Since the console sources were unconditionally added to romstage, the non-stub definitions were able to slip into the bootblock, causing a redefinition of the stubs. Avoid this by conditionally adding these sources to romstage depending on CONFIG_SEPARATE_ROMSTAGE. If SEPARATE_ROMSTAGE is set, the non-stub definitions are handled in the same way as they were before. If it is not set, the union of bootblock and romstage objects will only include the non-stub definitions based on CONFIG_BOOTBLOCK_CONSOLE, which uses existing console/Makefile.mk rules for the bootblock. TEST=qemu-i440fx builds successfully with all possible settings of CONFIG_SEPARATE_ROMSTAGE and CONFIG_BOOTBLOCK_CONSOLE. Change-Id: I59b3f0c52a4338b1573e0a647bc16cec4943fd7f Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/83088 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
44 lines
1.3 KiB
Makefile
44 lines
1.3 KiB
Makefile
## SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
ramstage-y += vtxprintf.c printk.c vsprintf.c
|
|
ramstage-y += init.c console.c
|
|
ramstage-y += post.c
|
|
ramstage-y += die.c
|
|
ifeq ($(CONFIG_HWBASE_DEBUG_CB),y)
|
|
ramstage-$(CONFIG_RAMSTAGE_LIBHWBASE) += hw-debug_sink.ads
|
|
ramstage-$(CONFIG_RAMSTAGE_LIBHWBASE) += hw-debug_sink.adb
|
|
romstage-$(CONFIG_ROMSTAGE_LIBHWBASE) += hw-debug_sink.ads
|
|
romstage-$(CONFIG_ROMSTAGE_LIBHWBASE) += hw-debug_sink.adb
|
|
endif
|
|
|
|
smm-$(CONFIG_DEBUG_SMI) += init.c console.c vtxprintf.c printk.c
|
|
smm-y += die.c
|
|
smm-y += post.c
|
|
|
|
ifneq ($(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),y)
|
|
verstage-y += printk.c
|
|
verstage-y += console.c
|
|
endif
|
|
verstage-y += post.c
|
|
verstage-y += die.c
|
|
verstage-y += init.c
|
|
verstage-y += vtxprintf.c vsprintf.c
|
|
|
|
romstage-$(CONFIG_SEPARATE_ROMSTAGE) += vtxprintf.c printk.c vsprintf.c
|
|
romstage-$(CONFIG_SEPARATE_ROMSTAGE) += init.c console.c
|
|
romstage-y += post.c
|
|
romstage-y += die.c
|
|
|
|
postcar-y += vtxprintf.c vsprintf.c
|
|
postcar-$(CONFIG_POSTCAR_CONSOLE) += printk.c
|
|
postcar-$(CONFIG_POSTCAR_CONSOLE) += init.c console.c
|
|
postcar-y += post.c
|
|
postcar-y += die.c
|
|
|
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += printk.c
|
|
bootblock-y += vtxprintf.c vsprintf.c
|
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += init.c console.c
|
|
bootblock-y += post.c
|
|
bootblock-y += die.c
|
|
|
|
decompressor-y += die.c
|