]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Allow for per-architecture sysroots
authorMichael Brown <mcb30@ipxe.org>
Wed, 21 Jan 2026 12:55:12 +0000 (12:55 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 21 Jan 2026 12:57:18 +0000 (12:57 +0000)
As done for CROSS_COMPILE in commit 8fc11d8 ("[build] Allow for
per-architecture cross-compilation prefixes"), allow a default sysroot
for each architecture to be specified via the SYSROOT_<arch>
variables.  These may then be provided as environment variables,
e.g. using

  export SYSROOT_riscv32=/usr/riscv32-linux-gnu/sys-root

This is particularly useful for architectures such as RISC-V where the
64-bit compiler is also used to build 32-bit binaries, since in those
cases the compiler will default to using the 64-bit sysroot.

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

index c36862bcd07ce97194b046963d5b324ae99605c2..3b6eb03ba1a632e33be4449bef9226d97a44fff1 100644 (file)
@@ -268,6 +268,11 @@ ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE  := $(CROSS_COMPILE_$(ARCH))
 endif
 
+# Set cross-compilation sysroot automatically if not specified
+ifeq ($(SYSROOT),)
+SYSROOT                := $(SYSROOT_$(ARCH))
+endif
+
 endif # defined(BIN)
 
 ###############################################################################