PATCH: bootstrap/18532: libgcc.mk isn't parallel build safe for multilib
H. J. Lu
hjl@lucon.org
Thu Nov 18 07:57:00 GMT 2004
This patch makes libgcc.mk parallel build safe. But it depends on
fixing
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18533
H.J.
----
2004-11-17 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/18532
* mklibgcc.in: Only run make one at a time for multilib.
--- gcc/mklibgcc.in.multilib 2004-11-17 13:18:38.000000000 -0800
+++ gcc/mklibgcc.in 2004-11-17 13:34:57.000000000 -0800
@@ -596,28 +596,39 @@ echo ' if [ -d $$d ]; then true; else
echo ' done'
echo ' if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi'
-for f in $EXTRA_MULTILIB_PARTS; do
+if [ -n "$EXTRA_MULTILIB_PARTS" ]; then
+ # We can't have individual element in EXTRA_MULTILIB_PARTS as a
+ # target since it won't be parallel build safe. We bundle them
+ # together and pass them to Makefile. libgcc.mk has no knowledge
+ # of if and how EXTRA_MULTILIB_PARTS are built.
+ prev_extra=
for ml in $MULTILIBS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
+ test "$dir" = . && continue;
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
- case $dir in
- .) out=$f ; t= ;;
- *) out=$dir/$f ; t=$dir/ ;;
- esac
- case $out in
- # Prevent `make' from interpreting $out as a macro assignment
- *'$(EQ)'*) targ="T_TARGET=$out T_TARGET" ;;
- *) targ=$out ;;
- esac
+ t=$dir/
+ suffix=-`echo ${dir} | sed -e 's,/,_,g'`
+ extra=
+ for f in $EXTRA_MULTILIB_PARTS; do
+ out=$dir/$f
+ case $out in
+ # Prevent `make' from interpreting $out as a macro assignment
+ *'$(EQ)'*) targ="T_TARGET=$out T_TARGET" ;;
+ *) targ=$out ;;
+ esac
+ extra="$extra $targ"
+ done
- echo $out: stmp-dirs
+ echo extra$suffix: stmp-dirs $prev_extra
echo " $make_compile" \\
echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
- echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $targ
+ echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $extra
+
+ all="$all extra$suffix"
- all="$all $out"
+ prev_extra=extra$suffix
done
-done
+fi
echo ""
echo "all: $all"
More information about the Gcc-patches
mailing list