Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 725878

Summary: kernel-2.eclass: set HOSTCC (was: sys-kernel/linux-headers calls cc directly)
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel>
Status: RESOLVED FIXED    
Severity: normal CC: toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=720698
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 243502    
Attachments: build.log

Description Agostino Sarubbo gentoo-dev 2020-05-28 12:33:28 UTC
This is an auto-filed bug because sys-kernel/linux-headers calls cc directly.
The issue was originally discovered on s390, but it may be reproducible on other arches as well.
If you think that a different summary clarifies the issue better, feel free to change it.
Attached build log and emerge --info.

NOTE:
If you think it doesn't make sense fix these type of issues, I'd like to point out that won't be possible use a different CC implementation (like clang) by setting the CC variable. So this issue has been reproduced by setting the CC variable to s390x-ibm-linux-gnu-gcc and by removing the /usr/bin/cc - /usr/bin/gcc binaries.
Comment 1 Agostino Sarubbo gentoo-dev 2020-05-28 12:33:33 UTC
Created attachment 642362 [details]
build.log

build log and emerge --info
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-28 18:16:50 UTC
That comes from kernel-2.eclass. I think kernel-2.eclass should set something like HOSTCC="$(gc-getBUILD_CC)".
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-30 12:26:25 UTC
Ended up being easier that I though. The following seems to be enough:

--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -712,6 +712,7 @@ env_setup_xmakeopts() {
 	elif type -p ${CHOST}-ar > /dev/null ; then
 		xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
 	fi
+	xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)"
 	export xmakeopts
 }

Sent fore review as: https://archives.gentoo.org/gentoo-dev/message/6a616f98f142191ff3739998bd3136bb

Lightly tested for native and cross cases.
Comment 4 Mike Pagano gentoo-dev 2020-06-02 18:42:41 UTC
(In reply to Sergei Trofimovich from comment #3)
> Ended up being easier that I though. The following seems to be enough:
> 
> --- a/eclass/kernel-2.eclass
> +++ b/eclass/kernel-2.eclass
> @@ -712,6 +712,7 @@ env_setup_xmakeopts() {
>  	elif type -p ${CHOST}-ar > /dev/null ; then
>  		xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
>  	fi
> +	xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)"
>  	export xmakeopts
>  }
> 
> Sent fore review as:
> https://archives.gentoo.org/gentoo-dev/message/
> 6a616f98f142191ff3739998bd3136bb
> 
> Lightly tested for native and cross cases.

++