From 68db9a3cb3d73aae83ee4b7a0cbe9c69d7f32482 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 15 Sep 2024 02:07:45 +0100 Subject: [linux] Allow a sysroot to be specified via SYSROOT=... 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 --- src/Makefile.linux | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Makefile.linux') diff --git a/src/Makefile.linux b/src/Makefile.linux index b278c8c0d..762437af5 100644 --- a/src/Makefile.linux +++ b/src/Makefile.linux @@ -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 # -- cgit v1.2.3-55-g7522 From 3befb5eb57cb87c550d382d9ee431d9b6c3366fe Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 27 Apr 2025 23:36:34 +0100 Subject: [linux] Enable compiler warnings when building the linux_api.o object Signed-off-by: Michael Brown --- src/Makefile.linux | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Makefile.linux') diff --git a/src/Makefile.linux b/src/Makefile.linux index 762437af5..67afd4244 100644 --- a/src/Makefile.linux +++ b/src/Makefile.linux @@ -29,9 +29,13 @@ NON_AUTO_MEDIA = linux # Compiler flags for building host API wrapper # LINUX_CFLAGS += -Os -idirafter include -DSYMBOL_PREFIX=$(SYMBOL_PREFIX) +LINUX_CFLAGS += -Wall -W ifneq ($(SYSROOT),) LINUX_CFLAGS += --sysroot=$(SYSROOT) endif +ifneq ($(NO_WERROR),1) +LINUX_CFLAGS += -Werror +endif # Check for libslirp # -- cgit v1.2.3-55-g7522