open-gpu-kernel-modules icon indicating copy to clipboard operation
open-gpu-kernel-modules copied to clipboard

build: honor TARGET_ARCH for kernel modules

Open Rohithmatham12 opened this issue 5 months ago • 0 comments

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.

Rohithmatham12 avatar Jun 07 '26 01:06 Rohithmatham12