From 3d91b47b425ffb880c0ed6c45fd04ba48d95ca8d Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Wed, 15 Sep 2021 14:52:45 +0200 Subject: libpayload: Add mock architecture Mock architecture can be used to build libpayload using host compiler. It can be enabled by setting ARCH_MOCK=y in the dotconfig. It sets LITTLE_ENDIAN=y, as most machines these days use little-endian CPUs. Libpayload will use HOSTCC as CC, HOSTLD as LD, etc. instead of tools provided by xcompile. Mock architecture configuration can be used by payloads for testing purposes. Thanks to it, tests can be architecture-independent, and can be executed without requiring compatible Kconfig options, e.g. ARCH_ARM64=y for ARM64 machine. However, one has to provide implementation for most architecture-specific functions present in arch/* directories. Signed-off-by: Jakub Czapiga Change-Id: Ie3a6e6f6cad2f8a2e48a8e546d3b79c577653080 Reviewed-on: https://review.coreboot.org/c/coreboot/+/57708 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- payloads/libpayload/arch/mock/Makefile.inc | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 payloads/libpayload/arch/mock/Makefile.inc (limited to 'payloads/libpayload/arch/mock/Makefile.inc') diff --git a/payloads/libpayload/arch/mock/Makefile.inc b/payloads/libpayload/arch/mock/Makefile.inc new file mode 100644 index 0000000000..f15f0f9f1d --- /dev/null +++ b/payloads/libpayload/arch/mock/Makefile.inc @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-only + +head.o-y += head.c + +libc-y += virtual.c + +libcbfs-$(CONFIG_LP_CBFS) += mock_media.c -- cgit v1.2.3