This Time Self-Hosted
dark mode light mode Search

confcache and crossdist workaround

Today I found out that one of the issue of using confcache is when an ebuild exports CC/CXX variables to allow crosscompilation and/or cross-distcc. Basically on a normal ebuild CC is simply unset, and the configure takes care of finding out the right compiler as ${CHOST}-gcc; when an ebuild is using an old version of autotools, for crosscompile sake it’s usually needed to pass the right CC compiler to econf, by using toolchain-funcs functions, such as tc-getCC; an alternative is to use tc-export CC that just exports a CC variable.
When confcache passes from a normal ebuild to an “exporter” ebuild, the cache gets invalidated because CC differs (unset versus ${CHOST}-gcc), thus confcache is useless. The same goes when it passes from an exporter to a normal ebuild, as then it’s ${CHOST}-gcc versus unset.

I discussed with Brian a way to avoid this, but he’s filled with work and it will probably take a bit to fix this mess. In the mean time I’m testing a workaround…

This is unsupported experimental workaround, don’t cry if this will break, it will probably happen; I won’t guarantee it to work in any case, wine is probably the first package to break with it, but it might work and help you a bit while a better solution can be found

The trick is simple, just set inside make.conf:


CC=“${CHOST}-gcc”
CXX=“${CHOST}-g++”
LD=“${CHOST}-ld”
AR=“${CHOST}-ar”
RANLIB=“${CHOST}-ranlib”
CPP=“${CHOST}-gcc -E”

leave ${CHOST} as it is, as that would probably be expanded by portage and might work with wine then.
This method has the side effect to let also cross-distcc use the right compilers, without manual ebuild tweaking (thing that I’ve been doing for a while now).

While it’s unsupported, I’d like to hear from someone who dares to test how does it go..

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.