Skip to content

linux/efa: Add support for building with Clang/LLVM#366

Open
mjonuschat wants to merge 2 commits into
amzn:masterfrom
mjonuschat:feature/clang
Open

linux/efa: Add support for building with Clang/LLVM#366
mjonuschat wants to merge 2 commits into
amzn:masterfrom
mjonuschat:feature/clang

Conversation

@mjonuschat
Copy link
Copy Markdown

@mjonuschat mjonuschat commented Mar 10, 2026

Issue #, if available: #365

Description of changes:

  • Use ccflags-y instead of KBUILD_CPPFLAGS in conftest Makefile
  • Add Clang/LLVM toolchain support to conftest
    • Pass through make options
    • conditional compiler flags

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

KBUILD_CPPFLAGS is a global kbuild variable. Setting it in an
out-of-tree module Makefile affects all files in the build
invocation, not just the conftest module. Use ccflags-y which
is the correct per-module kbuild idiom.
The conftest Makefile does not forward CC, LD, or LLVM
variables to the sub-make invocation. When the kernel is built
with Clang/LLVM, the conftest module is still compiled with
the system default GCC, potentially detecting the wrong set of
kernel features.

Forward CC, LD, and LLVM to the kbuild sub-make so the conftest
is compiled with the same toolchain as the driver.

Additionally, make the warning flag suppression conditional:
use -Wno-maybe-uninitialized for GCC (which does not exist in
Clang) and -Wno-unused-value for Clang.
@mjonuschat mjonuschat changed the title [Feature] Add support for buildin with Clang/LLVM [Feature] Add support for building with Clang/LLVM Mar 10, 2026
@mjonuschat mjonuschat marked this pull request as ready for review March 10, 2026 12:00
@mjonuschat mjonuschat changed the title [Feature] Add support for building with Clang/LLVM linux/efa: Add support for building with Clang/LLVM Mar 10, 2026
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.

1 participant