This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mklibgcc.in cleanup


At present, the shell code to produce the soft float Makefile fragments is twice
duplicated for DF and TF modes.  My patch remedies this.  Tested before and after
patching with an arm-elf toolchain and a cmp of all of the generated libgcc.a's.

Okay for mainline? I've shown diff -w output to help make the change clearer.

Ben


2005-04-06 Ben Elliston <bje@au.ibm.com>


        * mklibgcc.in: Parameterise building of the soft float functions
        so that we iterate over each type, rather than perpetually cloning
        the shell code for each type.

Index: mklibgcc.in
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/mklibgcc.in,v
retrieving revision 1.86
diff -u -p -w -r1.86 mklibgcc.in
--- mklibgcc.in 24 Feb 2005 21:33:03 -0000      1.86
+++ mklibgcc.in 6 Apr 2005 06:06:59 -0000
@@ -312,49 +312,24 @@ for ml in $MULTILIBS; do
   # Build software floating point functions.
   #

-  if [ "$FPBIT" ]; then
-    for name in $FPBIT_FUNCS; do
-      if [ "$libgcc_s_so" ]; then
-       out="libgcc/${dir}/${name}${objext}"
-       outS="libgcc/${dir}/${name}_s${objext}"
-
-       echo $outS: $FPBIT $fpbit_c_dep
-       echo "  $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-         -c $FPBIT -o $outS
-
-        echo $out: $FPBIT $fpbit_c_dep
-        echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-         '$(vis_hide)' -c $FPBIT -o $out
-
-       echo $libgcc_a: $out
-       echo $libgcc_s_so: $outS
-       if [ "$SHLIB_MKMAP" ]; then
-         echo libgcc/${dir}/libgcc.map: $outS
-       fi
-      else
-       out="libgcc/${dir}/${name}${objext}"
-       echo $out: $FPBIT $fpbit_c_dep
-       echo "  $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-         -c $FPBIT -o $out
-
-       echo $libgcc_a: $out
-      fi
-    done
-  fi
+  for bitvar in FPBIT DPBIT TPBIT ; do
+    bit_funcs_var="$bitvar_FUNCS"
+    bit=$(eval "echo \$$bitvar")
+    bit_funcs=$(eval "echo \$$bit_funcs_var")

-  if [ "$DPBIT" ]; then
-    for name in $DPBIT_FUNCS; do
+    if [ "$bit" ]; then
+      for name in $bit_funcs; do
       if [ "$libgcc_s_so" ]; then
        out="libgcc/${dir}/${name}${objext}"
        outS="libgcc/${dir}/${name}_s${objext}"

-       echo $outS: $DPBIT $fpbit_c_dep
+         echo $outS: $bit $fpbit_c_dep
        echo "  $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-         -c $DPBIT -o $outS
+           -c $bit -o $outS

-        echo $out: $DPBIT $fpbit_c_dep
+          echo $out: $bit $fpbit_c_dep
         echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-         '$(vis_hide)' -c $DPBIT -o $out
+           '$(vis_hide)' -c $bit -o $out

        echo $libgcc_a: $out
        echo $libgcc_s_so: $outS
@@ -363,44 +338,15 @@ for ml in $MULTILIBS; do
        fi
       else
        out="libgcc/${dir}/${name}${objext}"
-       echo $out: $DPBIT $fpbit_c_dep
+         echo $out: $bit $fpbit_c_dep
        echo "  $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-         -c $DPBIT -o $out
+           -c $bit -o $out

        echo $libgcc_a: $out
       fi
     done
   fi
-
-  if [ "$TPBIT" ]; then
-    for name in $TPBIT_FUNCS; do
-      if [ "$libgcc_s_so" ]; then
-       out="libgcc/${dir}/${name}${objext}"
-       outS="libgcc/${dir}/${name}_s${objext}"
-
-       echo $outS: $TPBIT $fpbit_c_dep
-       echo "  $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-         -c $TPBIT -o $outS
-
-        echo $out: $TPBIT $fpbit_c_dep
-        echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-         '$(vis_hide)' -c $TPBIT -o $out
-
-       echo $libgcc_a: $out
-       echo $libgcc_s_so: $outS
-       if [ "$SHLIB_MKMAP" ]; then
-         echo libgcc/${dir}/libgcc.map: $outS
-       fi
-      else
-       out="libgcc/${dir}/${name}${objext}"
-       echo $out: $TPBIT $fpbit_c_dep
-       echo "  $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-         -c $TPBIT -o $out
-
-       echo $libgcc_a: $out
-      fi
     done
-  fi

   for file in $LIB2ADD; do
     name=`echo $file | sed -e 's/[.][cS]$//' -e 's/[.]asm$//'`

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]