open-gpu-kernel-modules
open-gpu-kernel-modules copied to clipboard
build: honor TARGET_ARCH for kernel modules
Summary
- Use TARGET_ARCH as the default Kbuild architecture when ARCH is not explicitly set.
- Normalize TARGET_ARCH=aarch64 to Kbuild ARCH=arm64, matching the README cross-build command.
- Keep explicit ARCH=... unchanged for callers that already pass it directly.
Fixes #541.
Testing
- git diff --check main..fix-target-arch-kbuild
- make -C kernel-open -n modules TARGET_ARCH=aarch64 CC=aarch64-linux-gnu-gcc LD=aarch64-linux-gnu-ld AR=aarch64-linux-gnu-ar CXX=aarch64-linux-gnu-g++ OBJCOPY=aarch64-linux-gnu-objcopy
- Confirmed the generated Kbuild invocation includes ARCH=arm64. The dry run stops afterward in this macOS workspace because /lib/modules/25.5.0/build is not present.