Page Actions
Wiki Actions
User Actions
Submit This Story

Yet Another "C compiler cannot create executables"

I had a power cut yesterday on my laptop. Was doing emerge -uDN world at that time. Then when I emerge again, gcc simply fails:

checking for C compiler default output file name... configure: error: C compiler cannot create executables

Work Around The Issue

Troubled, I called gcc-config -lto see my current gcc link is set correctly

 [1] x86_64-pc-linux-gnu-4.4.5 *

Then I dive into logs,

 tail -10  /var/tmp/portage/sys-devel/gcc-4.4.5/work/build/config.log

And got that:

## confdefs.h. ##
## ----------- ##

#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""

configure: exit 77

Checking gcc…

echo 'int main(){puts("Compiler OK!"); return 0;}' > test.c && cc test.c && ./a.out || echo 'Compiler Broken'

Prints “Compilier OK!”…
Something used by gcc is broken. Then I tried emerge gcc, and got the package that broken:

cannot find shared library: libmpfr.so.4

Then use eix -e mpfr to check…out put is:

[U] dev-libs/mpfr
     Available versions:  2.4.1_p5 2.4.2_p3{tbz2} (~)3.0.0 (~)3.0.0_p3
     Installed versions:  2.4.2_p3{tbz2}(01:01:29 PM 07/03/2010)
     Homepage:            http://www.mpfr.org/
     Description:         library for multiple-precision floating-point computations with exact rounding

This indicated that, my freeze point is on libmpfr upgrading. My system is down just on when portage is removing old mpfr and kicking off new mpfr. Realizing this I refer to http://tinderbox.dev.gentoo.org/default-linux/amd64/dev-libs/ to get a libmpfr binary, and use emerge -g to install the package. And to my suprise libmpfr.so.4 still not showing in /usr/lib.
Then I used a brutal force, link old libmpfr to libmpfr.so.4:

ln -s libmpfr.so.1.2.2 libmpfr.so.4

This time gcc is okay, in no time I emerged libmpfr again, and have it replaced my hand-made link. Note that I disabled “collision-detect” in make.conf to let poratge overwrite collision files, in this case, my hand-made link.

YAY, everyghing is set now…

Discussion

Enter your comment
 
 
blog/2010/11/gcc_err_20101119.txt · Last modified: 2010/11/19 09:18 by MeaCulpa     Back to top
Recent changes RSS feed Creative Commons License Powered by PHP Driven by DokuWiki