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]

Restore __eprintf


This patch puts __eprintf back in libgcc.a, but not libgcc_s.so.

There may be other entries in LIB2FUNCS that should be in LIB2FUNCS_ST
instead.  If we're using the shared libgcc we don't also link in the
static one, so this is limited to routines used only on systems that
do not and will never support shared libgcc.  __gcc_bcmp might be a
good candidate.

zw

	* libgcc2.c, libgcc2.h: Restore __eprintf.  Label as used for
	binary backward compat only.
	* Makefile.in (LIB2FUNCS_ST): New.  Put _eprintf here, not
	in LIB2FUNCS.  Pass it to mklibgcc.
	* mklibgcc.in: Handle LIB2FUNCS_ST.

===================================================================
Index: Makefile.in
--- Makefile.in	2001/05/13 19:37:10	1.661
+++ Makefile.in	2001/05/13 23:09:05
@@ -792,12 +792,14 @@ LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udi
     _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
     _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
     _fixtfdi _fixunstfdi _floatditf \
-    __gcc_bcmp _eprintf \
-    _bb _clear_cache _trampoline __main _exit \
+    __gcc_bcmp _bb _clear_cache _trampoline __main _exit \
     _absvsi2 _absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 \
     _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 \
     _ctors
 
+# Defined in libgcc2.c, included only in the static library.
+LIB2FUNCS_ST = _eprintf
+
 FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
     _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
     _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
@@ -1046,6 +1048,7 @@ libgcc.mk: config.status Makefile mklibg
 	LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \
 	LIB1FUNCS_EXTRA='$(LIB1FUNCS_EXTRA)' \
 	LIB2FUNCS='$(LIB2FUNCS)' \
+	LIB2FUNCS_ST='$(LIB2FUNCS_ST)' \
 	LIB2ADD='$(LIB2ADD)' \
 	LIB2ADD_ST='$(LIB2ADD_ST)' \
 	LIB2ADDEH='$(LIB2ADDEH)' \
===================================================================
Index: libgcc2.c
--- libgcc2.c	2001/05/11 17:03:01	1.119
+++ libgcc2.c	2001/05/13 23:09:07
@@ -1238,6 +1238,28 @@ __gcc_bcmp (const unsigned char *s1, con
 }
 
 #endif
+
+/* __eprintf used to be used by GCC's private version of <assert.h>.
+   We no longer provide that header, but this routine remains in libgcc.a
+   for binary backward compatibility.  Note that it is not included in
+   the shared version of libgcc.  */
+#ifdef L_eprintf
+#ifndef inhibit_libc
+
+#undef NULL /* Avoid errors if stdio.h and our stddef.h mismatch.  */
+#include <stdio.h>
+
+void
+__eprintf (const char *string, const char *expression,
+	   unsigned int line, const char *filename)
+{
+  fprintf (stderr, string, expression, line, filename);
+  fflush (stderr);
+  abort ();
+}
+
+#endif
+#endif
 
 #ifdef L_bb
 
===================================================================
Index: libgcc2.h
--- libgcc2.h	2001/05/11 17:03:01	1.17
+++ libgcc2.h	2001/05/13 23:09:07
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA.  */
 
 extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t);
 extern void __clear_cache (char *, char *);
+extern void __eprintf (const char *, const char *, unsigned int, const char *)
+  __attribute__ ((__noreturn__));
 
 struct bb;
 extern void __bb_exit_func (void);
===================================================================
Index: mklibgcc.in
--- mklibgcc.in	2001/04/09 23:43:03	1.26
+++ mklibgcc.in	2001/05/13 23:09:07
@@ -14,6 +14,7 @@
 # LIB1ASMFUNCS
 # LIB1FUNCS_EXTRA
 # LIB2FUNCS
+# LIB2FUNCS_ST
 # LIB2ADD
 # LIB2ADD_ST 
 # LIB2ADDEH
@@ -168,6 +169,7 @@ esac
 #
 
 libgcc2_objs=""
+libgcc2_st_objs=""
 
 for name in $LIB2FUNCS; do
   for ml in $MULTILIBS; do
@@ -182,6 +184,19 @@ for name in $LIB2FUNCS; do
   libgcc2_objs="$libgcc2_objs ${name}${objext}"
 done
 
+for name in $LIB2FUNCS_ST; 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' -o $out
+  done
+  libgcc2_st_objs="$libgcc2_st_objs ${name}${objext}"
+done
+
 if [ "$FPBIT" ]; then
   for name in $FPBIT_FUNCS; do
     for ml in $MULTILIBS; do
@@ -247,8 +262,6 @@ for file in $LIB2ADDEH; do
   done
   libgcc2_objs="$libgcc2_objs ${oname}${objext}"
 done
-
-libgcc2_st_objs=""
 
 for file in $LIB2ADD_ST; do
   name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`


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