]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[linux] Allow a sysroot to be specified via SYSROOT=...
authorMichael Brown <mcb30@ipxe.org>
Sun, 15 Sep 2024 01:07:45 +0000 (02:07 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 15 Sep 2024 09:01:35 +0000 (10:01 +0100)
The cross-compiler will typically use the appropriate sysroot
directory automatically.  This may not work for toolchains where a
single cross-compiler is used to produce output for multiple CPU
variants (e.g. 32-bit and 64-bit RISC-V).

Add a SYSROOT=... parameter that may be used to specify the relevant
sysroot directory, e.g.

 make CROSS=riscv64-linux-gnu- SYSROOT=/usr/riscv32-linux-gnu/sys-root \
      bin-riscv32-linux/tests.linux

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile.linux

index b278c8c0d940ed757127a67ae2aba55e6279759a..762437af53d69fc0a2a2def0cfab321e5d1fc6fc 100644 (file)
@@ -29,6 +29,9 @@ NON_AUTO_MEDIA = linux
 # Compiler flags for building host API wrapper
 #
 LINUX_CFLAGS   += -Os -idirafter include -DSYMBOL_PREFIX=$(SYMBOL_PREFIX)
+ifneq ($(SYSROOT),)
+LINUX_CFLAGS   += --sysroot=$(SYSROOT)
+endif
 
 # Check for libslirp
 #