Weird build dependencies.

Rob Landley rob at landley.net
Thu Dec 11 04:09:26 UTC 2008


So I'm trying to do:
  make -j 3 install install_utils

And it's not working.

I added "all" as a dependency on "utils:" in the top level Makefile.in, 
because make utils wants to link against the uClibc headers/libraries we just 
built so it helps if they're there.  (make hostutils is the one that builds 
against the host system's headers and libraries.  I'm pretty sure it's linking 
'em out of the build directories and not out of the install directories, so 
depending on "all" rather than "install" sounds closer to correct.)

Now what it's doing is this:

  CC lib/interp.os
lib/interp.c:5: error: redefinition of '__dl_ldso__'
lib/interp.c:4: error: previous definition of '__dl_ldso__' was here
make[2]: *** [lib/interp.os] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [../lib/libc.so.0] Error 2
make: *** [utils] Error 2
Exiting due to errors
Exiting due to errors

And the reason it's doing that is that lib/interp.c looks like this:

/* Force shared libraries to know about the correct library loader */
#include <features.h>
#include <features.h>
const char __dl_ldso__[] __attribute__ ((section  (".interp"))) ="/lib/ld-
uClibc.so.0";
const char __dl_ldso__[] __attribute__ ((section  (".interp"))) ="/lib/ld-
uClibc.so.0";

Because the chunk of Makerules responsible for creating that file looks like 
this:

$(top_builddir)lib/interp.c: | $(sub_headers)
    $(Q)$(INSTALL) -d $(dir $@)
    $(Q)echo "/* Force shared libraries to know about the correct library 
loader */" > $@
    $(Q)echo "#include <features.h>" >> $@
    $(Q)echo "const char __dl_ldso__[] __attribute__ ((section " \
        "(\".interp\"))) =\""$(SHARED_LIB_LOADER_PREFIX)/$(UCLIBC_LDSO)"\";" 
>> $@

So if that gets called twice by two of the -j threads, it creates the file 
once and then appends the lines to it twice.  Which seems just _weird_ to me.

I thought I'd ping the list in case somebody knows what this was trying to 
accomplish and why it's the way it is and so on.  I can randomly flail away at 
the dependencies here but I'd appreciate it if somebody who _understood_ this 
could take a look at it...

Thanks,

Rob



More information about the uClibc mailing list