diff options
author | Jakub Czapiga <jacz@semihalf.com> | 2021-09-15 14:52:45 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-10-11 12:59:57 +0000 |
commit | 3d91b47b425ffb880c0ed6c45fd04ba48d95ca8d (patch) | |
tree | 828ac9be4df77c66c9f06435f560e5124db0f9f9 /payloads/libpayload/sample/Makefile | |
parent | b40fdbaa648639c2922732e2fa137c3ebcc78e4e (diff) |
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 <jacz@semihalf.com>
Change-Id: Ie3a6e6f6cad2f8a2e48a8e546d3b79c577653080
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57708
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'payloads/libpayload/sample/Makefile')
-rw-r--r-- | payloads/libpayload/sample/Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/payloads/libpayload/sample/Makefile b/payloads/libpayload/sample/Makefile index 637e45dee1..1249e9a017 100644 --- a/payloads/libpayload/sample/Makefile +++ b/payloads/libpayload/sample/Makefile @@ -26,8 +26,13 @@ ## SUCH DAMAGE. ## + # Sample libpayload Makefile. include ../.config +ifeq ($(CONFIG_LP_ARCH_MOCK),y) +$(error This sample program does not support ARCH_MOCK. Use sample/arch_mock instead) +endif + include ../build/xcompile ARCH-$(CONFIG_LP_ARCH_ARM) := arm |