Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 792147 - sys-boot/grub build does not respect CC
Summary: sys-boot/grub build does not respect CC
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-26 03:31 UTC by Manoj Gupta
Modified: 2021-06-20 17:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
grub build log (grub.txt.gz,242.55 KB, application/x-gzip)
2021-05-26 16:43 UTC, Manoj Gupta
Details
Build log (grub-2.06_rc1-20210526-194920.log.gz,157.64 KB, text/plain)
2021-05-26 19:59 UTC, Mike Gilbert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj Gupta 2021-05-26 03:31:24 UTC
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
Comment 1 Mike Gilbert gentoo-dev 2021-05-26 15:46:28 UTC
Please attach a full build log.
Comment 2 Manoj Gupta 2021-05-26 16:43:57 UTC
Created attachment 711399 [details]
grub build log
Comment 3 Mike Gilbert gentoo-dev 2021-05-26 19:59:24 UTC
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.
Comment 4 Mike Gilbert gentoo-dev 2021-06-20 17:48:20 UTC
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.