Skip to content

build: honor TARGET_ARCH for kernel modules#1183

Open
Rohithmatham12 wants to merge 1 commit into
NVIDIA:mainfrom
Rohithmatham12:fix-target-arch-kbuild
Open

build: honor TARGET_ARCH for kernel modules#1183
Rohithmatham12 wants to merge 1 commit into
NVIDIA:mainfrom
Rohithmatham12:fix-target-arch-kbuild

Conversation

@Rohithmatham12

@Rohithmatham12 Rohithmatham12 commented Jun 7, 2026

Copy link
Copy Markdown

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.

Signed-off-by: Rohithmatham12 <rohithmatham@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crosscompilation on F38 x86-64 for AArch64 failure with unrecognized compiler command-line options

1 participant