diff options
Diffstat (limited to 'boehm-gc')
-rw-r--r-- | boehm-gc/ChangeLog | 133 | ||||
-rw-r--r-- | boehm-gc/Makefile.am | 22 | ||||
-rw-r--r-- | boehm-gc/Makefile.in | 146 | ||||
-rw-r--r-- | boehm-gc/allchblk.c | 10 | ||||
-rwxr-xr-x | boehm-gc/configure | 168 | ||||
-rw-r--r-- | boehm-gc/configure.in | 10 | ||||
-rw-r--r-- | boehm-gc/doc/README.environment | 11 | ||||
-rw-r--r-- | boehm-gc/dyn_load.c | 13 | ||||
-rw-r--r-- | boehm-gc/include/private/gc_priv.h | 15 | ||||
-rw-r--r-- | boehm-gc/include/private/gcconfig.h | 325 | ||||
-rw-r--r-- | boehm-gc/include/private/specific.h | 24 | ||||
-rw-r--r-- | boehm-gc/linux_threads.c | 11 | ||||
-rw-r--r-- | boehm-gc/mark.c | 12 | ||||
-rw-r--r-- | boehm-gc/misc.c | 40 | ||||
-rw-r--r-- | boehm-gc/os_dep.c | 52 | ||||
-rw-r--r-- | boehm-gc/reclaim.c | 38 | ||||
-rw-r--r-- | boehm-gc/specific.c | 21 | ||||
-rw-r--r-- | boehm-gc/win32_threads.c | 17 |
18 files changed, 721 insertions, 347 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 4b1ac14cb85..92b98ab6f44 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,136 @@ +2002-07-25 Release Manager + + * GCC 3.1.1 Released. + +2002-06-28 Hans Boehm <Hans_Boehm@hp.com> + Jonathan Clark + + * win32_threads.c (GC_push_all_stacks): Tolerate bad sp. + +2002-05-14 Release Manager + + * GCC 3.1 Released. + +2002-05-14 Release Manager + + * GCC 3.1 Released. + +2002-05-08 Alexandre Oliva <aoliva@redhat.com> + + * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at + script entry, and set LD to it when configuring multilibs. + * configure: Rebuilt. + +2002-04-22 Jeff Sturm <jsturm@one-point.com> + + * Makefile.am (toolexeclib_LTLIBRARIES): Remove. + (noinst_LTLIBRARIES): Add libgcjgc.la. + + * Makefile.in: Rebuild. + +2002-04-22 David S. Miller <davem@redhat.com> + + * include/private/gcconfig.h: Hard-code STACKBOTTOM on + 64-bit SPARC Linux, the __libc_stack_end technique does + not work in this case. + +2002-04-22 Jeff Sturm <jsturm@one-point.com> + + * gcconfig.h: Enable DYNAMIC_LOADING for all sparc-solaris ABIs. + +2002-04-17 Hans Boehm <Hans_Boehm@hp.com> + + * include/private/gcconfig.h: Use LINUX_STACKBOTTOM for + SPARC Linux. + +2002-04-09 Loren J. Rittle <ljrittle@acm.org> + Richard Henderson <rth@redhat.com> + + * include/private/gcconfig.h (DATAEND): Update comment example + to match reality. Clarify comment. + Change all likely references to linker script synthesized + symbols to use this idiom: extern int etext[]; etext + * os_dep.c (GC_init_linux_data_start): Fix references to + __data_start and _end. + +2002-04-08 Hans Boehm <Hans_Boehm@hp.com> + + * include/private/gc_priv.h (WARN macro): Add "GC warning:" prefix. + (GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed): + declare. + * allchblk.c (GC_allchblk_nth): Change text and support reduced + frequency for blacklist warning message. + * misc.c (GC_large_alloc_warn_interval, + GC_large_alloc_warn_suppressed): define. + (GC_init_inner): Check GC_NO_BLACKLIST_WARNING and + GC_LARGE_ALLOC_WARN_INTERVAL environment variables. + * doc/README.environment (GC_NO_BLACKLIST_WARNING): Deprecate. + (GC_LARGE_ALLOC_WARN_INTERVAL): Add documentation. + + * dyn_load.c (_DYNAMIC): Move declaration to file scope. + +2002-04-04 Loren J. Rittle <ljrittle@acm.org> + + * include/private/gcconfig.h: Add support for an unmapped + memory hole between the end of the initialized data segment + and the start of the BSS on FreeBSD/i386. + +2002-04-01 Loren J. Rittle <ljrittle@acm.org> + + * include/private/gcconfig.h: Add unified test for FreeBSD. + Support FreeBSD/alpha. + * os_dep.c: Do not include <machine/trap.h> unless available. + (GC_freebsd_stack_base): Fix types. + +2002-03-30 Krister Walfridsson <cato@df.lth.se> + + * include/private/gcconfig.h: define DYNAMIC_LOADING for ELF + NetBSD/i386. + +2002-03-29 Hans Boehm <Hans_Boehm@hp.com> + + * linux_threads.c (return_free_lists): Clear fl[i] unconditionally. + (GC_local_gcj_malloc): Add assertion. + (start_mark_threads): Fix abort message. + * mark.c (GC_mark_from): Generalize assertion. + * reclaim.c (GC_clear_fl_links): New function. + (GC_start_reclaim): Must clear some freelist links. + * include/private/specific.h, specific.c: Add assertions. + Safer definition for INVALID_QTID, quick_thread_id. Fix/add comments. + Rearrange tse fields. + +2002-03-24 Jeff Sturm <jsturm@one-point.com> + + * linux_threads.c (GC_get_nprocs): Close file descriptor. + +2002-03-15 Anthony Green <green@redhat.com> + + * misc.c (GC_init_inner): Initialize GC_write_cs before use. + * configure.in: Disable use of getenv for win32 targets (some of + which have broken implementations). + * configure: Rebuilt. + +2002-03-12 Adam Megacz <adam@xwt.org> + + * dyn_load.c: Renamed GC_win32s to GC_no_win32_dlls. + * misc.c: Renamed GC_is_win32s() to GC_no_win32_dlls + * os_dep.c: Renamed GC_win32s to GC_no_win32_dlls and + statically initialized it to TRUE if compiling with GCC. + * win32_threads.c (thread_start): We no longer use SEH if + compiling with GCC. + * mark.c (GC_mark_some): We no longer use SEH if + compiling with GCC. + +2002-03-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz> + + * include/gc_priv.h: Define ALIGN_DOUBLE on 32 bit targets if GCJ + support is enabled, for hash synchronization. + +2002-03-17 Bryce McKinlay <bryce@waitaki.otago.ac.nz> + + * Makefile.am: Make a convenience library. + * Makefile.in: Rebuilt. + 2002-02-24 Adam Megacz <adam@xwt.org> * Makefile.am: Added win32_threads.c to sources list. diff --git a/boehm-gc/Makefile.am b/boehm-gc/Makefile.am index 12a072dcdd4..e9e1c6107c6 100644 --- a/boehm-gc/Makefile.am +++ b/boehm-gc/Makefile.am @@ -25,25 +25,33 @@ toolexecdir = $(exec_prefix)/$(target_alias) toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR) endif -toolexeclib_LTLIBRARIES = $(target_all) -EXTRA_LTLIBRARIES = libgcjgc.la -libgcjgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \ +noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la + +GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \ dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c 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 specific.c stubborn.c typd_mlc.c \ backgraph.c win32_threads.c +EXTRA_GC_SOURCES = alpha_mach_dep.s \ +mips_sgi_mach_dep.S mips_ultrix_mach_dep.s powerpc_macosx_mach_dep.s \ +rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \ +sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s + +libgcjgc_la_SOURCES = $(GC_SOURCES) +libgcjgc_convenience_la_SOURCES = $(GC_SOURCES) +EXTRA_libgcjgc_la_SOURCES = $(EXTRA_GC_SOURCES) +EXTRA_libgcjgc_convenience_la_SOURCES = $(EXTRA_GC_SOURCES) + # 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 powerpc_macosx_mach_dep.s \ -rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \ -sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s +libgcjgc_convenience_la_LIBADD = @addobjs@ +libgcjgc_convenience_la_DEPENDENCIES = @addobjs@ AM_CXXFLAGS = @GC_CFLAGS@ AM_CFLAGS = @GC_CFLAGS@ diff --git a/boehm-gc/Makefile.in b/boehm-gc/Makefile.in index f56e6804066..c540de4d6f9 100644 --- a/boehm-gc/Makefile.in +++ b/boehm-gc/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,14 +105,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 dbg_mlc.c dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c 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 specific.c stubborn.c typd_mlc.c backgraph.c win32_threads.c +noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la +GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \ +dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c 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 specific.c stubborn.c typd_mlc.c \ +backgraph.c win32_threads.c + + +EXTRA_GC_SOURCES = alpha_mach_dep.s \ +mips_sgi_mach_dep.S mips_ultrix_mach_dep.s powerpc_macosx_mach_dep.s \ +rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \ +sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s + + +libgcjgc_la_SOURCES = $(GC_SOURCES) +libgcjgc_convenience_la_SOURCES = $(GC_SOURCES) +EXTRA_libgcjgc_la_SOURCES = $(EXTRA_GC_SOURCES) +EXTRA_libgcjgc_convenience_la_SOURCES = $(EXTRA_GC_SOURCES) # Include THREADLIBS here to ensure that the correct versions of # linuxthread semaphore functions get linked: @@ -120,8 +136,8 @@ 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 powerpc_macosx_mach_dep.s rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s - +libgcjgc_convenience_la_LIBADD = @addobjs@ +libgcjgc_convenience_la_DEPENDENCIES = @addobjs@ AM_CXXFLAGS = @GC_CFLAGS@ @@ -138,14 +154,52 @@ TESTS = gctest all_objs = @addobjs@ $(libgcjgc_la_OBJECTS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(MY_CFLAGS) $(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 = $(srcdir)/configure.host @@ -153,7 +207,7 @@ CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host MAKEOVERRIDES = ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 CONFIG_CLEAN_FILES = -LTLIBRARIES = $(toolexeclib_LTLIBRARIES) +LTLIBRARIES = $(noinst_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) @@ -167,6 +221,14 @@ mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo pcr_interface.lo \ ptr_chck.lo real_malloc.lo reclaim.lo solaris_pthreads.lo \ solaris_threads.lo specific.lo stubborn.lo typd_mlc.lo backgraph.lo \ win32_threads.lo +libgcjgc_convenience_la_LDFLAGS = +libgcjgc_convenience_la_OBJECTS = allchblk.lo alloc.lo blacklst.lo \ +checksums.lo dbg_mlc.lo dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \ +headers.lo irix_threads.lo linux_threads.lo malloc.lo mallocx.lo \ +mark.lo mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo \ +pcr_interface.lo ptr_chck.lo real_malloc.lo reclaim.lo \ +solaris_pthreads.lo solaris_threads.lo specific.lo stubborn.lo \ +typd_mlc.lo backgraph.lo win32_threads.lo check_PROGRAMS = gctest$(EXEEXT) gctest_DEPENDENCIES = ./libgcjgc.la CFLAGS = @CFLAGS@ @@ -179,10 +241,10 @@ ltmain.sh mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best -SOURCES = $(libgcjgc_la_SOURCES) $(EXTRA_libgcjgc_la_SOURCES) -OBJECTS = $(libgcjgc_la_OBJECTS) +SOURCES = $(libgcjgc_la_SOURCES) $(EXTRA_libgcjgc_la_SOURCES) $(libgcjgc_convenience_la_SOURCES) $(EXTRA_libgcjgc_convenience_la_SOURCES) +OBJECTS = $(libgcjgc_la_OBJECTS) $(libgcjgc_convenience_la_OBJECTS) all: all-redirect .SUFFIXES: @@ -197,35 +259,19 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) -config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) -mostlyclean-toolexeclibLTLIBRARIES: +mostlyclean-noinstLTLIBRARIES: -clean-toolexeclibLTLIBRARIES: - -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES) +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) -distclean-toolexeclibLTLIBRARIES: +distclean-noinstLTLIBRARIES: -maintainer-clean-toolexeclibLTLIBRARIES: - -install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) - @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \ - $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \ - else :; fi; \ - done - -uninstall-toolexeclibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \ - done +maintainer-clean-noinstLTLIBRARIES: .c.o: $(COMPILE) -c $< @@ -271,6 +317,9 @@ maintainer-clean-libtool: libgcjgc.la: $(libgcjgc_la_OBJECTS) $(libgcjgc_la_DEPENDENCIES) $(LINK) $(libgcjgc_la_LDFLAGS) $(libgcjgc_la_OBJECTS) $(libgcjgc_la_LIBADD) $(LIBS) +libgcjgc_convenience.la: $(libgcjgc_convenience_la_OBJECTS) $(libgcjgc_convenience_la_DEPENDENCIES) + $(LINK) $(libgcjgc_convenience_la_LDFLAGS) $(libgcjgc_convenience_la_OBJECTS) $(libgcjgc_convenience_la_LIBADD) $(LIBS) + mostlyclean-checkPROGRAMS: clean-checkPROGRAMS: @@ -320,7 +369,7 @@ maintainer-clean-recursive: dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ - test "$$subdir" = "." && dot_seen=yes; \ + test "$$subdir" != "." || dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ @@ -467,7 +516,7 @@ installcheck-am: installcheck: installcheck-recursive install-info-am: install-info: install-info-recursive -install-exec-am: install-toolexeclibLTLIBRARIES +install-exec-am: install-exec: install-exec-recursive install-data-am: @@ -476,7 +525,7 @@ install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive -uninstall-am: uninstall-toolexeclibLTLIBRARIES +uninstall-am: uninstall: uninstall-recursive all-am: Makefile $(LTLIBRARIES) all-redirect: all-recursive @@ -484,7 +533,6 @@ install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) mostlyclean-generic: @@ -496,19 +544,19 @@ distclean-generic: -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -mostlyclean-am: mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \ +mostlyclean-am: mostlyclean-noinstLTLIBRARIES mostlyclean-compile \ mostlyclean-libtool mostlyclean-checkPROGRAMS \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive -clean-am: clean-toolexeclibLTLIBRARIES clean-compile clean-libtool \ +clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ clean-checkPROGRAMS clean-tags clean-generic \ mostlyclean-am clean: clean-recursive -distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \ +distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ distclean-libtool distclean-checkPROGRAMS \ distclean-tags distclean-generic clean-am -rm -f libtool @@ -516,7 +564,7 @@ distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \ distclean: distclean-recursive -rm -f config.status -maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \ +maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-checkPROGRAMS maintainer-clean-tags \ maintainer-clean-generic distclean-am @@ -526,10 +574,8 @@ maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \ maintainer-clean: maintainer-clean-recursive -rm -f config.status -.PHONY: mostlyclean-toolexeclibLTLIBRARIES \ -distclean-toolexeclibLTLIBRARIES clean-toolexeclibLTLIBRARIES \ -maintainer-clean-toolexeclibLTLIBRARIES \ -uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \ +.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ +clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool mostlyclean-checkPROGRAMS \ diff --git a/boehm-gc/allchblk.c b/boehm-gc/allchblk.c index 3da58c4ca0c..7d4cbd82f13 100644 --- a/boehm-gc/allchblk.c +++ b/boehm-gc/allchblk.c @@ -654,9 +654,13 @@ int n; && orig_avail - size_needed > (signed_word)BL_LIMIT) { /* Punt, since anything else risks unreasonable heap growth. */ - if (0 == GETENV("GC_NO_BLACKLIST_WARNING")) { - WARN("Needed to allocate blacklisted block at 0x%lx\n", - (word)hbp); + if (++GC_large_alloc_warn_suppressed + >= GC_large_alloc_warn_interval) { + WARN("Repeated allocation of very large block " + "(appr. size %ld):\n" + "\tMay lead to memory leak and poor performance.\n", + size_needed); + GC_large_alloc_warn_suppressed = 0; } size_avail = orig_avail; } else if (size_avail == 0 && size_needed == HBLKSIZE diff --git a/boehm-gc/configure b/boehm-gc/configure index e2b4840c9d5..eb4d9841faf 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -61,6 +61,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -175,6 +176,7 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -345,6 +347,11 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -510,12 +517,16 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -555,6 +566,12 @@ fi +# This works around the fact that libtool configuration may change LD +# for this particular configuration, but some shells, instead of +# keeping the changes in LD private, export them just because LD is +# exported. +ORIGINAL_LD_FOR_MULTILIBS=$LD + ac_aux_dir= for ac_dir in . $srcdir/.; do if test -f $ac_dir/install-sh; then @@ -587,7 +604,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:591: checking for a BSD compatible install" >&5 +echo "configure:608: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -640,7 +657,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:644: checking whether build environment is sane" >&5 +echo "configure:661: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -697,7 +714,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:701: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:718: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -730,12 +747,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:734: checking for Cygwin environment" >&5 +echo "configure:751: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 739 "configure" +#line 756 "configure" #include "confdefs.h" int main() { @@ -746,7 +763,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -763,19 +780,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:767: checking for mingw32 environment" >&5 +echo "configure:784: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 772 "configure" +#line 789 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -886,7 +903,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:890: checking host system type" >&5 +echo "configure:907: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -907,7 +924,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:911: checking target system type" >&5 +echo "configure:928: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -925,7 +942,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:929: checking build system type" >&5 +echo "configure:946: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -965,7 +982,7 @@ fi missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:969: checking for working aclocal" >&5 +echo "configure:986: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -978,7 +995,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:982: checking for working autoconf" >&5 +echo "configure:999: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -991,7 +1008,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:995: checking for working automake" >&5 +echo "configure:1012: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1004,7 +1021,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1008: checking for working autoheader" >&5 +echo "configure:1025: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1017,7 +1034,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1021: checking for working makeinfo" >&5 +echo "configure:1038: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1043,7 +1060,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1047: checking for $ac_word" >&5 +echo "configure:1064: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1073,7 +1090,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1077: checking for $ac_word" >&5 +echo "configure:1094: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1122,7 +1139,7 @@ fi fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1126: checking whether we are using GNU C" >&5 +echo "configure:1143: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1131,7 +1148,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1146,7 +1163,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1150: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1167: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1183,7 +1200,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1187: checking for $ac_word" >&5 +echo "configure:1204: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1216,7 +1233,7 @@ test -n "$CXX" || CXX="gcc" test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1220: checking whether we are using GNU C++" >&5 +echo "configure:1237: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1225,7 +1242,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1240,7 +1257,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1244: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1261: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1273,7 +1290,7 @@ fi # NEWLIB_CONFIGURE, which doesn't work because that means that it will # be run before AC_CANONICAL_HOST. echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1277: checking build system type" >&5 +echo "configure:1294: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1294,7 +1311,7 @@ echo "$ac_t""$build" 1>&6 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1298: checking for $ac_word" >&5 +echo "configure:1315: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1326,7 +1343,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1330: checking for $ac_word" >&5 +echo "configure:1347: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1358,7 +1375,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1362: checking for $ac_word" >&5 +echo "configure:1379: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1390,7 +1407,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1394: checking for $ac_word" >&5 +echo "configure:1411: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1435,7 +1452,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1439: checking for a BSD compatible install" >&5 +echo "configure:1456: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1489,7 +1506,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:1493: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:1510: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -1527,7 +1544,7 @@ if false; then echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1531: checking for executable suffix" >&5 +echo "configure:1548: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1537,10 +1554,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1659,7 +1676,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1663: checking for ld used by GCC" >&5 +echo "configure:1680: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1689,10 +1706,10 @@ echo "configure:1663: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1693: checking for GNU ld" >&5 +echo "configure:1710: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1696: checking for non-GNU ld" >&5 +echo "configure:1713: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1727,7 +1744,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1731: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1748: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1744,7 +1761,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1748: checking for $LD option to reload object files" >&5 +echo "configure:1765: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1756,7 +1773,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1760: checking for BSD-compatible nm" >&5 +echo "configure:1777: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1794,7 +1811,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1798: checking whether ln -s works" >&5 +echo "configure:1815: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1815,7 +1832,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1819: checking how to recognise dependant libraries" >&5 +echo "configure:1836: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1979,13 +1996,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1983: checking for object suffix" >&5 +echo "configure:2000: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -2009,7 +2026,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:2013: checking for ${ac_tool_prefix}file" >&5 +echo "configure:2030: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2071,7 +2088,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:2075: checking for file" >&5 +echo "configure:2092: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2142,7 +2159,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2146: checking for $ac_word" >&5 +echo "configure:2163: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2174,7 +2191,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2178: checking for $ac_word" >&5 +echo "configure:2195: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2209,7 +2226,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2213: checking for $ac_word" >&5 +echo "configure:2230: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2241,7 +2258,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2245: checking for $ac_word" >&5 +echo "configure:2262: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2308,8 +2325,8 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2312 "configure"' > conftest.$ac_ext - if { (eval echo configure:2313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2329 "configure"' > conftest.$ac_ext + if { (eval echo configure:2330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2330,7 +2347,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2334: checking whether the C compiler needs -belf" >&5 +echo "configure:2351: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2343,14 +2360,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <<EOF -#line 2347 "configure" +#line 2364 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2380,7 +2397,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:2384: checking how to run the C++ preprocessor" >&5 +echo "configure:2401: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2393,12 +2410,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext <<EOF -#line 2397 "configure" +#line 2414 "configure" #include "confdefs.h" #include <stdlib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2545,7 +2562,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:2549: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:2566: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -2578,7 +2595,7 @@ if false; then echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:2582: checking for executable suffix" >&5 +echo "configure:2599: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2588,10 +2605,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:2609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -2611,7 +2628,7 @@ ac_exeext=$EXEEXT fi echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6 -echo "configure:2615: checking for thread model used by GCC" >&5 +echo "configure:2632: checking for thread model used by GCC" >&5 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` if test -z "$THREADS"; then THREADS=no @@ -2727,6 +2744,10 @@ EOF #define GC_WIN32_THREADS 1 EOF + cat >> confdefs.h <<\EOF +#define NO_GETENV 1 +EOF + ;; decosf1 | irix | mach | os2 | solaris | dce | vxworks) { echo "configure: error: thread package $THREADS not yet supported" 1>&2; exit 1; } @@ -2738,7 +2759,7 @@ esac echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2742: checking for dlopen in -ldl" >&5 +echo "configure:2763: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2746,7 +2767,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 2750 "configure" +#line 2771 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2757,7 +2778,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:2761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3321,6 +3342,7 @@ cat >> $CONFIG_STATUS <<\EOF echo "$DEFS" > boehm-cflags if test -n "$CONFIG_FILES"; then + LD="${ORIGINAL_LD_FOR_MULTILIBS}" ac_file=Makefile . ${gc_basedir}/../config-ml.in fi exit 0 diff --git a/boehm-gc/configure.in b/boehm-gc/configure.in index 155653dbf26..1c721823434 100644 --- a/boehm-gc/configure.in +++ b/boehm-gc/configure.in @@ -1,4 +1,4 @@ -# Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved. +# Copyright (c) 1999, 2000, 2001, 2002 by Red Hat, Inc. All rights reserved. # # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. @@ -15,6 +15,12 @@ dnl Process this file with autoconf to produce configure. AC_INIT(gcj_mlc.c) +# This works around the fact that libtool configuration may change LD +# for this particular configuration, but some shells, instead of +# keeping the changes in LD private, export them just because LD is +# exported. +ORIGINAL_LD_FOR_MULTILIBS=$LD + dnl Can't be done in GC_CONFIGURE because that confuses automake. AC_CONFIG_AUX_DIR(.) @@ -109,6 +115,7 @@ case "$THREADS" in ;; win32) AC_DEFINE(GC_WIN32_THREADS) + AC_DEFINE(NO_GETENV) ;; decosf1 | irix | mach | os2 | solaris | dce | vxworks) AC_MSG_ERROR(thread package $THREADS not yet supported) @@ -271,6 +278,7 @@ dnl Put all the -D options in a file. echo "$DEFS" > boehm-cflags if test -n "$CONFIG_FILES"; then + LD="${ORIGINAL_LD_FOR_MULTILIBS}" ac_file=Makefile . ${gc_basedir}/../config-ml.in fi], srcdir=${srcdir} diff --git a/boehm-gc/doc/README.environment b/boehm-gc/doc/README.environment index 6b25af1f6fe..c7daddb0aca 100644 --- a/boehm-gc/doc/README.environment +++ b/boehm-gc/doc/README.environment @@ -30,7 +30,16 @@ GC_NPROCS=<n> - Linux w/threads only. Explicitly sets the number of processors correctness, but may lead to really horrible performance. GC_NO_BLACKLIST_WARNING - Prevents the collector from issuing - "Needed to allocate blacklisted block at ..." warnings. + warnings about allocations of very large blocks. + Deprecated. Use GC_LARGE_ALLOC_WARN_INTERVAL instead. + +GC_LARGE_ALLOC_WARN_INTERVAL=<n> - Print every nth warning about very large + block allocations, starting with the nth one. Small values + of n are generally benign, in that a bounded number of + such warnings generally indicate at most a bounded leak. + For best results it should be set at 1 during testing. + Default is 5. Very large numbers effectively disable the + warning. GC_IGNORE_GCJ_INFO - Ignore the type descriptors implicitly supplied by GC_gcj_malloc and friends. This is useful for debugging diff --git a/boehm-gc/dyn_load.c b/boehm-gc/dyn_load.c index d80600bb1d7..d3ef572be68 100644 --- a/boehm-gc/dyn_load.c +++ b/boehm-gc/dyn_load.c @@ -529,13 +529,14 @@ GC_bool GC_register_dynamic_libraries_dl_iterate_phdr() # endif +#ifdef __GNUC__ +# pragma weak _DYNAMIC +#endif +extern ElfW(Dyn) _DYNAMIC[]; + static struct link_map * GC_FirstDLOpenedLinkMap() { -# ifdef __GNUC__ -# pragma weak _DYNAMIC -# endif - extern ElfW(Dyn) _DYNAMIC[]; ElfW(Dyn) *dp; struct r_debug *r; static struct link_map *cachedResult = 0; @@ -775,7 +776,7 @@ void GC_register_dynamic_libraries() # endif # ifndef MSWINCE - extern GC_bool GC_win32s; + extern GC_bool GC_no_win32_dlls; # endif void GC_register_dynamic_libraries() @@ -788,7 +789,7 @@ void GC_register_dynamic_libraries() char * limit, * new_limit; # ifdef MSWIN32 - if (GC_win32s) return; + if (GC_no_win32_dlls) return; # endif base = limit = p = GC_sysinfo.lpMinimumApplicationAddress; # if defined(MSWINCE) && !defined(_WIN32_WCE_EMULATION) diff --git a/boehm-gc/include/private/gc_priv.h b/boehm-gc/include/private/gc_priv.h index ae406cb9010..b1526aaab2e 100644 --- a/boehm-gc/include/private/gc_priv.h +++ b/boehm-gc/include/private/gc_priv.h @@ -205,6 +205,12 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ /* odd numbered words to have mark bits. */ #endif +#if defined(GC_GCJ_SUPPORT) && ALIGNMENT < 8 && !defined(ALIGN_DOUBLE) + /* GCJ's Hashtable synchronization code requires 64-bit alignment. */ +# define ALIGN_DOUBLE +#endif + + /* ALIGN_DOUBLE requires MERGE_SIZES at present. */ # if defined(ALIGN_DOUBLE) && !defined(MERGE_SIZES) # define MERGE_SIZES @@ -493,7 +499,7 @@ struct hblk; /* See below. */ # endif /* Print warning message, e.g. almost out of memory. */ -# define WARN(msg,arg) (*GC_current_warn_proc)(msg, (GC_word)(arg)) +# define WARN(msg,arg) (*GC_current_warn_proc)("GC Warning: " msg, (GC_word)(arg)) extern GC_warn_proc GC_current_warn_proc; /* Get environment entry */ @@ -1217,7 +1223,12 @@ extern word GC_root_size; /* Total size of registered root sections */ extern GC_bool GC_debugging_started; /* GC_debug_malloc has been called. */ - +extern long GC_large_alloc_warn_interval; + /* Interval between unsuppressed warnings. */ + +extern long GC_large_alloc_warn_suppressed; + /* Number of warnings suppressed so far. */ + /* Operations */ # ifndef abs # define abs(x) ((x) < 0? (-(x)) : (x)) diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index e06cc4abc56..492592b2615 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -38,6 +38,11 @@ # define OPENBSD # endif +/* And one for FreeBSD: */ +# if defined(__FreeBSD__) +# define FREEBSD +# endif + /* Determine the machine type: */ # if defined(__XSCALE__) # define ARM32 @@ -214,7 +219,7 @@ # endif # if defined(__alpha) || defined(__alpha__) # define ALPHA -# if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) +# if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) && !defined(FREEBSD) # define OSF1 /* a.k.a Digital Unix */ # endif # define mach_type_known @@ -262,9 +267,8 @@ # define OPENBSD # define mach_type_known # endif -# if defined(__FreeBSD__) && (defined(i386) || defined(__i386__)) +# if defined(FREEBSD) && (defined(i386) || defined(__i386__)) # define I386 -# define FREEBSD # define mach_type_known # endif # if defined(__NetBSD__) && (defined(i386) || defined(__i386__)) @@ -446,7 +450,12 @@ * On UNIX systems, the collector will scan the area between DATASTART * and DATAEND for root pointers. * - * DATAEND, if not &end. + * DATAEND, if not `end' where `end' is defined as ``extern int end[];''. + * RTH suggests gaining access to linker script synth'd values with + * this idiom instead of `&end' where `end' is defined as ``extern int end;'' . + * Otherwise, ``GCC will assume these are in .sdata/.sbss'' and it will, e.g., + * cause failures on alpha*-*-* with ``-msmall-data or -fpic'' or mips-*-* + * without any special options. * * ALIGN_DOUBLE of GC_malloc should return blocks aligned to twice * the pointer size. @@ -542,14 +551,14 @@ # ifdef OPENBSD # define OS_TYPE "OPENBSD" # define HEURISTIC2 - extern char etext; -# define DATASTART ((ptr_t)(&etext)) + extern char etext[]; +# define DATASTART ((ptr_t)(etext)) # endif # ifdef NETBSD # define OS_TYPE "NETBSD" # define HEURISTIC2 - extern char etext; -# define DATASTART ((ptr_t)(&etext)) + extern char etext[]; +# define DATASTART ((ptr_t)(etext)) # endif # ifdef LINUX # define OS_TYPE "LINUX" @@ -572,24 +581,24 @@ /* contain large read-only data tables */ /* that we'd rather not scan. */ # endif /* !GLIBC2 */ - extern int _end; -# define DATAEND (&_end) + extern int _end[]; +# define DATAEND (_end) # else - extern int etext; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff)) + extern int etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) # endif # endif # ifdef SUNOS4 # define OS_TYPE "SUNOS4" - extern char etext; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ffff) & ~0x1ffff)) + extern char etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0x1ffff) & ~0x1ffff)) # define HEURISTIC1 /* differs */ # define DYNAMIC_LOADING # endif # ifdef HP # define OS_TYPE "HP" - extern char etext; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff)) + extern char etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) # define STACKBOTTOM ((ptr_t) 0xffeffffc) /* empirically determined. seems to work. */ # include <unistd.h> @@ -597,13 +606,13 @@ # endif # ifdef SYSV # define OS_TYPE "SYSV" - extern etext; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \ + extern etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0x3fffff) \ & ~0x3fffff) \ - +((word)&etext & 0x1fff)) + +((word)etext & 0x1fff)) /* This only works for shared-text binaries with magic number 0413. The other sorts of SysV binaries put the data at the end of the text, - in which case the default of &etext would work. Unfortunately, + in which case the default of etext would work. Unfortunately, handling both would require having the magic-number available. -- Parag */ @@ -663,8 +672,8 @@ # define STACK_GRAN 0x10000000 /* Stack usually starts at 0x80000000 */ # define LINUX_DATA_START - extern int _end; -# define DATAEND (&_end) + extern int _end[]; +# define DATAEND (_end) # endif # ifdef MACOSX /* There are reasons to suspect this may not be reliable. */ @@ -681,16 +690,16 @@ # define ALIGNMENT 4 # define OS_TYPE "NETBSD" # define HEURISTIC2 - extern char etext; + extern char etext[]; # define DATASTART GC_data_start # define DYNAMIC_LOADING # endif # ifdef NOSYS # define ALIGNMENT 4 # define OS_TYPE "NOSYS" - extern void __end, __dso_handle; -# define DATASTART (&__dso_handle) /* OK, that's ugly. */ -# define DATAEND (&__end) + extern void __end[], __dso_handle[]; +# define DATASTART (__dso_handle) /* OK, that's ugly. */ +# define DATAEND (__end) /* Stack starts at 0xE0000000 for the simulator. */ # undef STACK_GRAN # define STACK_GRAN 0x10000000 @@ -701,8 +710,8 @@ # ifdef VAX # define MACH_TYPE "VAX" # define ALIGNMENT 4 /* Pointers are longword aligned by 4.2 C compiler */ - extern char etext; -# define DATASTART ((ptr_t)(&etext)) + extern char etext[]; +# define DATASTART ((ptr_t)(etext)) # ifdef BSD # define OS_TYPE "BSD" # define HEURISTIC1 @@ -734,11 +743,11 @@ # define ALIGN_DOUBLE # ifdef SUNOS5 # define OS_TYPE "SUNOS5" - extern int _etext; - extern int _end; + extern int _etext[]; + extern int _end[]; extern char * GC_SysVGetDataStart(); -# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext) -# define DATAEND (&_end) +# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext) +# define DATAEND (_end) # if !defined(USE_MMAP) && defined(REDIRECT_MALLOC) # define USE_MMAP /* Otherwise we now use calloc. Mmap may result in the */ @@ -768,17 +777,15 @@ # define GETPAGESIZE() sysconf(_SC_PAGESIZE) /* getpagesize() appeared to be missing from at least one */ /* Solaris 5.4 installation. Weird. */ -# if CPP_WORDSZ == 32 -# define DYNAMIC_LOADING -# endif +# define DYNAMIC_LOADING # endif # ifdef SUNOS4 # define OS_TYPE "SUNOS4" /* [If you have a weak stomach, don't read this.] */ /* We would like to use: */ -/* # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1fff) & ~0x1fff)) */ +/* # define DATASTART ((ptr_t)((((word) (etext)) + 0x1fff) & ~0x1fff)) */ /* This fails occasionally, due to an ancient, but very */ - /* persistent ld bug. &etext is set 32 bytes too high. */ + /* persistent ld bug. etext is set 32 bytes too high. */ /* We instead read the text segment size from the a.out */ /* header, which happens to be mapped into our address space */ /* at the start of the text segment. The detective work here */ @@ -794,8 +801,8 @@ # ifdef DRSNX # define OS_TYPE "DRSNX" extern char * GC_SysVGetDataStart(); - extern int etext; -# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext) + extern int etext[]; +# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, etext) # define MPROTECT_VDB # define STACKBOTTOM ((ptr_t) 0xdfff0000) # define DYNAMIC_LOADING @@ -807,23 +814,24 @@ # else Linux Sparc/a.out not supported # endif - extern int _end; - extern int _etext; -# define DATAEND (&_end) + extern int _end[]; + extern int _etext[]; +# define DATAEND (_end) # define SVR4 # ifdef __arch64__ -# define STACKBOTTOM ((ptr_t) 0x80000000000ULL) -# define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, &_etext) +# define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, _etext) + /* libc_stack_end is not set reliably for sparc64 */ +# define STACKBOTTOM ((ptr_t) 0x80000000000) # else -# define STACKBOTTOM ((ptr_t) 0xf0000000) -# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext) +# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext) +# define LINUX_STACKBOTTOM # endif # endif # ifdef OPENBSD # define OS_TYPE "OPENBSD" # define STACKBOTTOM ((ptr_t) 0xf8000000) - extern int etext; -# define DATASTART ((ptr_t)(&etext)) + extern int etext[]; +# define DATASTART ((ptr_t)(etext)) # endif # ifdef NETBSD # define OS_TYPE "NETBSD" @@ -832,8 +840,8 @@ # define DATASTART GC_data_start # define DYNAMIC_LOADING # else - extern char etext; -# define DATASTART ((ptr_t)(&etext)) + extern char etext[]; +# define DATASTART ((ptr_t)(etext)) # endif # endif # endif @@ -853,24 +861,24 @@ # endif # ifdef SEQUENT # define OS_TYPE "SEQUENT" - extern int etext; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff)) + extern int etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) # define STACKBOTTOM ((ptr_t) 0x3ffff000) # endif # ifdef BEOS # define OS_TYPE "BEOS" # include <OS.h> # define GETPAGESIZE() B_PAGE_SIZE - extern int etext; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff)) + extern int etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) # endif # ifdef SUNOS5 # define OS_TYPE "SUNOS5" - extern int _etext, _end; + extern int _etext[], _end[]; extern char * GC_SysVGetDataStart(); -# define DATASTART GC_SysVGetDataStart(0x1000, &_etext) -# define DATAEND (&_end) -/* # define STACKBOTTOM ((ptr_t)(&_start)) worked through 2.7, */ +# define DATASTART GC_SysVGetDataStart(0x1000, _etext) +# define DATAEND (_end) +/* # define STACKBOTTOM ((ptr_t)(_start)) worked through 2.7, */ /* but reportedly breaks under 2.8. It appears that the stack */ /* base is a property of the executable, so this should not break */ /* old executables. */ @@ -898,16 +906,16 @@ # endif # ifdef SCO # define OS_TYPE "SCO" - extern int etext; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \ + extern int etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0x3fffff) \ & ~0x3fffff) \ - +((word)&etext & 0xfff)) + +((word)etext & 0xfff)) # define STACKBOTTOM ((ptr_t) 0x7ffffffc) # endif # ifdef SCO_ELF # define OS_TYPE "SCO_ELF" - extern int etext; -# define DATASTART ((ptr_t)(&etext)) + extern int etext[]; +# define DATASTART ((ptr_t)(etext)) # define STACKBOTTOM ((ptr_t) 0x08048000) # define DYNAMIC_LOADING # define ELF_CLASS ELFCLASS32 @@ -938,8 +946,8 @@ # ifdef __ELF__ # define DYNAMIC_LOADING # ifdef UNDEFINED /* includes ro data */ - extern int _etext; -# define DATASTART ((ptr_t)((((word) (&_etext)) + 0xfff) & ~0xfff)) + extern int _etext[]; +# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff)) # endif # include <features.h> # if defined(__GLIBC__) && __GLIBC__ >= 2 @@ -956,11 +964,11 @@ /* contain large read-only data tables */ /* that we'd rather not scan. */ # endif - extern int _end; -# define DATAEND (&_end) + extern int _end[]; +# define DATAEND (_end) # else - extern int etext; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff)) + extern int etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) # endif # ifdef USE_I686_PREFETCH # define PREFETCH(x) \ @@ -985,10 +993,10 @@ # endif # ifdef CYGWIN32 # define OS_TYPE "CYGWIN32" - extern int _data_start__; - extern int _data_end__; - extern int _bss_start__; - extern int _bss_end__; + extern int _data_start__[]; + extern int _data_end__[]; + extern int _bss_start__[]; + extern int _bss_end__[]; /* For binutils 2.9.1, we have */ /* DATASTART = _data_start__ */ /* DATAEND = _bss_end__ */ @@ -999,8 +1007,8 @@ /* minumum/maximum of the two. */ # define MAX(x,y) ((x) > (y) ? (x) : (y)) # define MIN(x,y) ((x) < (y) ? (x) : (y)) -# define DATASTART ((ptr_t) MIN(&_data_start__, &_bss_start__)) -# define DATAEND ((ptr_t) MAX(&_data_end__, &_bss_end__)) +# define DATASTART ((ptr_t) MIN(_data_start__, _bss_start__)) +# define DATAEND ((ptr_t) MAX(_data_end__, _bss_end__)) # undef STACK_GRAN # define STACK_GRAN 0x10000 # define HEURISTIC1 @@ -1029,10 +1037,10 @@ # ifdef DJGPP # define OS_TYPE "DJGPP" # include "stubinfo.h" - extern int etext; + extern int etext[]; extern int _stklen; extern int __djgpp_stack_limit; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ff) & ~0x1ff)) +# define DATASTART ((ptr_t)((((word) (etext)) + 0x1ff) & ~0x1ff)) /* # define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \ + _stklen)) */ # define STACKBOTTOM ((ptr_t)((word) __djgpp_stack_limit + _stklen)) @@ -1052,11 +1060,22 @@ # ifdef __ELF__ # define DYNAMIC_LOADING # endif - extern char etext; -# define DATASTART ((ptr_t)(&etext)) +/* Handle unmapped hole i386*-*-freebsd[45]* may put between etext and edata. */ + extern char etext[]; + extern char edata[]; + extern char end[]; +# define NEED_FIND_LIMIT +# define DATASTART ((ptr_t)(etext)) +# define MIN(x,y) ((x) < (y) ? (x) : (y)) +# define DATAEND (MIN (GC_find_limit (DATASTART, TRUE), DATASTART2)) +# define DATASTART2 ((ptr_t)(edata)) +# define DATAEND2 ((ptr_t)(end)) # endif # ifdef NETBSD # define OS_TYPE "NETBSD" +# ifdef __ELF__ +# define DYNAMIC_LOADING +# endif # endif # ifdef THREE86BSD # define OS_TYPE "THREE86BSD" @@ -1067,8 +1086,8 @@ # if defined(OPENBSD) || defined(NETBSD) \ || defined(THREE86BSD) || defined(BSDI) # define HEURISTIC2 - extern char etext; -# define DATASTART ((ptr_t)(&etext)) + extern char etext[]; +# define DATASTART ((ptr_t)(etext)) # endif # ifdef NEXT # define OS_TYPE "NEXT" @@ -1095,10 +1114,10 @@ # define OS_TYPE "HURD" # define STACK_GROWS_DOWN # define HEURISTIC2 - extern int __data_start; -# define DATASTART ( (ptr_t) (&__data_start)) - extern int _end; -# define DATAEND ( (ptr_t) (&_end)) + extern int __data_start[]; +# define DATASTART ( (ptr_t) (__data_start)) + extern int _end[]; +# define DATAEND ( (ptr_t) (_end)) /* # define MPROTECT_VDB Not quite working yet? */ # define DYNAMIC_LOADING # endif @@ -1122,8 +1141,8 @@ /* This was developed for a linuxce style platform. Probably */ /* needs to be tweaked for workstation class machines. */ # define OS_TYPE "LINUX" - extern int __data_start; -# define DATASTART ((ptr_t)(&__data_start)) + extern int __data_start[]; +# define DATASTART ((ptr_t)(__data_start)) # define ALIGNMENT 4 # define USE_GENERIC_PUSH_REGS # define STACKBOTTOM ((ptr_t)0x7fff8000) @@ -1141,15 +1160,15 @@ # define CPP_WORDSZ _MIPS_SZPTR # define ALIGNMENT (_MIPS_SZPTR/8) # else - extern int etext, edata, end; - extern int _DYNAMIC_LINKING, _gp; -# define DATASTART ((ptr_t)((((word)&etext + 0x3ffff) & ~0x3ffff) \ - + ((word)&etext & 0xffff))) -# define DATAEND (&edata) -# define DATASTART2 (&_DYNAMIC_LINKING \ - ? (ptr_t)(((word)&_gp + 0x8000 + 0x3ffff) & ~0x3ffff) \ - : (ptr_t)&edata) -# define DATAEND2 (&end) + extern int etext[], edata[], end[]; + extern int _DYNAMIC_LINKING[], _gp[]; +# define DATASTART ((ptr_t)((((word)etext + 0x3ffff) & ~0x3ffff) \ + + ((word)etext & 0xffff))) +# define DATAEND (edata) +# define DATASTART2 (_DYNAMIC_LINKING \ + ? (ptr_t)(((word)_gp + 0x8000 + 0x3ffff) & ~0x3ffff) \ + : (ptr_t)edata) +# define DATAEND2 (end) # define ALIGNMENT 4 # endif # define OS_TYPE "EWS4800" @@ -1171,8 +1190,8 @@ # endif # ifdef IRIX5 # define HEURISTIC2 - extern int _fdata; -# define DATASTART ((ptr_t)(&_fdata)) + extern int _fdata[]; +# define DATASTART ((ptr_t)(_fdata)) # ifdef USE_MMAP # define HEAP_START (ptr_t)0x30000000 # else @@ -1210,7 +1229,7 @@ # define HEURISTIC2 # define USE_GENERIC_PUSH_REGS # ifdef __ELF__ - extern int etext; + extern int etext[]; # define DATASTART GC_data_start # define NEED_FIND_LIMIT # define DYNAMIC_LOADING @@ -1230,9 +1249,9 @@ # define ALIGNMENT 4 # define CPP_WORDSZ 32 # endif - extern int _data, _end; -# define DATASTART ((ptr_t)((ulong)&_data)) -# define DATAEND ((ptr_t)((ulong)&_end)) + extern int _data[], _end[]; +# define DATASTART ((ptr_t)((ulong)_data)) +# define DATAEND ((ptr_t)((ulong)_end)) extern int errno; # define STACKBOTTOM ((ptr_t)((ulong)&errno)) # define USE_GENERIC_PUSH_REGS @@ -1266,8 +1285,8 @@ # define STACK_GROWS_UP # ifdef HPUX # define OS_TYPE "HPUX" - extern int __data_start; -# define DATASTART ((ptr_t)(&__data_start)) + extern int __data_start[]; +# define DATASTART ((ptr_t)(__data_start)) # if 0 /* The following appears to work for 7xx systems running HP/UX */ /* 9.xx Furthermore, it might result in much faster */ @@ -1299,8 +1318,8 @@ # define LINUX_STACKBOTTOM # define DYNAMIC_LOADING # define LINUX_DATA_START - extern int _end; -# define DATAEND (&_end) + extern int _end[]; +# define DATAEND (_end) # endif /* LINUX */ # endif /* HP_PA */ @@ -1330,11 +1349,31 @@ # define DATASTART ((ptr_t) 0x140000000) # endif # endif +# ifdef FREEBSD +# define OS_TYPE "FREEBSD" +/* MPROTECT_VDB is not yet supported at all on FreeBSD/alpha. */ +# define SIG_SUSPEND SIGUSR1 +# define SIG_THR_RESTART SIGUSR2 +# define FREEBSD_STACKBOTTOM +# ifdef __ELF__ +# define DYNAMIC_LOADING +# endif +/* Handle unmapped hole alpha*-*-freebsd[45]* puts between etext and edata. */ + extern char etext[]; + extern char edata[]; + extern char end[]; +# define NEED_FIND_LIMIT +# define DATASTART ((ptr_t)(etext)) +# define DATAEND (GC_find_limit (DATASTART, TRUE)) +# define DATASTART2 ((ptr_t)(edata)) +# define DATAEND2 ((ptr_t)(end)) +# define CPP_WORDSZ 64 +# endif # ifdef OSF1 # define OS_TYPE "OSF1" # define DATASTART ((ptr_t) 0x140000000) - extern int _end; -# define DATAEND ((ptr_t) &_end) + extern int _end[]; +# define DATAEND ((ptr_t) _end) extern char ** environ; /* round up from the value of environ to the nearest page boundary */ /* Probably breaks if putenv is called before collector */ @@ -1345,8 +1384,8 @@ /* the text segment immediately follows the stack. */ /* Hence we give an upper pound. */ /* This is currently unused, since we disabled HEURISTIC2 */ - extern int __start; -# define HEURISTIC2_LIMIT ((ptr_t)((word)(&__start) & ~(getpagesize()-1))) + extern int __start[]; +# define HEURISTIC2_LIMIT ((ptr_t)((word)(__start) & ~(getpagesize()-1))) # define CPP_WORDSZ 64 # define MPROTECT_VDB # define DYNAMIC_LOADING @@ -1362,8 +1401,8 @@ # else # define DATASTART ((ptr_t) 0x140000000) # endif - extern int _end; -# define DATAEND (&_end) + extern int _end[]; +# define DATAEND (_end) # define MPROTECT_VDB /* Has only been superficially tested. May not */ /* work on all versions. */ @@ -1396,8 +1435,8 @@ # define ALIGNMENT 8 # endif # define OS_TYPE "HPUX" - extern int __data_start; -# define DATASTART ((ptr_t)(&__data_start)) + extern int __data_start[]; +# define DATASTART ((ptr_t)(__data_start)) /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */ /* to this. Note that the GC must be initialized before the */ /* first putenv call. */ @@ -1445,8 +1484,8 @@ # endif # define MPROTECT_VDB /* Requires Linux 2.3.47 or later. */ - extern int _end; -# define DATAEND (&_end) + extern int _end[]; +# define DATAEND (_end) # ifdef __GNUC__ # define PREFETCH(x) \ __asm__ (" lfetch [%0]": : "r"((void *)(x))) @@ -1462,15 +1501,15 @@ # define MACH_TYPE "M88K" # define ALIGNMENT 4 # define ALIGN_DOUBLE - extern int etext; + extern int etext[]; # ifdef CX_UX # define OS_TYPE "CX_UX" -# define DATASTART ((((word)&etext + 0x3fffff) & ~0x3fffff) + 0x10000) +# define DATASTART ((((word)etext + 0x3fffff) & ~0x3fffff) + 0x10000) # endif # ifdef DGUX # define OS_TYPE "DGUX" extern char * GC_SysVGetDataStart(); -# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext) +# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, etext) # endif # define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */ # endif @@ -1481,27 +1520,27 @@ # define USE_GENERIC_PUSH_REGS # ifdef UTS4 # define OS_TYPE "UTS4" - extern int etext; - extern int _etext; - extern int _end; + extern int etext[]; + extern int _etext[]; + extern int _end[]; extern char * GC_SysVGetDataStart(); -# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext) -# define DATAEND (&_end) +# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext) +# define DATAEND (_end) # define HEURISTIC2 # endif # ifdef LINUX # define OS_TYPE "LINUX" # define HEURISTIC1 # define DYNAMIC_LOADING - extern int __data_start; -# define DATASTART ((ptr_t)(&__data_start)) + extern int __data_start[]; +# define DATASTART ((ptr_t)(__data_start)) # endif # endif # if defined(PJ) # define ALIGNMENT 4 - extern int _etext; -# define DATASTART ((ptr_t)(&_etext)) + extern int _etext[]; +# define DATASTART ((ptr_t)(_etext)) # define HEURISTIC1 # endif @@ -1512,8 +1551,8 @@ # ifdef NETBSD # define OS_TYPE "NETBSD" # define HEURISTIC2 - extern char etext; -# define DATASTART ((ptr_t)(&etext)) + extern char etext[]; +# define DATASTART ((ptr_t)(etext)) # define USE_GENERIC_PUSH_REGS # endif # ifdef LINUX @@ -1539,11 +1578,11 @@ /* contain large read-only data tables */ /* that we'd rather not scan. */ # endif - extern int _end; -# define DATAEND (&_end) + extern int _end[]; +# define DATAEND (_end) # else - extern int etext; -# define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff)) + extern int etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) # endif # endif # ifdef MSWINCE @@ -1552,8 +1591,8 @@ # endif # ifdef NOSYS /* __data_start is usually defined in the target linker script. */ - extern int __data_start; -# define DATASTART (ptr_t)(&__data_start) + extern int __data_start[]; +# define DATASTART (ptr_t)(__data_start) # define USE_GENERIC_PUSH_REGS /* __stack_base__ is set in newlib/libc/sys/arm/crt0.S */ extern void *__stack_base__; @@ -1574,8 +1613,8 @@ # define USE_GENERIC_PUSH_REGS # define DYNAMIC_LOADING # define LINUX_DATA_START - extern int _end; -# define DATAEND (&_end) + extern int _end[]; +# define DATAEND (_end) # endif # endif @@ -1593,10 +1632,10 @@ /* case we lose. Nonetheless, we try both, prefering __data_start. */ /* We assume gcc. */ # pragma weak __data_start - extern int __data_start; + extern int __data_start[]; # pragma weak data_start - extern int data_start; -# define DATASTART ((ptr_t)(&__data_start != 0? &__data_start : &data_start)) + extern int data_start[]; +# define DATASTART ((ptr_t)(__data_start != 0? __data_start : data_start)) #endif #if defined(LINUX) && defined(REDIRECT_MALLOC) @@ -1620,8 +1659,8 @@ # endif # ifndef DATAEND - extern int end; -# define DATAEND (&end) + extern int end[]; +# define DATAEND (end) # endif # if defined(SVR4) && !defined(GETPAGESIZE) diff --git a/boehm-gc/include/private/specific.h b/boehm-gc/include/private/specific.h index 60c152c6fd0..399f84f58d6 100644 --- a/boehm-gc/include/private/specific.h +++ b/boehm-gc/include/private/specific.h @@ -27,16 +27,22 @@ #define TS_HASH_SIZE 1024 #define HASH(n) (((((long)n) >> 8) ^ (long)n) & (TS_HASH_SIZE - 1)) +/* An entry describing a thread-specific value for a given thread. */ +/* All such accessible structures preserve the invariant that if either */ +/* thread is a valid pthread id or qtid is a valid "quick tread id" */ +/* for a thread, then value holds the corresponding thread specific */ +/* value. This invariant must be preserved at ALL times, since */ +/* asynchronous reads are allowed. */ typedef struct thread_specific_entry { unsigned long qtid; /* quick thread id, only for cache */ void * value; - pthread_t thread; struct thread_specific_entry *next; + pthread_t thread; } tse; /* We represent each thread-specific datum as two tables. The first is */ -/* a cache, index by a "quick thread identifier". The "quick" thread */ +/* a cache, indexed by a "quick thread identifier". The "quick" thread */ /* identifier is an easy to compute value, which is guaranteed to */ /* determine the thread, though a thread may correspond to more than */ /* one value. We typically use the address of a page in the stack. */ @@ -45,12 +51,15 @@ typedef struct thread_specific_entry { /* Return the "quick thread id". Default version. Assumes page size, */ /* or at least thread stack separation, is at least 4K. */ -static __inline__ long quick_thread_id() { +/* Must be defined so that it never returns 0. (Page 0 can't really */ +/* be part of any stack, since that would make 0 a valid stack pointer.)*/ +static __inline__ unsigned long quick_thread_id() { int dummy; - return (long)(&dummy) >> 12; + return (unsigned long)(&dummy) >> 12; } -#define INVALID_QTID ((unsigned long)(-1)) +#define INVALID_QTID ((unsigned long)0) +#define INVALID_THREADID ((pthread_t)0) typedef struct thread_specific_data { tse * volatile cache[TS_CACHE_SIZE]; @@ -76,7 +85,10 @@ static __inline__ void * PREFIXED(getspecific) (tsd * key) { unsigned hash_val = CACHE_HASH(qtid); tse * volatile * entry_ptr = key -> cache + hash_val; tse * entry = *entry_ptr; /* Must be loaded only once. */ - if (entry -> qtid == qtid) return entry -> value; + if (entry -> qtid == qtid) { + GC_ASSERT(entry -> thread == pthread_self()); + return entry -> value; + } return PREFIXED(slow_getspecific) (key, qtid, entry_ptr); } diff --git a/boehm-gc/linux_threads.c b/boehm-gc/linux_threads.c index b26988cef9e..bd39ec79e29 100644 --- a/boehm-gc/linux_threads.c +++ b/boehm-gc/linux_threads.c @@ -231,15 +231,16 @@ static void return_freelists(ptr_t *fl, ptr_t *gfl) nwords = i * (GRANULARITY/sizeof(word)); qptr = fl + i; q = *qptr; - if ((word)q < HBLKSIZE) continue; - if (gfl[nwords] == 0) { + if ((word)q >= HBLKSIZE) { + if (gfl[nwords] == 0) { gfl[nwords] = q; - } else { + } else { /* Concatenate: */ for (; (word)q >= HBLKSIZE; qptr = &(obj_link(q)), q = *qptr); GC_ASSERT(0 == q); *qptr = gfl[nwords]; gfl[nwords] = fl[i]; + } } /* Clear fl[i], since the thread structure may hang around. */ /* Do it in a way that is likely to trap if we access it. */ @@ -412,6 +413,7 @@ GC_PTR GC_local_gcj_malloc(size_t bytes, /* A memory barrier is probably never needed, since the */ /* action of stopping this thread will cause prior writes */ /* to complete. */ + GC_ASSERT(((void * volatile *)result)[1] == 0); *(void * volatile *)result = ptr_to_struct_containing_descr; return result; } else if ((word)my_entry - 1 < DIRECT_GRANULES) { @@ -544,7 +546,7 @@ static void start_mark_threads() ABORT("pthread_attr_getstacksize failed\n"); if (old_size < MIN_STACK_SIZE) { if (pthread_attr_setstacksize(&attr, MIN_STACK_SIZE) != 0) - ABORT("pthread_attr_getstacksize failed\n"); + ABORT("pthread_attr_setstacksize failed\n"); } } # endif /* HPUX */ @@ -1015,6 +1017,7 @@ int GC_get_nprocs() WARN("Couldn't read /proc/stat\n", 0); return -1; } + close(f); for (i = 0; i < len - 100; ++i) { if (stat_buf[i] == '\n' && stat_buf[i+1] == 'c' && stat_buf[i+2] == 'p' && stat_buf[i+3] == 'u') { diff --git a/boehm-gc/mark.c b/boehm-gc/mark.c index 70ba135f1ab..eb5b9eeb34d 100644 --- a/boehm-gc/mark.c +++ b/boehm-gc/mark.c @@ -264,7 +264,7 @@ static void alloc_mark_stack(); GC_bool GC_mark_some(cold_gc_frame) ptr_t cold_gc_frame; { -#ifdef MSWIN32 +#if defined(MSWIN32) && !defined(__GNUC__) /* Windows 98 appears to asynchronously create and remove writable */ /* memory mappings, for reasons we haven't yet understood. Since */ /* we look for writable regions to determine the root set, we may */ @@ -274,7 +274,7 @@ ptr_t cold_gc_frame; /* Note that this code should never generate an incremental GC write */ /* fault. */ __try { -#endif +#endif /* defined(MSWIN32) && !defined(__GNUC__) */ switch(GC_mark_state) { case MS_NONE: return(FALSE); @@ -395,7 +395,7 @@ ptr_t cold_gc_frame; ABORT("GC_mark_some: bad state"); return(FALSE); } -#ifdef MSWIN32 +#if defined(MSWIN32) && !defined(__GNUC__) } __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { # ifdef CONDPRINT @@ -410,7 +410,7 @@ ptr_t cold_gc_frame; scan_ptr = 0; return FALSE; } -#endif /* MSWIN32 */ +#endif /* defined(MSWIN32) && !defined(__GNUC__) */ } @@ -546,13 +546,13 @@ mse * mark_stack_limit; /* Large length. */ /* Process part of the range to avoid pushing too much on the */ /* stack. */ + GC_ASSERT(descr < GC_greatest_plausible_heap_addr + - GC_least_plausible_heap_addr); # ifdef PARALLEL_MARK # define SHARE_BYTES 2048 if (descr > SHARE_BYTES && GC_parallel && mark_stack_top < mark_stack_limit - 1) { int new_size = (descr/2) & ~(sizeof(word)-1); - GC_ASSERT(descr < GC_greatest_plausible_heap_addr - - GC_least_plausible_heap_addr); mark_stack_top -> mse_start = current_p; mark_stack_top -> mse_descr = new_size + sizeof(word); /* makes sure we handle */ diff --git a/boehm-gc/misc.c b/boehm-gc/misc.c index 079a037a4ae..f6079732fbf 100644 --- a/boehm-gc/misc.c +++ b/boehm-gc/misc.c @@ -16,6 +16,7 @@ #include <stdio.h> +#include <limits.h> #ifndef _WIN32_WCE #include <signal.h> #endif @@ -112,6 +113,12 @@ GC_bool GC_print_back_height = 0; int GC_all_interior_pointers = 0; #endif +long GC_large_alloc_warn_interval = 5; + /* Interval between unsuppressed warnings. */ + +long GC_large_alloc_warn_suppressed = 0; + /* Number of warnings suppressed so far. */ + /*ARGSUSED*/ GC_PTR GC_default_oom_fn GC_PROTO((size_t bytes_requested)) { @@ -483,9 +490,9 @@ int sig; #endif #ifdef MSWIN32 - extern GC_bool GC_is_win32s(); +extern GC_bool GC_no_win32_dlls; #else -# define GC_is_win32s() FALSE +# define GC_no_win32_dlls FALSE #endif void GC_init_inner() @@ -499,6 +506,10 @@ void GC_init_inner() # ifdef PRINTSTATS GC_print_stats = 1; # endif +# if defined(MSWIN32) || defined(MSWINCE) + InitializeCriticalSection(&GC_write_cs); +# endif + if (0 != GETENV("GC_PRINT_STATS")) { GC_print_stats = 1; } @@ -514,11 +525,13 @@ void GC_init_inner() if (0 != GETENV("GC_PRINT_BACK_HEIGHT")) { GC_print_back_height = 1; } + if (0 != GETENV("GC_NO_BLACKLIST_WARNING")) { + GC_large_alloc_warn_interval = LONG_MAX; + } { char * time_limit_string = GETENV("GC_PAUSE_TIME_TARGET"); if (0 != time_limit_string) { - long time_limit; - if (time_limit_string != 0) time_limit = atol(time_limit_string); + long time_limit = atol(time_limit_string); if (time_limit < 5) { WARN("GC_PAUSE_TIME_TARGET environment variable value too small " "or bad syntax: Ignoring\n", 0); @@ -527,6 +540,18 @@ void GC_init_inner() } } } + { + char * interval_string = GETENV("GC_LARGE_ALLOC_WARN_INTERVAL"); + if (0 != interval_string) { + long interval = atol(interval_string); + if (interval <= 0) { + WARN("GC_LARGE_ALLOC_WARN_INTERVAL environment variable has " + "bad value: Ignoring\n", 0); + } else { + GC_large_alloc_warn_interval = interval; + } + } + } # ifdef UNIX_LIKE if (0 != GETENV("GC_LOOP_ON_ABORT")) { GC_set_and_save_fault_handler(looping_handler); @@ -536,9 +561,6 @@ void GC_init_inner() if (ALIGNMENT > GC_DS_TAGS && EXTRA_BYTES != 0) { GC_obj_kinds[NORMAL].ok_descriptor = ((word)(-ALIGNMENT) | GC_DS_LENGTH); } -# if defined(MSWIN32) || defined(MSWINCE) - InitializeCriticalSection(&GC_write_cs); -# endif GC_setpagesize(); GC_exclude_static_roots(beginGC_arrays, endGC_arrays); GC_exclude_static_roots(beginGC_obj_kinds, endGC_obj_kinds); @@ -637,7 +659,7 @@ void GC_init_inner() GC_pcr_install(); # endif # if !defined(SMALL_CONFIG) - if (!GC_is_win32s() && 0 != GETENV("GC_ENABLE_INCREMENTAL")) { + if (!GC_no_win32_dlls && 0 != GETENV("GC_ENABLE_INCREMENTAL")) { GC_ASSERT(!GC_incremental); GC_setpagesize(); # ifndef GC_SOLARIS_THREADS @@ -681,7 +703,7 @@ void GC_enable_incremental GC_PROTO(()) LOCK(); if (GC_incremental) goto out; GC_setpagesize(); - if (GC_is_win32s()) goto out; + if (GC_no_win32_dlls) goto out; # ifndef GC_SOLARIS_THREADS GC_dirty_init(); # endif diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index ae1125664e3..258c9433f30 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -84,7 +84,7 @@ # include <setjmp.h> #endif -#ifdef FREEBSD +#if defined(FREEBSD) && defined(I386) # include <machine/trap.h> #endif @@ -155,11 +155,11 @@ # ifdef LINUX # pragma weak __data_start - extern int __data_start; + extern int __data_start[]; # pragma weak data_start - extern int data_start; + extern int data_start[]; # endif /* LINUX */ - extern int _end; + extern int _end[]; ptr_t GC_data_start; @@ -169,16 +169,16 @@ # ifdef LINUX /* Try the easy approaches first: */ - if (&__data_start != 0) { - GC_data_start = (ptr_t)(&__data_start); + if (__data_start != 0) { + GC_data_start = (ptr_t)__data_start; return; } - if (&data_start != 0) { - GC_data_start = (ptr_t)(&data_start); + if (data_start != 0) { + GC_data_start = (ptr_t)data_start; return; } # endif /* LINUX */ - GC_data_start = GC_find_limit((ptr_t)(&_end), FALSE); + GC_data_start = GC_find_limit((ptr_t)_end, FALSE); } #endif @@ -747,14 +747,14 @@ ptr_t GC_get_stack_base() ptr_t GC_freebsd_stack_base(void) { - int nm[2] = { CTL_KERN, KERN_USRSTACK}, base, len, r; - - len = sizeof(int); - r = sysctl(nm, 2, &base, &len, NULL, 0); + int nm[2] = {CTL_KERN, KERN_USRSTACK}; + ptr_t base; + size_t len = sizeof(ptr_t); + int r = sysctl(nm, 2, &base, &len, NULL, 0); if (r) ABORT("Error getting stack base"); - return (ptr_t)base; + return base; } #endif /* FREEBSD_STACKBOTTOM */ @@ -928,19 +928,17 @@ void GC_register_data_segments() /* all real work is done by GC_register_dynamic_libraries. Under */ /* win32s, we cannot find the data segments associated with dll's. */ /* We rgister the main data segment here. */ - GC_bool GC_win32s = FALSE; /* We're running under win32s. */ - - GC_bool GC_is_win32s() - { - DWORD v = GetVersion(); - - /* Check that this is not NT, and Windows major version <= 3 */ - return ((v & 0x80000000) && (v & 0xff) <= 3); - } +# ifdef __GCC__ + GC_bool GC_no_win32_dlls = TRUE; /* GCC can't do SEH, so we can't use VirtualQuery */ +# else + GC_bool GC_no_win32_dlls = FALSE; +# endif void GC_init_win32() { - GC_win32s = GC_is_win32s(); + /* if we're running under win32s, assume that no DLLs will be loaded */ + DWORD v = GetVersion(); + GC_no_win32_dlls |= ((v & 0x80000000) && (v & 0xff) <= 3); } /* Return the smallest address a such that VirtualQuery */ @@ -1008,7 +1006,7 @@ void GC_register_data_segments() char * base; char * limit, * new_limit; - if (!GC_win32s) return; + if (!GC_no_win32_dlls) return; p = base = limit = GC_least_described_address(static_root); while (p < GC_sysinfo.lpMaximumApplicationAddress) { result = VirtualQuery(p, &buf, sizeof(buf)); @@ -1307,7 +1305,7 @@ SYSTEM_INFO GC_sysinfo; # ifdef USE_GLOBAL_ALLOC # define GLOBAL_ALLOC_TEST 1 # else -# define GLOBAL_ALLOC_TEST GC_win32s +# define GLOBAL_ALLOC_TEST GC_no_win32_dlls # endif word GC_n_heap_bases = 0; @@ -1338,7 +1336,7 @@ word bytes; void GC_win32_free_heap () { - if (GC_win32s) { + if (GC_no_win32_dlls) { while (GC_n_heap_bases > 0) { GlobalFree (GC_heap_bases[--GC_n_heap_bases]); GC_heap_bases[GC_n_heap_bases] = 0; diff --git a/boehm-gc/reclaim.c b/boehm-gc/reclaim.c index 846215edb4f..0418e9dea65 100644 --- a/boehm-gc/reclaim.c +++ b/boehm-gc/reclaim.c @@ -862,6 +862,25 @@ void GC_print_block_list() #endif /* NO_DEBUGGING */ /* + * Clear all obj_link pointers in the list of free objects *flp. + * Clear *flp. + * This must be done before dropping a list of free gcj-style objects, + * since may otherwise end up with dangling "descriptor" pointers. + * It may help for other pointer-containg objects. + */ +void GC_clear_fl_links(flp) +ptr_t *flp; +{ + ptr_t next = *flp; + + while (0 != next) { + *flp = 0; + flp = &(obj_link(next)); + next = *flp; + } +} + +/* * Perform GC_reclaim_block on the entire heap, after first clearing * small object free lists (if we are not just looking for leaks). */ @@ -875,17 +894,24 @@ int report_if_found; /* Abort if a GC_reclaimable object is found */ # endif /* Clear reclaim- and free-lists */ for (kind = 0; kind < GC_n_kinds; kind++) { - register ptr_t *fop; - register ptr_t *lim; - register struct hblk ** rlp; - register struct hblk ** rlim; - register struct hblk ** rlist = GC_obj_kinds[kind].ok_reclaim_list; + ptr_t *fop; + ptr_t *lim; + struct hblk ** rlp; + struct hblk ** rlim; + struct hblk ** rlist = GC_obj_kinds[kind].ok_reclaim_list; + GC_bool should_clobber = (GC_obj_kinds[kind].ok_descriptor != 0); if (rlist == 0) continue; /* This kind not used. */ if (!report_if_found) { lim = &(GC_obj_kinds[kind].ok_freelist[MAXOBJSZ+1]); for( fop = GC_obj_kinds[kind].ok_freelist; fop < lim; fop++ ) { - *fop = 0; + if (*fop != 0) { + if (should_clobber) { + GC_clear_fl_links(fop); + } else { + *fop = 0; + } + } } } /* otherwise free list objects are marked, */ /* and its safe to leave them */ diff --git a/boehm-gc/specific.c b/boehm-gc/specific.c index 48b53ac9f8c..2c40c2b44a2 100644 --- a/boehm-gc/specific.c +++ b/boehm-gc/specific.c @@ -16,17 +16,27 @@ #include "private/gc_priv.h" /* For GC_compare_and_exchange, GC_memory_barrier */ #include "private/specific.h" -static tse invalid_tse; /* 0 qtid is guaranteed to be invalid */ +static tse invalid_tse = {INVALID_QTID, 0, 0, INVALID_THREADID}; + /* A thread-specific data entry which will never */ + /* appear valid to a reader. Used to fill in empty */ + /* cache entries to avoid a check for 0. */ int PREFIXED(key_create) (tsd ** key_ptr, void (* destructor)(void *)) { int i; tsd * result = (tsd *)MALLOC_CLEAR(sizeof (tsd)); + /* A quick alignment check, since we need atomic stores */ + GC_ASSERT((unsigned long)(&invalid_tse.next) % sizeof(tse *) == 0); if (0 == result) return ENOMEM; pthread_mutex_init(&(result -> lock), NULL); for (i = 0; i < TS_CACHE_SIZE; ++i) { result -> cache[i] = &invalid_tse; } +# ifdef GC_ASSERTIONS + for (i = 0; i < TS_HASH_SIZE; ++i) { + GC_ASSERT(result -> hash[i] == 0); + } +# endif *key_ptr = result; return 0; } @@ -36,12 +46,14 @@ int PREFIXED(setspecific) (tsd * key, void * value) { int hash_val = HASH(self); volatile tse * entry = (volatile tse *)MALLOC_CLEAR(sizeof (tse)); + GC_ASSERT(self != INVALID_THREADID); if (0 == entry) return ENOMEM; pthread_mutex_lock(&(key -> lock)); /* Could easily check for an existing entry here. */ entry -> next = key -> hash[hash_val]; entry -> thread = self; entry -> value = value; + GC_ASSERT(entry -> qtid == INVALID_QTID); /* There can only be one writer at a time, but this needs to be */ /* atomic with respect to concurrent readers. */ *(volatile tse **)(key -> hash + hash_val) = entry; @@ -70,6 +82,10 @@ void PREFIXED(remove_specific) (tsd * key) { *link = entry -> next; /* Atomic! concurrent accesses still work. */ /* They must, since readers don't lock. */ + /* We shouldn't need a volatile access here, */ + /* since both this and the preceding write */ + /* should become visible no later than */ + /* the pthread_mutex_unlock() call. */ } /* If we wanted to deallocate the entry, we'd first have to clear */ /* any cache entries pointing to it. That probably requires */ @@ -91,6 +107,7 @@ void * PREFIXED(slow_getspecific) (tsd * key, unsigned long qtid, unsigned hash_val = HASH(self); tse *entry = key -> hash[hash_val]; + GC_ASSERT(qtid != INVALID_QTID); while (entry != NULL && entry -> thread != self) { entry = entry -> next; } @@ -99,6 +116,8 @@ void * PREFIXED(slow_getspecific) (tsd * key, unsigned long qtid, entry -> qtid = qtid; /* It's safe to do this asynchronously. Either value */ /* is safe, though may produce spurious misses. */ + /* We're replacing one qtid with another one for the */ + /* same thread. */ *cache_ptr = entry; /* Again this is safe since pointer assignments are */ /* presumed atomic, and either pointer is valid. */ diff --git a/boehm-gc/win32_threads.c b/boehm-gc/win32_threads.c index 980faf34d94..d5e3920cbe4 100644 --- a/boehm-gc/win32_threads.c +++ b/boehm-gc/win32_threads.c @@ -144,8 +144,15 @@ void GC_push_all_stacks() GC_push_one ((word) thread_table[i].context.Edx); GC_push_one ((word) thread_table[i].context.Ecx); GC_push_one ((word) thread_table[i].context.Eax); - GC_push_all_stack((char *) thread_table[i].context.Esp, - thread_table[i].stack); + if (thread_table[i].context.Esp >= (DWORD)thread_table[i].stack + || thread_table[i].context.Esp < (DWORD)bottom) { + WARN("Thread stack pointer 0x%lx out of range, pushing everything", + thread_table[i].context.Esp); + GC_push_all_stack((char *) bottom, thread_table[i].stack); + } else { + GC_push_all_stack((char *) thread_table[i].context.Esp, + thread_table[i].stack); + } # else # ifdef ARM32 if (thread_table[i].context.Sp >= (DWORD)thread_table[i].stack @@ -447,16 +454,22 @@ static DWORD WINAPI thread_start(LPVOID arg) /* Clear the thread entry even if we exit with an exception. */ /* This is probably pointless, since an uncaught exception is */ /* supposed to result in the process being killed. */ +#ifndef __GNUC__ __try { +#endif /* __GNUC__ */ ret = args.start (args.param); +#ifndef __GNUC__ } __finally { +#endif /* __GNUC__ */ LOCK(); args.entry->stack = 0; args.entry->in_use = FALSE; /* cast away volatile qualifier */ BZERO((void *) &args.entry->context, sizeof(CONTEXT)); UNLOCK(); +#ifndef __GNUC__ } +#endif /* __GNUC__ */ return ret; } |