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

Stephen Warren swarren at wwwdotorg.org
Fri Sep 30 17:43:36 UTC 2005


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.

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20050930/907a69aa/attachment.pgp 


More information about the uClibc mailing list