Skip to content

Commit a42a15a

Browse files
committed
[build] Allow for per-architecture sysroots
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>
1 parent 6eab3db commit a42a15a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Makefile.housekeeping

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ ifeq ($(CROSS_COMPILE),)
268268
CROSS_COMPILE := $(CROSS_COMPILE_$(ARCH))
269269
endif
270270

271+
# Set cross-compilation sysroot automatically if not specified
272+
ifeq ($(SYSROOT),)
273+
SYSROOT := $(SYSROOT_$(ARCH))
274+
endif
275+
271276
endif # defined(BIN)
272277

273278
###############################################################################

0 commit comments

Comments
 (0)