Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

build: auto-detect clang/LLVM toolchain from kernel config#20

Open
akoscz wants to merge 1 commit intohmtheboy154:mainfrom
akoscz:cachyos-fixes
Open

build: auto-detect clang/LLVM toolchain from kernel config#20
akoscz wants to merge 1 commit intohmtheboy154:mainfrom
akoscz:cachyos-fixes

Conversation

@akoscz
Copy link
Copy Markdown

@akoscz akoscz commented Feb 3, 2026

Summary

Fixes #19

Auto-detect if the kernel was built with clang by checking CONFIG_CC_IS_CLANG in the kernel's autoconf.h. This ensures the driver is built with the same compiler toolchain as the kernel, which is required for ABI compatibility.

Changes

  • Add compiler detection to Makefile and Makefile.x86
  • Set CC=clang and LLVM=1 flags when clang-built kernel detected
  • Apply compiler-specific warning suppressions (clang vs GCC)
  • Use LLVM_FLAGS variable in Makefile.x86 to reduce duplication

Testing

  • Tested on CachyOS with clang-built 6.18.8-3-cachyos kernel
  • Module builds and loads successfully
  • WiFi connects to 2.4GHz and 5GHz networks

Automatically detect if the kernel was built with clang by checking
CONFIG_CC_IS_CLANG in the kernel's autoconf.h. This ensures the driver
is built with the same compiler toolchain as the kernel, which is
required for ABI compatibility.

Changes:
- Add compiler detection to Makefile and Makefile.x86
- Set CC=clang and LLVM=1 flags when clang kernel detected
- Apply compiler-specific warning suppressions
- Use LLVM_FLAGS variable to reduce duplication

Tested on CachyOS with clang-built 6.18.8-3-cachyos kernel.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails on clang/LLVM-built kernels (e.g., CachyOS)

1 participant