This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa libmudflap] tweaks
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 20 May 2003 15:09:39 -0400
- Subject: [tree-ssa libmudflap] tweaks
Hi -
The following patch fixes the *bsd build problem reported,
and another build (make check) failure.
+2003-05-20 Frank Ch. Eigler <fche@redhat.com>
+
+ * mf-hooks.c (LIBMUDFLAPTH_THREADS_MAX): New macro, replaces
+ PTHREAD_THREADS_MAX. Update users.
+ * mf-runtime.c (__mf_usage): Print [active] instead of [default]
+ for active options.
+ * testsuite/Makefile.am (all-local): Prime dejagnu site.exp file
+ with libmudflapth presence indicator.
+ * testsuite/Makefile.in: Regenerated.
Index: mf-hooks.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-hooks.c,v
retrieving revision 1.1.2.33
diff -u -p -r1.1.2.33 mf-hooks.c
--- mf-hooks.c 16 May 2003 19:56:55 -0000 1.1.2.33
+++ mf-hooks.c 20 May 2003 19:08:40 -0000
@@ -924,13 +924,10 @@ struct pthread_info
};
-/* To avoid dynamic memory allocation, use static array.
- This should be defined in <limits.h>. */
-#ifndef PTHREAD_THREADS_MAX
-#define PTHREAD_THREADS_MAX 1000
-#endif
+/* To avoid dynamic memory allocation, use static array. */
+#define LIBMUDFLAPTH_THREADS_MAX 1000
-static struct pthread_info __mf_pthread_info[PTHREAD_THREADS_MAX];
+static struct pthread_info __mf_pthread_info[LIBMUDFLAPTH_THREADS_MAX];
/* XXX: needs a lock */
@@ -1001,7 +998,7 @@ WRAPPER(int, pthread_create, pthread_t *
/* LOCKTH(); */
/* Garbage collect dead thread stacks. */
- for (i = 0; i < PTHREAD_THREADS_MAX; i++)
+ for (i = 0; i < LIBMUDFLAPTH_THREADS_MAX; i++)
{
pi = & __mf_pthread_info [i];
if (pi->used_p && pi->dead_p
@@ -1017,7 +1014,7 @@ WRAPPER(int, pthread_create, pthread_t *
}
/* Find a slot in __mf_pthread_info to track this thread. */
- for (i = 0; i < PTHREAD_THREADS_MAX; i++)
+ for (i = 0; i < LIBMUDFLAPTH_THREADS_MAX; i++)
{
pi = & __mf_pthread_info [i];
if (! pi->used_p)
@@ -1028,7 +1025,7 @@ WRAPPER(int, pthread_create, pthread_t *
}
/* UNLOCKTH(); */
- if (i == PTHREAD_THREADS_MAX) /* no slots free - simulated out-of-memory. */
+ if (i == LIBMUDFLAPTH_THREADS_MAX) /* no slots free - simulated out-of-memory. */
{
errno = EAGAIN;
pi->used_p = 0;
Index: mf-runtime.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-runtime.c,v
retrieving revision 1.1.2.36
diff -u -p -r1.1.2.36 mf-runtime.c
--- mf-runtime.c 16 May 2003 19:56:55 -0000 1.1.2.36
+++ mf-runtime.c 20 May 2003 19:08:40 -0000
@@ -372,7 +372,7 @@ __mf_usage ()
case set_option:
fprintf (stderr, "-%-23.23s %s", opt->name, opt->description);
if (default_p)
- fprintf (stderr, " [default]\n");
+ fprintf (stderr, " [active]\n");
else
fprintf (stderr, "\n");
break;
Index: testsuite/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/testsuite/Attic/Makefile.am,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 Makefile.am
--- testsuite/Makefile.am 26 Feb 2003 19:00:37 -0000 1.1.2.1
+++ testsuite/Makefile.am 20 May 2003 19:08:40 -0000
@@ -9,3 +9,10 @@ EXPECT = `if [ -f ../../expect/expect ]
RUNTEST = `if [ -f ${srcdir}/../../dejagnu/runtest ] ; then \
echo ${srcdir}/../../dejagnu/runtest ; \
else echo runtest ; fi`
+
+all-local: site.exp
+if LIBMUDFLAPTH
+ echo 'set libmudflapth 1' >> site.exp
+else
+ echo 'set libmudflapth 0' >> site.exp
+endif
Index: testsuite/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/testsuite/Attic/Makefile.in,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 Makefile.in
--- testsuite/Makefile.in 12 May 2003 14:16:21 -0000 1.1.2.4
+++ testsuite/Makefile.in 20 May 2003 19:08:41 -0000
@@ -72,7 +72,6 @@ DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
-LDD = @LDD@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
@@ -198,7 +197,7 @@ install-am: all-am
install: install-am
uninstall-am:
uninstall: uninstall-am
-all-am: Makefile
+all-am: Makefile all-local
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
@@ -236,10 +235,14 @@ maintainer-clean: maintainer-clean-am
.PHONY: tags distdir check-DEJAGNU info-am info dvi-am dvi check \
check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all installdirs mostlyclean-generic \
+all-local all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
+
+all-local: site.exp
+@LIBMUDFLAPTH_TRUE@ echo 'set libmudflapth 1' >> site.exp
+@LIBMUDFLAPTH_FALSE@ echo 'set libmudflapth 0' >> site.exp
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.