[uClibc] make -j

David Meggy dmeggy at techsol.ca
Wed Jan 7 21:49:04 UTC 2004


Hi everyone

I'm trying to run make in parallel mode, and I've run into a few
problems with dependencies.  The following patch cleans up a couple of
things.

<patch>
--- uClibc-cvs/Makefile	Sat Jan  3 02:18:08 2004
+++ uClibc-cvs-jan7/Makefile	Wed Jan  7 11:26:47 2004
@@ -41,7 +41,7 @@
 -include .config.cmd
 
 .PHONY: $(SHARED_TARGET)
-shared: $(SHARED_TARGET)
+shared: $(SHARED_TARGET) subdirs
 ifeq ($(strip $(HAVE_SHARED)),y)
 	@$(MAKE) -C libc shared
 	@$(MAKE) -C ldso shared
@@ -177,7 +177,7 @@
 
 subdirs: $(patsubst %, _dir_%, $(DIRS))
 
-$(patsubst %, _dir_%, $(DIRS)) : dummy
+$(patsubst %, _dir_%, $(DIRS)) : dummy pregen
 	$(MAKE) -C $(patsubst _dir_%, %, $@)
 
 tags:
--- uClibc-cvs/ldso/libdl/Makefile	Tue Nov  4 05:07:42 2003
+++ uClibc-cvs-jan7/ldso/libdl/Makefile	Wed Jan  7 13:23:57 2004
@@ -71,7 +71,7 @@
 
 $(OBJ): Makefile
 
-shared:
+shared: $(LIBDL)
 	$(LD) $(LDFLAGS) -soname=$(LIBDL_SHARED).$(MAJOR_VERSION) \
 		-o $(LIBDL_SHARED_FULLNAME) --whole-archive $(LIBDL_PIC) \
 		--no-whole-archive $(TOPDIR)/libc/misc/internals/interp.o \

</patch>

However I still have problems.  Occasionally it works, other times I
will get errors, such as

arm-linux-ar: ../../../../libc/libc.a: Malformed archive

or

arm-linux-ld -EL -s -shared --warn-common --warn-once -z combreloc 
-soname=libc.so.0 -o libuClibc-0.9.26.so \
	--whole-archive libc.a \
	../libc/misc/internals/interp.o --no-whole-archive \
	-init __uClibc_init
libc.a: member libc.a(__assert.o) in archive is not an object
make[1]: *** [shared] Error 1

where quite often it is __assert.o that causes the problem, but
different objects on different trials.

Without knowing more, I would take a guess that this has something to do
with multiple threads trying to write to libc.a at once.  Is there any
easy way to fix this?

David


-- 
~~~~~~~~~~~~~~~~~~~~~~~~
     David Meggy
     Engineering

Technical Solutions Inc.
Unit #1 7157 Honeyman St
Delta BC Canada, V4G 1E2
     www.techsol.ca

eMail: dmeggy at techsol.ca
Tel: 604 946 TECH (8324)
Fax: 604 946 6445
~~~~~~~~~~~~~~~~~~~~~~~~




More information about the uClibc mailing list