BiggieStylin Evil Genius. Love it/Hate it.

1Nov/071

Gentoo stage1 install & ccache

Today I was trying to get Gentoo installed on my desktop from a stage1. I wanted the ccache feature enabled, but kept getting errors like the compiler couldn't create executables and such. I went and did a little digging in the Gentoo forums but ended up finding nothing. It then dawned on me what was wrong after retrying without ccache.

When you first emerge ccache, it automatically creates symlinks to itself for your CHOST setting. That means that in /usr/lib/ccache/bin I had i686-pc-linux-gnu-gcc symlinks to ccache. That's why compiles were failing, the compiler didn't exist on my system, but ccache was trying to use it like it did. The simple solution was to run:
ccache-config --remove-links i686-pc-linux-gnu
After using this, things were compiling again using ccache. I do want to note that after sys-devel/gcc emerges during bootstrapping, you'll loose ccache because it will now use the new i686-pc-linux-gnu-gcc compiler instead of ccache. All I did to fix this was pause my bootstrap using Ctrl+Z, then type the command
ccache-config --install-links i686-pc-linux-gnu
and then typed in %1 to resume the boostrap job I just paused. I can't prove that this made it use ccache again, but it eased my mind.

So, to sum it up, if you want ccache when compiling from a stage one, you must use
ccache-config --remove-links i686-pc-linux-gnu
first, then
ccache-config --install-links i686-pc-linux-gnu
after sys-devel/gcc has emerged to make sure ccache works with your new compiler. Hope that helps someone out there!

Posted by Eric

Comments (1) Trackbacks (0)
  1. This solved my problem…


Leave a comment

(required)

* Copy this password:

* Type or paste password here:

2,212 Spam Comments Blocked so far by Spam Free Wordpress

No trackbacks yet.