grub does not completely respect CC when building. It starts with using CC and switches to gcc later on. Reproducible: Always Steps to Reproduce: 1.sudo 'CC=clang' emerge grub >& /tmp/grub.log 2. Look at grub.log grepping for gcc Initially it is ok checking for x86_64-pc-linux-gnu-gcc... clang checking for x86_64-pc-linux-gnu-gcc... clang But later: checking for gcc... gcc gcc -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -m64 -freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -msoft-float -fno-dwarf2-cfi-asm -mno-stack-arg-probe -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=large -mno-red-zone -Qn -fno-stack-protector -Wtrampolines -ffreestanding -O2 -pipe -m64 -Wl,-melf_x86_64 -Wl,--build-id=none -nostdlib -Wl,-N -Wl,-r,-d -o macbless.module commands/macbless_module-macbless.o Actual Results: gcc is being used instead of clang as CC. Expected Results: gcc should not be used for compilation. Adding TARGET_CC="$(tc-getCC)" to configure fixes it e.g. https://github.com/gentoo/gentoo/pull/16178
Please attach a full build log.
Created attachment 711399 [details] grub build log
Created attachment 711414 [details] Build log You are using an ebuild from the chromiumos repository. It is likely this ebuild behaves differently from the one in the gentoo repository. There are also differences in eclasses that may contribute to differing behavior. I attempted to reproduce the issue by running the following command in the gentoo repo: > CC=clang CXX=clang ebuild grub-2.06_rc1.ebuild clean compile It looks like clang is used for all compile statements. I don't see gcc being invoked anywhere. The build log is attached.
I suspect this is an issue with the ChromiumOS fork, so I am closing this as INVALID. If you can reproduce the issue on Gentoo, or determine another root cause, feel free to re-open this.