# Construct makefile for libgcc.
# Copyright (C) 2000 Free Software Foundation, Inc.
#
-# This file is part of GNU CC.
+# This file is part of GCC.
# Arguments, taken from the environment, since there are a lot
# of them, and positional args becomes quite ugly.
# LIB2ADDEHDEP
# FPBIT
# FPBIT_FUNCS
+# LIB2_DIVMOD_FUNCS
# DPBIT
# DPBIT_FUNCS
# LIBGCC
echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
-c '$(srcdir)/config/$(LIB1ASMSRC)' -o $out
- # Remove any objects from LIB2FUNCS that are defined as optimized
- # assembly code in LIB1ASMFUNCS.
+ # Remove any objects from LIB2FUNCS and LIB2_DIVMOD_FUNCS that are
+ # defined as optimized assembly code in LIB1ASMFUNCS.
LIB2FUNCS=`echo $LIB2FUNCS | sed -e 's/^'$name' //' \
-e 's/ '$name' / /' \
-e 's/ '$name'$//'`
+ LIB2_DIVMOD_FUNCS=`echo $LIB2_DIVMOD_FUNCS | sed -e 's/^'$name' //' \
+ -e 's/ '$name' / /' \
+ -e 's/ '$name'$//'`
done
libgcc1_objs="$libgcc1_objs ${name}${objext}"
done
libgcc2_objs=""
libgcc2_st_objs=""
+libgcc2_eh_objs=""
for name in $LIB2FUNCS; do
for ml in $MULTILIBS; do
libgcc2_st_objs="$libgcc2_st_objs ${name}${objext}"
done
+for name in $LIB2_DIVMOD_FUNCS; do
+ for ml in $MULTILIBS; do
+ dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
+ flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
+ out="libgcc/${dir}/${name}${objext}"
+
+ echo $out: $libgcc2_c_dep
+ echo " $gcc_compile" '$(MAYBE_USE_COLLECT2)' $flags -DL$name \
+ -c '$(srcdir)/libgcc2.c' -fexceptions -fnon-call-exceptions -o $out
+ done
+ libgcc2_objs="$libgcc2_objs ${name}${objext}"
+done
+
if [ "$FPBIT" ]; then
for name in $FPBIT_FUNCS; do
for ml in $MULTILIBS; do
echo $out: stmp-dirs $file
echo " $gcc_compile" $flags -fexceptions -c $file -o $out
done
- libgcc2_objs="$libgcc2_objs ${oname}${objext}"
+ if [ "$SHLIB_LINK" ]; then
+ libgcc2_eh_objs="$libgcc2_eh_objs ${oname}${objext}"
+ else
+ libgcc2_objs="$libgcc2_objs ${oname}${objext}"
+ fi
done
for file in $LIB2ADD_ST; do
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
libgcc_objs=""
+ libgcc_eh_objs=""
for o in $libgcc1_objs; do
libgcc_objs="$libgcc_objs libgcc/${dir}/$o"
done
for o in $libgcc2_objs; do
libgcc_objs="$libgcc_objs libgcc/${dir}/$o"
done
- shlib_deps="$libgcc_objs"
+ for o in $libgcc2_eh_objs; do
+ libgcc_eh_objs="$libgcc_eh_objs libgcc/${dir}/$o"
+ done
+ libgcc_sh_objs="$libgcc_objs $libgcc_eh_objs"
+ shlib_deps="$libgcc_sh_objs"
libgcc_st_objs=""
for o in $libgcc2_st_objs; do
if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" -a -z "$mapfile" ]; then
mapfile="libgcc.map"
echo ""
- echo "${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES $libgcc_objs"
- echo ' { $(NM_FOR_TARGET)'" $SHLIB_NM_FLAGS $libgcc_objs; echo %%; cat $SHLIB_MAPFILES; } | "'$(AWK)'" -f $SHLIB_MKMAP > "'tmp-$@'
+ echo "${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES $libgcc_sh_objs"
+ echo ' { $(NM_FOR_TARGET)'" $SHLIB_NM_FLAGS $libgcc_sh_objs; echo %%; cat $SHLIB_MAPFILES; } | "'$(AWK)'" -f $SHLIB_MKMAP > "'tmp-$@'
echo ' mv tmp-$@ $@'
fi
shlib_deps="$shlib_deps $mapfile"
echo ' else true; fi;'
if [ "$SHLIB_LINK" ]; then
+
+ echo ""
+ echo "${dir}/libgcc_eh.a: $libgcc_eh_objs"
+ echo " -rm -rf ${dir}/libgcc_eh.a"
+ echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_objs
+ echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\
+ echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a ';' \\
+ echo ' else true; fi;'
+
if [ -z "$SHLIB_MULTILIB" ]; then
if [ "$dir" = "." ]; then
shlib_base_name="libgcc_s";
echo " $SHLIB_LINK" \
| sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \
- -e "s%@shlib_objs@%$libgcc_objs%g" \
+ -e "s%@shlib_objs@%$libgcc_sh_objs%g" \
-e "s%@shlib_base_name@%$shlib_base_name%g" \
-e "s%@shlib_map_file@%$mapfile%g"
elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
echo " $SHLIB_LINK" \
| sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \
- -e "s%@shlib_objs@%$libgcc_objs%g" \
+ -e "s%@shlib_objs@%$libgcc_sh_objs%g" \
-e "s%@shlib_base_name@%$shlib_base_name%g" \
-e "s%@shlib_map_file@%$mapfile%g"
fi
fi
all="$all ${dir}/libgcc.a"
if [ "$SHLIB_LINK" ]; then
+ all="$all ${dir}/libgcc_eh.a"
if [ -z "$SHLIB_MULTILIB" ]; then
if [ "$dir" = "." ]; then
suff="";
echo 'stmp-dirs: force'
echo ' for d in '"$dirs"'; do \'
-echo ' if [ -d $$d ]; then true; else mkdir $$d; fi \'
+echo ' if [ -d $$d ]; then true; else '$mkinstalldirs' $$d; fi; \'
echo ' done'
echo ' if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi'
echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc.a
if [ "$SHLIB_LINK" ]; then
+ echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
+ echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
+
if [ -z "$SHLIB_MULTILIB" ]; then
if [ "$dir" = "." ]; then
shlib_base_name="libgcc_s";