New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcc invoked even with passing CC=clang to make #1303
Comments
CC is used for compiling the kernel, HOSTCC is used for compiling the host utilities like the |
Yes; you should either be doing: $ make CC=clang HOSTCC=clang ... or $ make LLVM=1 ... |
@tstellar
Cannot speak for Red Hat based distros, but Debian offers the opportunity to co-install several To fullfill and as a workaround I added to my linux-kernel build-script: ### GCC and LLVM version settings
GCC_MAJOR_VER="10"
LLVM_MAJOR_VER="12"
### LLVM toolchain path options
# Explicitly set PATH to simplify LLVM=1 handling (see LLVM tools options)
# Option-1: Use system's LLVM toolchain
# Option-2: Use selfmade LLVM toolchain (here: ThinLTO+PGO optimized via tc-build)
# Option-3: Set custom PATH in ~/.bashrc
##LLVM_TOOLCHAIN_PATH="/usr/lib/llvm-${LLVM_MAJOR_VER}/bin"
LLVM_TOOLCHAIN_PATH="/opt/llvm-toolchain/bin"
if [ -d ${LLVM_TOOLCHAIN_PATH} ]; then
export PATH="${LLVM_TOOLCHAIN_PATH}:${PATH}"
fi XXX: TODO: Distinguish install-path for misc selfmade llvm-toolchain-XX? Each time I want to test something in bash with my selfmade LLVM toolchain v12.0.0-rc1 and Currently, I switched to and use my selfmade Why a selfmade LLVM toolchain?
I would like to have an whatever option to pass a custom [1] https://www.kernel.org/doc/html/latest/kbuild/llvm.html#llvm-utilities |
@dileks In Fedora, we just ship one version of the clang/llvm toolchain. We do provide compatibility packages with older versions of the clang/llvm libraries, but without the executables, like clang, llc, etc. |
@tstellar |
@tstellar please reopen if you still observe GCC invoked when building via |
I'm trying to build the Fedora kernel with clang and the build system is still invoking gcc even when I pass CC=clang to make. The failing command is:
/usr/bin/make V=1 CC=clang 'HOSTCFLAGS=-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong -fcommon -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'HOSTLDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,now ' ARCH=x86_64 olddefconfig
gcc: error: unrecognized command-line option '--config'; did you mean '-mpconfig'?
make[1]: *** [scripts/Makefile.host:95: scripts/basic/fixdep] Error 1
make: *** [Makefile:539: scripts_basic] Error 2
The Fedora build scripts runs a lot of commands before this, so I've attached the full build.log.
The text was updated successfully, but these errors were encountered: