parallel build fix: newlib depends upon binutils

Ralf Wildenhues
Wed Aug 19 19:40:00 GMT 2009

Not sure which party is responsible for this, so apologies if I've
cross-posted too broadly again (I'll try to improve).

In a parallel build of the src tree, I can get $target/newlib to try to
access binutils/ar before it is built:

configured with --with-newlib 'CC=gcc -m32' 'CXX=g++ -m32' \
  --disable-tcl --disable-tk --disable-itcl --disable-libgui \
  --disable-sim --disable-gdb --disable-sid

/bin/sh ../libtool --tag=CC --mode=link gcc -m32 -L/tmp/build/./ld  -m32 -I/tmp/build/i686-pc-linux-gnu/32/newlib/targ-include -I/tmp/src/newlib/libc/include  -g -O2  -m32  -m32 -o  -Xcompiler -nostdlib dummy.lo argz_add.lo argz_add_sep.lo argz_append.lo argz_count.lo argz_create.lo argz_create_sep.lo argz_delete.lo argz_extract.lo argz_insert.lo argz_next.lo argz_replace.lo argz_stringify.lo buf_findstr.lo envz_entry.lo envz_get.lo envz_add.lo envz_remove.lo envz_merge.lo envz_strip.lo
libtool: link: /tmp/build/./binutils/ar rc .libs/libargz.a  dummy.o argz_add.o argz_add_sep.o argz_append.o argz_count.o argz_create.o argz_create_sep.o argz_delete.o argz_extract.o argz_insert.o argz_next.o argz_replace.o argz_stringify.o buf_findstr.o envz_entry.o envz_get.o envz_add.o envz_remove.o envz_merge.o envz_strip.o
../libtool: line 947: /tmp/build/./binutils/ar: No such file or directory
make[8]: *** [] Error 127
make[8]: Leaving directory `/tmp/build/i686-pc-linux-gnu/32/newlib/libc/argz'
make[7]: *** [all-recursive] Error 1

The patch below should fix this.  I added a couple of other deps that
I figured are in the same bug class.  (Adding the prerequisite to
configure-* instead of all-* because the libtool macros may probe $AR
and $LD features at configure time.)

OK to commit and sync to GCC?


Fix toplevel target deps.

2009-08-19  Ralf Wildenhues  <>

	* Makefile.def (configure-target-libiberty): Depend on
	all-binutils and all-ld.
	(configure-target-newlib): Likewise.
	* Regenerate.

Index: Makefile.def
RCS file: /cvs/src/src/Makefile.def,v
retrieving revision 1.101
diff -u -r1.101 Makefile.def
--- Makefile.def	26 Jun 2009 17:19:07 -0000	1.101
+++ Makefile.def	19 Aug 2009 19:07:58 -0000
@@ -539,6 +547,10 @@
 dependencies = { module=all-target-libgloss; on=all-target-newlib; };
 dependencies = { module=all-target-winsup; on=all-target-libiberty; };
 dependencies = { module=all-target-winsup; on=all-target-libtermcap; };
+dependencies = { module=configure-target-libiberty; on=all-binutils; };
+dependencies = { module=configure-target-libiberty; on=all-ld; };
+dependencies = { module=configure-target-newlib; on=all-binutils; };
+dependencies = { module=configure-target-newlib; on=all-ld; };
 languages = { language=c;	gcc-check-target=check-gcc; };
 languages = { language=c++;	gcc-check-target=check-c++;

More information about the Newlib mailing list