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
Open
build: auto-detect clang/LLVM toolchain from kernel config#20akoscz wants to merge 1 commit intohmtheboy154:mainfrom
akoscz wants to merge 1 commit intohmtheboy154:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #19
Auto-detect if the kernel was built with clang by checking
CONFIG_CC_IS_CLANGin the kernel'sautoconf.h. This ensures the driver is built with the same compiler toolchain as the kernel, which is required for ABI compatibility.Changes
MakefileandMakefile.x86CC=clangandLLVM=1flags when clang-built kernel detectedLLVM_FLAGSvariable inMakefile.x86to reduce duplicationTesting
6.18.8-3-cachyoskernel