Re: [PATCH v2] tools/sched_ext: Improve cross-compilation support in Makefile

From: Tejun Heo
Date: Tue Apr 15 2025 - 11:00:29 EST


On Tue, Apr 15, 2025 at 01:46:42PM +0800, yangsonghua wrote:
> Modify the tools/sched_ext/Makefile to better handle cross-compilation
> environments by:
>
> 1. Adjusted `HOST_OUTPUT_DIR` to be relative to `$(OBJ_DIR)`, ensuring
> correct path handling during host tool building when cross-compile
> (HOST_OUTPUT_DIR now points to $(OBJ_DIR)/host-tools)
> 2. Properly propagate CROSS_COMPILE to libbpf sub-make invocation
> 3. Add missing $(HOST_BPFOBJ) build rule with proper host toolchain flags
> (ARCH=, CROSS_COMPILE=, explicit HOSTCC/HOSTLD)
> 4. Consistently quote $(HOSTCC) in bpftool build rule
>
> The changes ensure proper cross-compilation behavior while maintaining
> backward compatibility with native builds. Host tools are now correctly
> built with the host toolchain while target binaries use the cross-toolchain.
>
> Signed-off-by: yangsonghua <yangsonghua@xxxxxxxxxxx>

I already applied v1, so please send the updates as incremental changes
atop.

Thanks.

--
tejun