aboutsummaryrefslogtreecommitdiff
path: root/gcc/mklibgcc.in
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2004-12-02 21:49:00 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2004-12-02 13:49:00 -0800
commit0cb4334ee9bae97eb674ffd6bb26088fe7f25865 (patch)
tree2ecc2c612cc4f4ef8d7a8cf6befe1dc94b8cd532 /gcc/mklibgcc.in
parent14c473b90e3b5f2ef495b961a4f04e1b5ae91e09 (diff)
downloadgcc-0cb4334ee9bae97eb674ffd6bb26088fe7f25865.zip
gcc-0cb4334ee9bae97eb674ffd6bb26088fe7f25865.tar.gz
gcc-0cb4334ee9bae97eb674ffd6bb26088fe7f25865.tar.bz2
re PR bootstrap/18532 (libgcc.mk isn't parallel build safe for multilib)
2004-12-02 H.J. Lu <hongjiu.lu@intel.com> PR bootstrap/18532 * mklibgcc.in: Build one set of EXTRA_MULTILIB_PARTS for multilib at a time. Don't build the default set. Don't add EXTRA_MULTILIB_PARTS to shared libunwind nor libgcc. Remove filter for shared libunwind and libgcc. From-SVN: r91663
Diffstat (limited to 'gcc/mklibgcc.in')
-rw-r--r--gcc/mklibgcc.in78
1 files changed, 45 insertions, 33 deletions
diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in
index fa6930b..916a0f5 100644
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -160,6 +160,11 @@ for ml in $MULTILIBS; do
libgcc_s_so=
libunwind_a=
libunwind_so=
+ if [ "$dir" = . ]; then
+ suffix=
+ else
+ suffix=`echo $dir | sed s,/,_,g`
+ fi
if [ "$LIBUNWIND" ]; then
libunwind_a=$dir/libunwind.a
@@ -177,7 +182,6 @@ for ml in $MULTILIBS; do
libunwind_soname=libunwind
fi
else
- suffix=`echo $dir | sed s,/,_,g`
libgcc_eh_a=$dir/libgcc_eh.a
libgcc_s_so_base=$dir/libgcc_s_${suffix}
libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
@@ -655,37 +659,45 @@ for ml in $MULTILIBS; do
done
# EXTRA_MULTILIB_PARTS.
- echo
- for f in $EXTRA_MULTILIB_PARTS; do
- 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
-
- echo $out: stmp-dirs
- echo " $make_compile" \\
- echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
- echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $targ
- echo "all: $out"
-
- # Make libunwind.so and libgcc_s.so depend on these, since they are
- # likely to be implicitly used by the link process. However, we must
- # then arrange to remove them from the explicit object list generated
- # from $^ - see below.
- if [ "$libgcc_s_so" ]; then
- libgcc_s_so_extra="$libgcc_s_so_extra $out"
- echo "$libgcc_s_so: $out"
- fi
- if [ "$libunwind_so" ]; then
- libunwind_so_extra="$libunwind_so_extra $out"
- echo "$libunwind_so: $out"
+ if [ -n "$EXTRA_MULTILIB_PARTS" ]; then
+ # Each of the EXTRA_MULTILIB_PARTS is built by recursive invocation
+ # of the parent Makefile. We must do this just once for each
+ # multilib, passing it all the EXTRA_MULTILIB_PARTS as
+ # simultaneous goal targets, so that rules which cannot execute
+ # simultaneously are properly serialized.
+
+ # We don't need to build the default ones since they have been
+ # built before we get here.
+ if [ $dir != "." ]; then
+ extra=
+ t=$dir/
+ echo
+ 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 extra$suffix: stmp-dirs
+ echo " $make_compile" \\
+ echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
+ echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $extra
+ echo "all: extra$suffix"
+
+ # Make libunwind.so and libgcc_s.so depend on these, since they
+ # are likely to be implicitly used by the link process.
+ if [ "$libgcc_s_so" ]; then
+ echo "$libgcc_s_so: extra$suffix"
+ fi
+ if [ "$libunwind_so" ]; then
+ echo "$libunwind_so: extra$suffix"
+ fi
fi
- done
+ fi
# Library build rules.
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
@@ -760,7 +772,7 @@ EOF
echo " $SHLIB_LINK" \
| sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \
- -e "s%@shlib_objs@%\$(filter-out $libgcc_s_so_extra,\$(objects))%g" \
+ -e "s%@shlib_objs@%\$(objects)%g" \
-e "s%@shlib_base_name@%$libgcc_s_so_base%g" \
-e "s%@shlib_so_name@%$libgcc_s_soname%g" \
-e "s%@shlib_map_file@%$mapfile%g" \
@@ -775,7 +787,7 @@ EOF
echo " $SHLIBUNWIND_LINK" \
| sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \
- -e "s%@shlib_objs@%\$(filter-out $libunwind_so_extra,\$(objects))%g" \
+ -e "s%@shlib_objs@%\$(objects)%g" \
-e "s%@shlib_base_name@%$libunwind_so_base%g" \
-e "s%@shlib_so_name@%$libunwind_soname%g" \
-e "s%@shlib_dir@%$shlib_dir%g" \