From: bryce Date: Sat, 30 Dec 2000 12:18:39 +0000 (+0000) Subject: For boehm-gc: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6bbd0503bb6228a6b03d3c4f9a6846eb46bbce0;p=gc For boehm-gc: * configure.in: Rename THREADLIB to THREADLIBS. * Makefile.am (LINK): Add $(THREADLIBS) to libtool command line. This ensures that we link the correct version of the linuxthreads semaphore functions. * Makefile.in: Rebuilt. * configure: Rebuilt. * linux_thread.c (GC_thr_init, GC_suspend_handler): Add SIGABRT to the list of signals which are not blocked during suspend in the NO_SIGNALS case. For libjava: * Makefile.am (libgcj_la_LIBADD): Add $(THREADLIBS). This ensures that the correct versions of various linuxthreads functions get linked. * Makefile.in: Rebuilt. * java/lang/natThread.cc (finalize_native): New static function. Call _Jv_ThreadDestroyData. (initialize_native): Register finalizer for "data". * include/posix-threads.h (_Jv_ThreadInitData): New simpler prototype. (_Jv_ThreadDestroyData): New prototype. * include/win32-threads.h: Ditto. * include/no-threads.h: Ditto. * posix-threads.cc (_Jv_ThreadInitData): Implement new prototype. (_Jv_ThreadDestroyData): New function. Free native thread "data" and move mutex and condition variable destroy code from: (really_start): ...here. (_Jv_ThreadStart): Set PTHREAD_CREATE_DETACHED. * win32-threads.cc (_Jv_ThreadInitData): Implement new prototype. (_Jv_ThreadDestroyData): Implemented. * nogc.cc (_Jv_AllocObject): Use "void *" not "ptr_t". (_Jv_AllocArray): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38557 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/ChangeLog b/ChangeLog index eb91029e..2ae9240e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2000-12-30 Bryce McKinlay + + * configure.in: Rename THREADLIB to THREADLIBS. + * Makefile.am (LINK): Add $(THREADLIBS) to libtool command line. This + ensures that we link the correct version of the linuxthreads semaphore + functions. + * Makefile.in: Rebuilt. + * configure: Rebuilt. + + * linux_thread.c (GC_thr_init, GC_suspend_handler): Add SIGABRT to the + list of signals which are not blocked during suspend in the NO_SIGNALS + case. + 2000-12-23 Hans Boehm * gcj_mlc.c (GC_gcj_malloc): Don't release allocation lock twice. diff --git a/Makefile.am b/Makefile.am index f2286c4b..06d740b1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,7 +32,10 @@ hpux_irix_threads.c linux_threads.c malloc.c mallocx.c mark.c mark_rts.c \ misc.c new_hblk.c obj_map.c os_dep.c pcr_interface.c ptr_chck.c \ real_malloc.c reclaim.c solaris_pthreads.c solaris_threads.c \ solaris_threads.h stubborn.c typd_mlc.c version.h weakpointer.h -libgcjgc_la_LIBADD = @addobjs@ + +# Include THREADLIBS here to ensure that the correct versions of +# linuxthread semaphore functions get linked: +libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) libgcjgc_la_DEPENDENCIES = @addobjs@ libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir) @@ -45,7 +48,7 @@ AM_CFLAGS = @BOEHM_GC_CFLAGS@ check_PROGRAMS = gctest gctest_SOURCES = test.c -gctest_LDADD = ./libgcjgc.la $(THREADLIB) $(EXTRA_TEST_LIBS) +gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS) TESTS = gctest diff --git a/Makefile.in b/Makefile.in index e12d68d7..ec91baa6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -87,7 +87,7 @@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ -THREADLIB = @THREADLIB@ +THREADLIBS = @THREADLIBS@ VERSION = @VERSION@ addobjs = @addobjs@ boehm_gc_basedir = @boehm_gc_basedir@ @@ -102,19 +102,30 @@ MULTIDIRS = MULTISUBDIR = MULTIDO = true MULTICLEAN = true -@USE_LIBDIR_TRUE@toolexeclibdir = $(libdir)$(MULTISUBDIR) -@USE_LIBDIR_FALSE@toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR) -@USE_LIBDIR_FALSE@toolexecdir = $(exec_prefix)/$(target_alias) +@USE_LIBDIR_TRUE@toolexeclibdir = @USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR) +@USE_LIBDIR_FALSE@toolexeclibdir = @USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR) +@USE_LIBDIR_FALSE@toolexecdir = @USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias) toolexeclib_LTLIBRARIES = $(target_all) EXTRA_LTLIBRARIES = libgcjgc.la -libgcjgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c gcconfig.h dbg_mlc.c dyn_load.c finalize.c gc.h gc_alloc.h gc_cpp.h gc_hdrs.h gc_mark.h gc_priv.h gc_private.h gc_typed.h gcj_mlc.c headers.c hpux_irix_threads.c linux_threads.c malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c solaris_pthreads.c solaris_threads.c solaris_threads.h stubborn.c typd_mlc.c version.h weakpointer.h - -libgcjgc_la_LIBADD = @addobjs@ +libgcjgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c \ +gcconfig.h dbg_mlc.c dyn_load.c finalize.c gc.h gc_alloc.h gc_cpp.h \ +gc_hdrs.h gc_mark.h gc_priv.h gc_private.h gc_typed.h gcj_mlc.c headers.c \ +hpux_irix_threads.c linux_threads.c malloc.c mallocx.c mark.c mark_rts.c \ +misc.c new_hblk.c obj_map.c os_dep.c pcr_interface.c ptr_chck.c \ +real_malloc.c reclaim.c solaris_pthreads.c solaris_threads.c \ +solaris_threads.h stubborn.c typd_mlc.c version.h weakpointer.h + + +# Include THREADLIBS here to ensure that the correct versions of +# linuxthread semaphore functions get linked: +libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) libgcjgc_la_DEPENDENCIES = @addobjs@ libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir) -EXTRA_libgcjgc_la_SOURCES = alpha_mach_dep.s mips_sgi_mach_dep.s mips_ultrix_mach_dep.s rs6000_mach_dep.s sparc_mach_dep.s sparc_sunos4_mach_dep.s mach_dep.c ecos.cc +EXTRA_libgcjgc_la_SOURCES = alpha_mach_dep.s mips_sgi_mach_dep.s \ +mips_ultrix_mach_dep.s rs6000_mach_dep.s sparc_mach_dep.s \ +sparc_sunos4_mach_dep.s mach_dep.c ecos.cc AM_CXXFLAGS = @BOEHM_GC_CFLAGS@ @@ -123,20 +134,58 @@ AM_CFLAGS = @BOEHM_GC_CFLAGS@ check_PROGRAMS = gctest gctest_SOURCES = test.c -gctest_LDADD = ./libgcjgc.la $(THREADLIB) $(EXTRA_TEST_LIBS) +gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS) TESTS = gctest all_objs = @addobjs@ $(libgcjgc_la_OBJECTS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(MY_CFLAGS) $(BOEHM_GC_CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(MY_CFLAGS) $(BOEHM_GC_CFLAGS) LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@ # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and # friends when we are called from the top level Makefile. -AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "EXPECT=$(EXPECT)" "RUNTEST=$(RUNTEST)" "RUNTESTFLAGS=$(RUNTESTFLAGS)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "prefix=$(prefix)" "tooldir=$(tooldir)" "AR=$(AR)" "AS=$(AS)" "CC=$(CC)" "CXX=$(CXX)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "NM=$(NM)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "DESTDIR=$(DESTDIR)" +AM_MAKEFLAGS = \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS=$(CFLAGS)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "MAKE=$(MAKE)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ + "PICFLAG=$(PICFLAG)" \ + "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ + "SHELL=$(SHELL)" \ + "EXPECT=$(EXPECT)" \ + "RUNTEST=$(RUNTEST)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "exec_prefix=$(exec_prefix)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "prefix=$(prefix)" \ + "tooldir=$(tooldir)" \ + "AR=$(AR)" \ + "AS=$(AS)" \ + "CC=$(CC)" \ + "CXX=$(CXX)" \ + "LD=$(LD)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "NM=$(NM)" \ + "PICFLAG=$(PICFLAG)" \ + "RANLIB=$(RANLIB)" \ + "DESTDIR=$(DESTDIR)" CONFIG_STATUS_DEPENDENCIES = $(boehm_gc_basedir)/configure.host @@ -176,7 +225,7 @@ aclocal.m4 configure configure.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best SOURCES = $(libgcjgc_la_SOURCES) $(EXTRA_libgcjgc_la_SOURCES) $(gctest_SOURCES) OBJECTS = $(libgcjgc_la_OBJECTS) $(gctest_OBJECTS) @@ -357,7 +406,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/configure b/configure index cd68c6b5..c11cf55f 100755 --- a/configure +++ b/configure @@ -2609,7 +2609,7 @@ if test "$THREADS" = yes; then fi INCLUDES= -THREADLIB= +THREADLIBS= case "$THREADS" in no | none | single) THREADS=none @@ -2644,7 +2644,7 @@ EOF ;; esac - THREADLIB=-lpthread + THREADLIBS=-lpthread ;; decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks) { echo "configure: error: thread package $THREADS not yet supported" 1>&2; exit 1; } @@ -3042,7 +3042,7 @@ s%@OBJEXT@%$OBJEXT%g s%@STRIP@%$STRIP%g s%@LIBTOOL@%$LIBTOOL%g s%@CXXCPP@%$CXXCPP%g -s%@THREADLIB@%$THREADLIB%g +s%@THREADLIBS@%$THREADLIBS%g s%@EXTRA_TEST_LIBS@%$EXTRA_TEST_LIBS%g s%@target_all@%$target_all%g s%@INCLUDES@%$INCLUDES%g diff --git a/configure.in b/configure.in index ea23b512..6a75b192 100644 --- a/configure.in +++ b/configure.in @@ -66,7 +66,7 @@ if test "$THREADS" = yes; then fi INCLUDES= -THREADLIB= +THREADLIBS= case "$THREADS" in no | none | single) THREADS=none @@ -86,7 +86,7 @@ case "$THREADS" in AC_DEFINE(IRIX_THREADS) ;; esac - THREADLIB=-lpthread + THREADLIBS=-lpthread ;; decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks) AC_MSG_ERROR(thread package $THREADS not yet supported) @@ -96,7 +96,7 @@ case "$THREADS" in ;; esac AC_MSG_RESULT($THREADS) -AC_SUBST(THREADLIB) +AC_SUBST(THREADLIBS) AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl") AC_SUBST(EXTRA_TEST_LIBS) diff --git a/linux_threads.c b/linux_threads.c index c3f19b8e..cac52374 100644 --- a/linux_threads.c +++ b/linux_threads.c @@ -201,6 +201,7 @@ void GC_suspend_handler(int sig) if (sigdelset(&mask, SIGINT) != 0) ABORT("sigdelset() failed"); if (sigdelset(&mask, SIGQUIT) != 0) ABORT("sigdelset() failed"); if (sigdelset(&mask, SIGTERM) != 0) ABORT("sigdelset() failed"); + if (sigdelset(&mask, SIGABRT) != 0) ABORT("sigdelset() failed"); # endif do { me->signal = 0; @@ -487,7 +488,8 @@ void GC_thr_init() # ifdef NO_SIGNALS if (sigdelset(&act.sa_mask, SIGINT) != 0 || sigdelset(&act.sa_mask, SIGQUIT != 0) - || sigdelset(&act.sa_mask, SIGTERM != 0)) { + || sigdelset(&act.sa_mask, SIGTERM != 0) + || sigdelset(&act.sa_mask, SIGABRT != 0)) { ABORT("sigdelset() failed"); } # endif