Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 725878 - kernel-2.eclass: set HOSTCC (was: sys-kernel/linux-headers calls cc directly)
Summary: kernel-2.eclass: set HOSTCC (was: sys-kernel/linux-headers calls cc directly)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: tc-directly
  Show dependency tree
 
Reported: 2020-05-28 12:33 UTC by Agostino Sarubbo
Modified: 2020-06-03 07:58 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,8.41 KB, text/plain)
2020-05-28 12:33 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
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 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 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.

++