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

Bug 603776

Summary: toolchain.eclass: should_we_gcc_config always returns true if CHOST is missing in /etc/portage/make.conf
Product: Gentoo Linux Reporter: Mike Gilbert <floppym>
Component: EclassesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Mike Gilbert gentoo-dev 2016-12-26 17:38:31 UTC
I noticed that my system gcc version was always being reset when upgrading gcc. 

Adding a set -x statement to the top of should_we_gcc_config reveals a problem:

+ local curr_config
++ env -i ROOT=/ gcc-config -c x86_64-pc-linux-gnu
+ curr_config=' * Python seems to be broken, attempting to locate CHOST ourselves ...
 * gcc-config: Could not get portage CHOST!
 * gcc-config: You should verify that CHOST is set in one of these places:
 * gcc-config:  - //etc/portage/make.conf
 * gcc-config:  - active environment'
+ return 0


The env -i causes CHOST to be unset, which causes gcc-config to fall back on parsing make.conf.

make.conf on my system does not contain a CHOST setting; instead, I rely on the CHOST setting from the amd64 profile.

An easy solution here is to pass CHOST in via the environment. I will send a patch for review shortly.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-02-13 23:24:38 UTC
Should have been fixed by:
    https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6526608cbdb8202bc69aaaedd19f773ef651862c