other/42980: fix make -j install

Ralf Wildenhues Ralf.Wildenhues@gmx.de
Sun Feb 28 09:34:00 GMT 2010


* Ralf Wildenhues wrote on Sun, Feb 28, 2010 at 09:45:24AM CET:
> - <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42980>
>   exposes a couple of separate issues:
> 
> a) The toplevel targets install-libiberty and install-target-libiberty
> may both be executed, and in that case, the install_to_libdir rules from
> libiberty/ may race with the same rules from $target/libiberty/ (quite
> likely) or with those from a $target$MULTISUBDIR/libiberty (a lot less
> likely, only a problem for header installation).

This patch should address this.  I tested non-parallel 'make install'
with a
- GCC tree
- binutils-gdb tree
- combined tree

all native.  I haven't tested cross-compilation yet, nor a combined
tree, but can do so if that is needed.

I'm not really sure whether the race can actually cause a silently
broken installation (e.g., with something like a cross x86_64 -> i386
with --enable-multilib), but I'm guessing so.

Since the failure fixed by this patch is by far the most likely race
(see the PR for details), and the patch is simple, OK for trunk and src
now?

Thanks,
Ralf

Fix parallel libiberty install failure.

ChangeLog:
2010-02-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	PR other/42980
	* Makefile.def: install-target-libiberty needs to come
	strictly after install-libiberty.
	* Makefile.in: Regenerate.

diff --git a/Makefile.def b/Makefile.def
index 7dce699..b05968c 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -552,6 +552,10 @@ dependencies = { module=configure-target-libstdc++-v3; on=configure-target-libgo
 //  recursive make, we can't be that specific.
 dependencies = { module=all-target-libstdc++-v3; on=configure-target-libgomp; };
 
+// avoid race with parallel make install in case both libiberty and target-libiberty
+// are eligible for installation.
+dependencies = { module=install-target-libiberty; on=install-libiberty; };
+
 // Target modules in the 'src' repository.
 lang_env_dependencies = { module=examples; };
 lang_env_dependencies = { module=libtermcap; };



More information about the Gcc-patches mailing list