In version of portage leading up to 2.1.4, it was possible to detect the version of gcc that was used to compile each package. Running this from with /var/db/pkg /$category/$packagename-$version directory would find the gcc version: bzcat environment.bz2 | awk '/^PATH/ && /gcc-bin/ && !/declare/ { print substr($0, match($0, /gcc-bin/) + 8, 5); exit }' When portage 2.1.4 was emerged on my systems, this stopped working. The gcc version appears nowhere in any of the information saved in /var/db/pkg. Would it be possible to have the pkg_compile method set something like "GCC_VERSION=4.1.2" as it does the compile, so that this is captured into environment.bz2? Reproducible: Always
I guess we can have portage export it. It would be a bit nicer if we could fit it into one of the toolchain eclasses somehow, but maybe that won't be able to cover all the necessary cases.
i'm not sure putting into a toolchain eclass would work as then every ebuild out there would have to explicitly inherit it :/ if you're looking to simply setup some dummy vars for users to hook off of via a sneaky backdoor, then it should be 4 fold: PORTAGE_CC_VERSION=$(${CC:-gcc} --version | head -n1) PORTAGE_CBUILD_VERSION=$(${CBUILD}${CBUILD+-}${CC:-gcc} --version | head -n1) PORTAGE_CHOST_VERSION=$(${CHOST}${CHOST+-}${CC:-gcc} --version | head -n1) PORTAGE_CTARGET_VERSION=$(${CTARGET}${CTARGET+-}${CC:-gcc} --version | head -n1)
*** Bug 238048 has been marked as a duplicate of this bug. ***
Nothing for toolchain to do here...
With gcc-5.3.0 being unstable now the question rises here again how to include that info into "emerge --info"