Re: [PATCH v1] sched_ext: Improve cross-compilation support in Makefile
From: Tejun Heo
Date: Mon Apr 14 2025 - 13:01:32 EST
On Mon, Apr 14, 2025 at 04:14:36PM +0800, yangsonghua wrote:
> Modify the tools/sched_ext/Makefile to better handle cross-compilation
> environments by:
>
> 1. Fix host tools build directory structure by separating obj/ from output
> (HOST_BUILD_DIR now points to $(OBJ_DIR)/host/obj)
> 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
> 5. Change LDFLAGS assignment to += to allow external extensions
>
> 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>
Doesn't break native builds at least. I take your words that this improves
cross-builds. Applied to sched_ext/for-6.16.
Thanks.
--
tejun