Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
"C compiler cannot create executables" !??!
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 10, 11, 12  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Herring42
Guru
Guru


Joined: 10 Mar 2004
Posts: 366
Location: Buckinghamshire

PostPosted: Fri Jul 26, 2013 3:08 pm    Post subject: Reply with quote

gcc-4.6.3 appears to be broken. I've just upgraded, and it's gone bang too :-(
_________________
"The problem with quotes on the internet is that it is difficult
to determine whether or not they are genuine." -- Abraham Lincoln
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31373
Location: 56N 3W

PostPosted: Fri Jul 26, 2013 10:31 pm    Post subject: Reply with quote

NeddySeagoons Rough Guide to Fixing A Badly Broken Toolchain and other emerge -C Oops

Your are reading this because something is badly broken as a result of emerge --depclean, or emerge -C removing soemthing you really wish it hadn't.
A fairly typical case is an old but active gcc being removed by --depclean leaving a perfectly good but not yet active gcc in its place.
This guide is not for you - you only need
Code:
gcc-config
to fix your issue.

If you are still reading you need a binary of something to fix the problem. You need a trusted BINHOST, there are several I would trust.
Or you need your own binary ... do you have
Code:
FEATURES=buildpkg
in make.conf, if you do then you may have your own binary already.
Portage may even install it for you depending on what you did. Look through the packages you have and try
Code:
emerge -K =<package>-<version>

Emerge may be so badly broken it can't deal with binary packages even.

The next install method is to use
Code:
tar xpf /path/to/binary/tarball -C /
which will unpack the binary package, just as if it was a single package stage3 file.
If the tarball was made by portage, you will get a warning about extra garbage at end of file ignored. Thats because tar does not know about the extra portage specific information at the end of the tarball.

Now what if you can't get a trusted binary package?
What if your box won't even boot, say you managed to run
Code:
emerge -C glibc
Don't do that just to test this post.
You can still fix it without outside help and without reinstalling.

In summary, the method involves unpacking a stage3 tarball to a directory, borrowing your /usr/portage from the broken install, copying your /etc/portage/* from the broken install, setting up the new install to save binaries, chrooting into the stage3-in-a-dir and either using quickpkg to package things that already exist in the stage3 or emerge to build them for you, saving the binary packages as it goes.
Unpacking a stage3 to your normal root will destroy your install.

Boot Linux somehow. If you own box boots good, if not, System Rescue CD is a good choice.
Mount your filesystems just like you did for the install, not forgetting /proc and /dev (this is done if your system booted)
Make a directory called repair, somewhere you have a few Gb of free space. You will remove this later.
Lets use /home/repair (this will be /mnt/gentoo/home/repair if you needed to boot with a CD)
cd booted users need to prepend /mnt/gentoo/ everywhere below.

Fetch a stage3 tarball and untar it to /home/repair Do not fetch a portage snapshot
mount /proc and /dev/ to /home/repair/dev /home/repair/proc, almost as the handbook says.
Copy over /etc/resolv.conf into the budding /home/repair chroot. You may need networking.
bind mount your real /usr/portage from the broken install to /home/repair/usr/portage
Copy over /etc/portage to /home/repair

Follow the handbook chroot steps to chroot into /home/repair
Edit make.conf to add buildpkg to FEATURES.
Check its there with
Code:
 emerge --info | grep FEATURES


Do not emerge --sync until the repair is complete and tested. Its important the working 'repair system' matches the install you want to fix.
Whenever you build a package now, a binary of it will be saved to /usr/portage/packages.
Disk wise, due to the bind mount using /usr/portage, its the same place inside and outside the chroot, so packages will be available outside the chroot later.

If a package you need is already in the stage3 at the right version, you may
Code:
emerge gentoolkit
then
Code:
quickpkg <package>

However, it may not match your use flags as you didn't build it.

Make the packages you need, then outside the chroot, use one of the methods outlined above to install them. emerge -K is preferred.

Once your system is working again, you can remove /home/repair.
If you don't make enough at the first attempt then /home/repair will still be there for you to come back to. Its only a gentoo chroot in a dir.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2, 3 ... 10, 11, 12
Page 12 of 12

 
Jump to:  
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