[uClibc] arm toolchain/static binaries

David Muse dmuse at 4accesscommunications.com
Tue Jun 22 15:25:10 UTC 2004


On Mon, 21 Jun 2004 14:02:06 -0400
David Muse <dmuse at 4accesscommunications.com> wrote:

> > On Wednesday 16 June 2004 10:04, David Muse wrote:
> > > Hello all,
> > >
> > > I've been using an arm-uclibc toolchain based on uclibc-0.9.21 for a while
> > > now and I recently tried to upgrade to a toolchain based on the current cvs
> > > snapshot.  I have been able to compile a complete toolchain and it can
> > > build most of my code, but every now and then, it generates a static
> > > binary.  If I rebuild the same code base again, the same binaries get
> > > linked statically, so it's not exactly random, but I can't figure out why
> > > it's linking them statically.  I'm not passing any flags that would cause
> > > static linking, dynamic versions of each of the libraries that need to be
> > > linked in are available, and the 0.9.21 toolchain builds dynamically linked
> > > binaries.  It's kind of a subtle bug, I didn't notice it for a while until
> > > one day I just noticed that the size of the jffs2 filesystem image that my
> > > build process generates was larger than I remember.
> > >
> > > Has anyone else seen this?
> 
> I narrowed the problem down further and I think I figured out part of the problem.
> 
> When building the toolchain, the development library symlinks aren't getting
> built right, so the linker can't necessarily find the shared object libraries.
> 
> For example, libdl.so should be symlinked to libdl-0.9.26.so in the same directory,
> but instead, it's symlinked to libdl-0.9.26.so in another, non-existent directory.
> 
> It looks like RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB in the Makefile
> at the top level of the uClibc distribution may be getting set to the wrong value.  I'm
> not sure about that though, I'll have to do some more checking.
> 
> David Muse
> dmuse at 4accesscommunications.com


Ok, I figured out the problem for sure.

In the uclibc.mk file there's an errant $(STAGING_DIR) which causes problems
downstream.  Here's a patch for it:

--- uclibc.mk.old       2004-06-22 11:23:42.000000000 -0400
+++ uclibc.mk   2004-06-22 11:23:24.000000000 -0400
@@ -113,7 +113,7 @@
        $(MAKE) -C $(UCLIBC_DIR) \
                PREFIX=$(STAGING_DIR)/ \
                DEVEL_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
-               RUNTIME_PREFIX=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/ \
+               RUNTIME_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
                install_dev
        $(MAKE) -C $(UCLIBC_DIR) \
                PREFIX=$(STAGING_DIR) \

David Muse



More information about the uClibc mailing list