Buildroot: cannot find /lib/libc.so.0

Peter S. Mazinger ps.m at gmx.net
Fri Sep 30 17:55:17 UTC 2005


On Fri, 30 Sep 2005, Stephen Warren wrote:

> Peter S. Mazinger wrote:
> > On Fri, 30 Sep 2005, Stephen Warren wrote:
> >>A related issue, which I don't think it causing this issue at all, is
> >>that the first thing buildroot does is an "install_dev". Now that you
> >>created a separate "install_headers", I think buildroot should be using
> >>this, since I *think* all buildroot initially needs is the C lib headers
> >>for building binutils and/or first stage gcc.
> > 
> > that is what I meant, but I am not comfortable w/ buildroot, so I can't 
> > really tell if that is enough. It is only sure that some install_dev in 
> > buildroot should be changed to install_headers. Could you test this?
> 
> I made this change, and it didn't solve the problem.
> 
> buildroot does something *very* roughly like this:
> 
> 1) ucblic install_dev  # I changed to install_headers
> 2) build binutils
> 3) build gcc
> 4) build uclibc
> 5) uclibc install to 'staging area'
> 6) build gcc final
> 
> It's the "6) build gcc final" step that's failing.
> 
> In "5) uclibc install to 'staging area'", the ucblic make is invoked
> like this:
> 
> make -C /.../swarren/tmp/buildroot-svn/toolchain_build_i486/uClibc-svn \
>         PREFIX=/.../swarren/tmp/buildroot-svn/build_i486/staging_dir/ \
>         DEVEL_PREFIX=/ \
>         RUNTIME_PREFIX=/ \
>         install_dev
> make -C /.../swarren/tmp/buildroot-svn/toolchain_build_i486/uClibc-svn \
>         PREFIX=/.../swarren/tmp/buildroot-svn/build_i486/root \
>         DEVEL_PREFIX=/usr/ \
>         RUNTIME_PREFIX=/ \
>         install_runtime
> 
> In that case, I don't think "install_dev" can be replaced with
> "install_headers", since we really do want to install *all* dev stuff,
> not just headers (the staging area is where the compilers get run from,
> so they need compiler binaries, libc binaries, libc dev binaries,
> headers, etc.)
> 
> I think the real problem is that when "install_dev" above gets run, this
> file gets created incorrectly:
> 
> /.../swarren/tmp/buildroot-svn/build_i486/staging_dir/lib/libc.so
> 
> with this content:
> 
> =================================
> /* GNU ld script
>  * Use the shared library, but some functions are only in
>  * the static library, so try that secondarily. */
> GROUP ( /lib/libc.so.0 /lib/uclibc_nonshared.a )
> =================================
> 
> The value of PREFIX doesn't seem to be getting into libc.so, which is
> what's causing the problems.

no, PREFIX is not allowed to be used here IMHO. RUNTIME/DEVEL_PREFIX has 
to be correct (see my comment on the interpretion of these), I can't 
create that file based on PREFIX because any packaging software will have 
incorrect path in libc.so

Peter

> To test this, I took the build that had failed, then manually hacked the
> libc.so in /.../build_i486/staging_dir/ to include the full path, then
> re-ran the gcc make that failed. It seems to have succeeded!
> 
> I think the issue is this code in uClibc:
> 
>         if [ -f $(TOPDIR)lib/libc.so -a -f
> $(PREFIX)$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME) ] ; then \
>                 echo "GROUP ( $(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME)
> $(DEVEL_PREFIX)lib/$(NONSHARED_LIBNAME) )" \
>                         >> $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \
>         fi
> 
> (sorry about the wrapping!)
> 
> I think that when generating the GROUP line, things should say this instead:
> 
> not:
> 
> $(RUNTIME_PREFIX)lib/
> 
> but:
> 
> $(PREFIX)$(RUNTIME_PREFIX)lib/
> 
> I'll make that change and see if the whole buildroot works.
> 

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list