View previous topic :: View next topic |
Author |
Message |
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Thu Jan 01, 2015 7:45 pm Post subject: mini-HOWTO: repairing a broken toolchain without binpkgs |
|
|
Just thought I'd write this down for the benefit of others...
Boring background details:
I was trying to update GCC 4.8.3 -> 4.8.4 on one machine using `cave resolve -1x gcc`.
It gets all the way to the end, then fails halfway through unmerging the old version (as it has been doing for weeks now - who's supposed to be QA'ing this?)
Usually I clean up the wreckage by doing `gcc-config -l 2; source /etc/profile; cave resolve -1x gcc` and waiting for it all over again, but today I tried to be clever. So I ran `cave resolve -1x gcc --skip-until-phase src_install`.
Oh wait, that was wrong, let's try again with `--skip-until-phase merge`... Whoops, too late.
The first command dutifully cleaned up the build dir and exited, and the second one did exactly as it was instructed and skipped the compile, merged all 0 files it found, and removed the old gcc entirely.
======
So, I have a borked machine with no GCC and no libstdc++.so.6.
I do have another machine and plenty of options, so I did this:
Code: | mkdir /mnt/remote
sshfs root@$remote_machine:/ /mnt/remote
# I tried NFS first here but mount.nfs kept hanging; sshfs will work just as well though.
DISTDIR=$local_distdir emerge --fetchonly gcc
# I'm not sure what's going on here, but portage gets horribly confused when $ROOT is used and it tries to download files.
# Making sure both sides have all the distfiles beforehand fixed it.
DISTDIR=$local_distdir ROOT=/mnt/remote CFLAGS="-O2 -pipe -march=$remote_cpu" emerge -av gcc
# I used -march=btver1 from a -march=amdfam10 host here without problems, it should be safe as long as $(uname -m) is the same.
ssh root@$remote_machine gcc-config -l
[1] x86_64-pc-linux-gnu-4.8.4 * |
And it works! |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Thu Jan 01, 2015 8:48 pm Post subject: |
|
|
Yay for emerge ;)
sshfs is cool yeah; you can use it for distfiles on a LAN-server, too, though I've forgotten most of that setup, and didn't write it up. |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Jan 02, 2015 3:14 am Post subject: |
|
|
I should've been more specific: once things seem to work, rebuild the affected packages properly!
I didn't do that, and went off to update @world, then started getting a few "weird" segfaults in C++ binaries. An emerge -e on their owning packages straightened that all out, but it burned a few hours of CPU time.
Well in any case this could've gone worse; I got to test my backup plans if nothing else
----
edit: hmm, maybe I *was* right. I'm getting exactly the same segfault on a totally unrelated remote server... |
|
Back to top |
|
|
yoshi314 l33t
Joined: 30 Dec 2004 Posts: 850 Location: PL
|
Posted: Mon Jan 05, 2015 1:50 pm Post subject: |
|
|
interestingly i had the same problem with unmerge of gcc, i thought it was power failure.
in my case i just switched gcc with gcc-config and assumed that old version was uninstalled already. That was enough to restore libstdc++ and get things running. _________________ ~amd64
shrink your /usr/portage with squashfs+aufs |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|