Hi, On Wed, May 18, 2011 at 08:40:07AM +0200, Klaus Rudolph wrote: > Hi all, > > after I update my ubuntu system to 11.04 I got some strange errors. > > Under 10.04 I compiled 4.5.3 and 4.6.0 without any problems and both versions work as expected. > > After update to ubuntu 11.04 I got always errors while linking with these compilers: > krud@mauersegler:~/test/c++/compile_ubuntu_11.04$ /opt/_linux-gnu_4.5.3/bin/g++ main.cpp > /opt/_linux-gnu_4.5.3/bin/../lib/gcc/i686-pc-linux-gnu/4.5.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lm > /opt/_linux-gnu_4.5.3/bin/../lib/gcc/i686-pc-linux-gnu/4.5.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lc > collect2: ld returned 1 exit status > > > Also a new compilation from gcc sources on ubuntu 11.04 fails with the same problem: cannot find lc and other libs > /home/krud/work/gcc-4.5.3/build_linux_again/./gcc/xgcc -B/home/krud/work/gcc-4.5.3/build_linux_again/./gcc/ -B/opt/linux-gnu_4.5.3/i686-pc-linux-gnu/bin/ -B/opt/linux-gnu_4.5.3/i686-pc-linux-gnu/lib/ -isystem /opt/linux-gnu_4.5.3/i686-pc-linux-gnu/include -isystem /opt/linux-gnu_4.5.3/i686-pc-linux-gnu/sys-include -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _enable_execute_stack_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o tf-signs_s.o unwind-dw2_s.o unwind-dw2-fde-glibc_s.o unwind-sjlj_s.o gthr-gnat_s.o unwind-c_s.o emutls_s.o -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so > /opt/linux-gnu_4.5.3/i686-pc-linux-gnu/bin/ld: cannot find -lc > > The strace output shows: > 1538 2495 brk(0x8569000) = 0x8569000 > 1539 2495 open("/proc/meminfo", O_RDONLY) = 9 > 1540 2495 fstat64(9, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 > 1541 2495 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7785000 > 1542 2495 read(9, "MemTotal: 3925908 kB\nMemF"..., 1024) = 1024 > 1543 2495 close(9) = 0 > 1544 2495 munmap(0xb7785000, 4096) = 0 > 1545 2495 open("/opt/linux-gnu_4.5.3/lib/gcc/i686-pc-linux-gnu/4.5.3/libm.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or di rectory) > 1546 2495 open("/opt/linux-gnu_4.5.3/lib/gcc/i686-pc-linux-gnu/4.5.3/libm.a", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or dir ectory) > 1547 2495 open("/opt/linux-gnu_4.5.3/lib/gcc/i686-pc-linux-gnu/4.5.3/../../../../i686-pc-linux-gnu/lib/libm.so", O_RDONLY|O_LARGEFIL E) = -1 ENOENT (No such file or directory) > 1548 2495 open("/opt/linux-gnu_4.5.3/lib/gcc/i686-pc-linux-gnu/4.5.3/../../../../i686-pc-linux-gnu/lib/libm.a", O_RDONLY|O_LARGEFILE ) = -1 ENOENT (No such file or directory) > 1549 2495 open("/opt/linux-gnu_4.5.3/lib/gcc/i686-pc-linux-gnu/4.5.3/../../../libm.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such f ile or directory) > 1550 2495 open("/opt/linux-gnu_4.5.3/lib/gcc/i686-pc-linux-gnu/4.5.3/../../../libm.a", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such fi le or directory) > 1551 2495 open("/opt/linux-gnu_4.5.3/i686-pc-linux-gnu/lib/libm.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1552 2495 open("/opt/linux-gnu_4.5.3/i686-pc-linux-gnu/lib/libm.a", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1553 2495 open("/opt/linux-gnu_4.5.3/lib/libm.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1554 2495 open("/opt/linux-gnu_4.5.3/lib/libm.a", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1555 2495 open("/usr/local/lib/libm.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1556 2495 open("/usr/local/lib/libm.a", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1557 2495 open("/lib/libm.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1558 2495 open("/lib/libm.a", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1559 2495 open("/usr/lib/libm.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1560 2495 open("/usr/lib/libm.a", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) > 1561 2495 write(2, "/opt/linux-gnu_4.5.3/lib/gcc/i68"..., 89) = 89 Did you install the development packages? that is, the ubuntu-package libc6-dev? If not, the compiler is right :) If yes -- could you post where on your Ñystem libc.so and libm.so really exist? Axel