Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 629056 - emerge depclean removes binutils in use, leading to a broken system
Summary: emerge depclean removes binutils in use, leading to a broken system
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-27 12:26 UTC by dtr
Modified: 2017-08-30 15:49 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dtr 2017-08-27 12:26:46 UTC
I’ve just created a new Gentoo installation, finished building the world, and then ran emerge -avc to clean the unnecessary packages. As usual. But depclean removed the sys-devel-binutils-2.28-r2, which was in use by the compiler, and leaving binutils-2.28.1.

After depclean I’ve discovered, that my system cannot build a single package, because of errors like

x86_64-pc-linux-gnu-gcc: error trying to exec 'as': execvp: No such file or directory

during the merge of some userspace library, or this one

checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/sys-devel/libtool-2.4.6-r4/work/libtool-2.4.6':
configure: error: C compiler cannot create executables
See `config.log' for more details

while attempting to recompile libtool.

The issue is in broken symlinks

# LC_TIME=C ls -l /usr/x86_64-pc-linux-gnu/bin/as
lrwxrwxrwx 1 root root 45 Jul 20 07:24 /usr/x86_64-pc-linux-gnu/bin/as -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.28/as

(here ‘as’ was present only in …/2.28.1/ folder). 

The issue was solved thanks to myself. I always compile toolchain twice and the second time – with creating binary packages, so all I had to do is emerge -Kav =binutils-2.28-r2.

I’d like to know, though, what should I do to avoid such breakage in the future, i.e. either prevent binutils in use from deletion, or fix the symlinks for the new binutils? ‘Upgrading GCC’ on Gentoo wiki doesn’t cover this case.
Comment 1 dtr 2017-08-27 12:28:51 UTC
I’ve installed binutils-2.28.1, libtool and gcc from binary packages again, but that didn’t solve the issue (installing binutils-2.28-r2 from the binary package did).
Comment 2 Jory A. Pratt gentoo-dev 2017-08-27 14:10:07 UTC
(In reply to dtr from comment #1)
> I’ve installed binutils-2.28.1, libtool and gcc from binary packages again,
> but that didn’t solve the issue (installing binutils-2.28-r2 from the binary
> package did).

binutils-config -l && binutils-config 2 or whatever version your wanting to set will work.
Comment 3 dtr 2017-08-27 14:17:19 UTC
Oh, thank you.