Bug 3817 - Failed to compile binutils-2.21
Summary: Failed to compile binutils-2.21
Status: RESOLVED WORKSFORME
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-04 05:14 UTC by Feng Haibo
Modified: 2012-01-31 22:57 UTC (History)
1 user (show)

See Also:
Host: i386
Target: i386
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Feng Haibo 2011-06-04 05:14:26 UTC
Enviornment: Fedora 15 
I downloaded buildroot-20110603.tar.bz2, unzipped it, only saved directly to use the default values in menuconfig. Then do a simple "make". I got a compile error when compiling binutils-2.21, the error is:

# gcc >= 4.3.0 have to also build all-target-libgcc
/usr/bin/make -j2 -C /home/haibo/learn/buildroot/output/toolchain/gcc-4.3.5-intermediate all-gcc all-target-libgcc
make[3]: Nothing to be done for `all'.
make[4]: Nothing to be done for `all'.
make[4]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all'.
test -f config.h || (rm -f stamp-h1 && /usr/bin/make stamp-h1)
Checking multilib configuration for libgcc...
/bin/sh: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header
# If this is the top-level multilib, build all the other
/bin/sh: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header
make[3]: *** [all-multi] Error 127
make[2]: *** [all-target-libgcc] Error 2
make[1]: *** [/home/haibo/learn/buildroot/output/toolchain/gcc-4.3.5-intermediate/.compiled] Error 2
make: *** [all] Error 2

I could work around this problem by doing the following:
$cd /usr/lib
$rm libc.so
$ln -s /lib/libc.so.6 libc.so

But this is not the best way, because ASCII file /usr/lib/libc.so's missing incurs other problems, fox example "make menuconfig" fails to launch
Comment 1 Peter Korsgaard 2011-08-26 07:29:42 UTC
(In reply to comment #0)
> /bin/sh: error while loading shared libraries: /usr/lib/libc.so: invalid ELF
> header

> I could work around this problem by doing the following:
> $cd /usr/lib
> $rm libc.so
> $ln -s /lib/libc.so.6 libc.so
> 
> But this is not the best way, because ASCII file /usr/lib/libc.so's missing
> incurs other problems, fox example "make menuconfig" fails to launch

Huh, is your system libc corrupt? Are you building as root?
Comment 2 Sérgio 2011-09-02 14:50:26 UTC
(In reply to comment #0)

> I could work around this problem by doing the following:
> $cd /usr/lib
> $rm libc.so
> $ln -s /lib/libc.so.6 libc.so
> 
> But this is not the best way, because ASCII file /usr/lib/libc.so's missing
> incurs other problems, fox example "make menuconfig" fails to launch

I notice this workaround , is wrong , no,  /usr/lib/libc.so is not missing  ,
/usr/lib/libc.so, is in glibc-devel package.
Sometimes, also, some people do this wrong workaround when need the static libraries which normally are in a package glibc-static
Comment 3 Thomas Petazzoni 2012-01-31 22:57:59 UTC
Many people routinely build toolchains with Buildroot without seeing this problem, and we haven't had further details from the initial bug reporter since several months. I'm therefore closing this bug. Anyone seeing the issue is invited to reopen the bug with more details.