[PATCH nptl] Improve parallel building

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Sat Dec 19 02:29:13 UTC 2009


On Fri, Dec 18, 2009 at 05:22:13PM +0000, Natanael Copa wrote:
>This fixes some of the issues when building in parallel.

Can you please explain them to me?

librt's makefile requires (NB: for NPTL, not LT) in LDFLAGS:
librt.so: libdl.so libpthread.so
libpthread itself depends on c and dl
So for NPTL i can see how rt depends on pthread (but not dl), and
for !NPTL i can see how rt depends on c and dl (but not pthread).

And why is pthread.a just an order-only prereq of c.a and not a normal one?

>You still need to first run:
>
> make pregen

the usual sequence for me is:
make install_headers
build a compiler
install kernel headers
make install_runtime|install_dev|install
make install_utils

i've just tried the normal
make distclean && make defconfig && sed -i -e 's/UCLIBC_HAS_THREADS_NATIVE/HAS_NO_THREADS/;/^HAS_NO_THREADS/cUCLIBC_HAS_THREADS_NATIVE=y\nPTHREADS_DEBUG_SUPPORT=y\nUCLIBC_HAS_STDIO_FUTEXES=y' .config && make silentoldconfig && (time make -j)
and this still fails (as currently somewhat expected, i admit).

But then even the NO_THREADS variant doesn't build on the nptl branch:
make distclean && make defconfig && make -j
due to the missing tls.h

Oh, as an unrelated note, current master is also broken for an x86_64 defconfig:
libc/misc/internals/tempname.c: In function '___path_search':
libc/misc/internals/tempname.c:116: warning: field precision should have type 'int', but argument 3 has type 'size_t'
libc/misc/internals/tempname.c:116: warning: field precision should have type 'int', but argument 5 has type 'size_t'
libc/libc_so.a(mempcpy.os): In function `__memcpy_chk':
(.text+0x0): multiple definition of `__memcpy_chk'
libc/libc_so.a(memcpy.os):(.text+0x0): first defined here
libc/libc_so.a(memcpy.os): In function `__memcpy_chk':
(.text+0x5): undefined reference to `__GI___chk_fail'
/usr/bin/ld: libc/libc_so.a(memcpy.os): relocation R_X86_64_PC32 against undefined symbol `__GI___chk_fail' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value


>---
> libc/Makefile.in            |    2 +-
> libpthread/nptl/Makefile.in |    6 +++---
> librt/Makefile.in           |    2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
>diff --git a/libc/Makefile.in b/libc/Makefile.in
>index c4cf5d7..671be12 100644
>--- a/libc/Makefile.in
>+++ b/libc/Makefile.in
>@@ -87,7 +87,7 @@ $(libc_OUT)/libc.oS: $(libc-multi-y) | $(top_builddir)lib/libc.a $(top_builddir)
> 	$(Q)$(RM) $@
> 	$(compile-m)
> 
>-$(top_builddir)lib/libc.a: $(libc-a-y) | $(crt-y)
>+$(top_builddir)lib/libc.a: $(libc-a-y) | $(crt-y) $(libpthread-a-y)
> 	$(Q)$(INSTALL) -d $(dir $@)
> 	$(Q)$(RM) $@
> 	$(do_ar)
>diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
>index 9b4ba51..801c562 100644
>--- a/libpthread/nptl/Makefile.in
>+++ b/libpthread/nptl/Makefile.in
>@@ -266,13 +266,13 @@ pthread_pregen := nptl_headers nptl_arch_headers nptl_linux_headers
> lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
> lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
> 
>-$(top_builddir)lib/libpthread.so: $(PTHREAD_OUT)/libpthread_so.a $(libc) $(top_builddir)lib/libpthread_nonshared.a
>+$(top_builddir)lib/libpthread.so: $(PTHREAD_OUT)/libpthread_so.a $(libc) $(top_builddir)lib/libpthread_nonshared.a $(top_builddir)lib/libdl.so
> 	$(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
> 	$(Q)$(RM) $@
> 	$(Q)cp $(top_srcdir)extra/scripts/format.lds $@
> 	$(Q)echo "GROUP ( $(notdir $@).$(MAJOR_VERSION) libpthread_nonshared.a )" >> $@
> 
>-$(PTHREAD_OUT)/libpthread_so.a: $(libpthread-so-y)
>+$(PTHREAD_OUT)/libpthread_so.a: $(libpthread-so-y) $(libdl-so-y)
> 	$(Q)$(RM) $@
> ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
> 	$(do_strip:-x=-X --strip-debug)
>@@ -281,7 +281,7 @@ else
> endif
> 	$(do_ar)
> 
>-$(top_builddir)lib/libpthread.a: $(libpthread-a-y)
>+$(top_builddir)lib/libpthread.a: $(libpthread-a-y) $(libdl-a-y)
> 	$(Q)$(INSTALL) -d $(dir $@)
> 	$(Q)$(RM) $@
> 	$(do_strip)
>diff --git a/librt/Makefile.in b/librt/Makefile.in
>index fc57c97..0ade49b 100644
>--- a/librt/Makefile.in
>+++ b/librt/Makefile.in
>@@ -55,7 +55,7 @@ endif
> ifeq ($(DOPIC)$(UCLIBC_HAS_THREADS_NATIVE),yn)
> $(top_builddir)lib/librt.so: $(top_builddir)lib/librt.a $(libc.depend)
> else
>-$(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(libc.depend)
>+$(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(libc.depend) $(top_builddir)lib/libpthread.so 
> endif
> 	$(call link.so,$(librt_FULL_NAME),$(MAJOR_VERSION))


More information about the uClibc mailing list