#! /bin/sh
# From configure.in Revision: 1.2 .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for gc 6.7.
+# Generated by GNU Autoconf 2.59 for gc 6.8.
#
# Report bugs to <Hans.Boehm@hp.com>.
#
# Identity of this package.
PACKAGE_NAME='gc'
PACKAGE_TARNAME='gc'
-PACKAGE_VERSION='6.7'
-PACKAGE_STRING='gc 6.7'
+PACKAGE_VERSION='6.8'
+PACKAGE_STRING='gc 6.8'
PACKAGE_BUGREPORT='Hans.Boehm@hp.com'
ac_unique_file="gcj_mlc.c"
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gc 6.7 to adapt to many kinds of systems.
+\`configure' configures gc 6.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gc 6.7:";;
+ short | recursive ) echo "Configuration of gc 6.8:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-gc configure 6.7
+gc configure 6.8
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gc $as_me 6.7, which was
+It was created by gc $as_me 6.8, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='gc'
- VERSION='6.7'
+ VERSION='6.8'
cat >>confdefs.h <<_ACEOF
_ACEOF
;;
- *-*-hpux*)
- { echo "$as_me:$LINENO: WARNING: \"Only HP/UX 11 threads are supported.\"" >&5
-echo "$as_me: WARNING: \"Only HP/UX 11 threads are supported.\"" >&2;}
+ *-*-hpux11*)
+ { echo "$as_me:$LINENO: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5
+echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;}
cat >>confdefs.h <<\_ACEOF
#define GC_HPUX_THREADS 1
_ACEOF
_ACEOF
THREADDLLIBS="-lpthread -lrt"
+ # HPUX needs REENTRANT for the _r calls.
+
+cat >>confdefs.h <<\_ACEOF
+#define _REENTRANT 1
+_ACEOF
+
+ ;;
+ *-*-hpux10*)
+ { echo "$as_me:$LINENO: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5
+echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;}
;;
*-*-freebsd*)
{ echo "$as_me:$LINENO: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 6072 "configure"' > conftest.$ac_ext
+ echo '#line 6082 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
compiler_c_o=no
-if { (eval echo configure:6645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+if { (eval echo configure:6655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s out/conftest.err; then
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 8572 "configure"
+#line 8582 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 8670 "configure"
+#line 8680 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
} >&5
cat >&5 <<_CSEOF
-This file was extended by gc $as_me 6.7, which was
+This file was extended by gc $as_me 6.8, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-gc config.status 6.7
+gc config.status 6.8
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
# Initialization
# ==============
-AC_INIT(gc,6.7,Hans.Boehm@hp.com)
+AC_INIT(gc,6.8,Hans.Boehm@hp.com)
## version must conform to [0-9]+[.][0-9]+(alpha[0-9]+)?
AC_CONFIG_SRCDIR(gcj_mlc.c)
AC_CANONICAL_TARGET
AC_DEFINE(GC_AIX_THREADS)
AC_DEFINE(_REENTRANT)
;;
- *-*-hpux*)
- AC_MSG_WARN("Only HP/UX 11 threads are supported.")
+ *-*-hpux11*)
+ AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
AC_DEFINE(GC_HPUX_THREADS)
AC_DEFINE(_POSIX_C_SOURCE,199506L)
if test "${enable_parallel_mark}" = yes; then
fi
AC_DEFINE(THREAD_LOCAL_ALLOC)
THREADDLLIBS="-lpthread -lrt"
+ # HPUX needs REENTRANT for the _r calls.
+ AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
+ ;;
+ *-*-hpux10*)
+ AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
;;
*-*-freebsd*)
AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
INCLUDES="$INCLUDES -pthread"
THREADDLLIBS=-pthread
;;
+ *-*-kfreebsd*-gnu)
+ AC_DEFINE(GC_FREEBSD_THREADS)
+ INCLUDES="$INCLUDES -pthread"
+ THREADDLLIBS=-pthread
+ AC_DEFINE(_REENTRANT)
+ if test "${enable_parallel_mark}" = yes; then
+ AC_DEFINE(PARALLEL_MARK)
+ fi
+ AC_DEFINE(THREAD_LOCAL_ALLOC)
+ AC_DEFINE(USE_COMPILER_TLS)
+ ;;
*-*-netbsd*)
AC_MSG_WARN("Only on NetBSD 2.0 or later.")
AC_DEFINE(GC_NETBSD_THREADS)
void GC_push_all_stacks() {
int i;
+ task_t my_task;
kern_return_t r;
mach_port_t me;
ptr_t lo, hi;
me = mach_thread_self();
if (!GC_thr_initialized) GC_thr_init();
- r = task_threads(current_task(), &act_list, &listcount);
+ my_task = current_task();
+ r = task_threads(my_task, &act_list, &listcount);
if(r != KERN_SUCCESS) ABORT("task_threads failed");
for(i = 0; i < listcount; i++) {
thread_act_t thread = act_list[i];
);
# endif
GC_push_all_stack(lo, hi);
+ mach_port_deallocate(my_task, thread);
} /* for(p=GC_threads[i]...) */
- vm_deallocate(current_task(), (vm_address_t)act_list, sizeof(thread_t) * listcount);
+ vm_deallocate(my_task, (vm_address_t)act_list, sizeof(thread_t) * listcount);
+ mach_port_deallocate(my_task, me);
}
#endif /* !DARWIN_DONT_PARSE_STACK */
}
if (!found) GC_mach_threads_count++;
}
+ mach_port_deallocate(current_task(), my_thread);
return changed;
}
{
int i, changes;
GC_thread p;
+ task_t my_task = current_task();
mach_port_t my_thread = mach_thread_self();
kern_return_t kern_result;
thread_act_array_t act_list, prev_list;
prevcount = 0;
do {
int result;
- kern_result = task_threads(current_task(), &act_list, &listcount);
+ kern_result = task_threads(my_task, &act_list, &listcount);
result = GC_suspend_thread_list(act_list, listcount,
prev_list, prevcount);
changes = result;
prev_list = act_list;
prevcount = listcount;
- vm_deallocate(current_task(), (vm_address_t)act_list, sizeof(thread_t) * listcount);
+
+ if(kern_result == KERN_SUCCESS) {
+ int i;
+
+ for(i = 0; i < listcount; i++)
+ mach_port_deallocate(my_task, act_list[i]);
+
+ vm_deallocate(my_task, (vm_address_t)act_list, sizeof(thread_t) * listcount);
+ }
} while (changes);
#if DEBUG_THREADS
GC_printf1("World stopped from 0x%lx\n", my_thread);
#endif
+
+ mach_port_deallocate(my_task, my_thread);
}
/* Caller holds allocation lock, and has held it continuously since */
/* the world stopped. */
void GC_start_world()
{
+ task_t my_task = current_task();
mach_port_t my_thread = mach_thread_self();
int i, j;
GC_thread p;
}
# endif
- kern_result = task_threads(current_task(), &act_list, &listcount);
+ kern_result = task_threads(my_task, &act_list, &listcount);
for(i = 0; i < listcount; i++) {
thread_act_t thread = act_list[i];
if (thread != my_thread &&
}
}
}
+
+ mach_port_deallocate(my_task, thread);
}
- vm_deallocate(current_task(), (vm_address_t)act_list, sizeof(thread_t) * listcount);
+ vm_deallocate(my_task, (vm_address_t)act_list, sizeof(thread_t) * listcount);
+
+ mach_port_deallocate(my_task, my_thread);
# if DEBUG_THREADS
GC_printf0("World started\n");
# endif
collector. (If you are concerned about such things, I recommend you look
at the notice in config.guess or ltmain.sh.)
-This is version 6.7 of a conservative garbage collector for C and C++.
+This is version 6.8 of a conservative garbage collector for C and C++.
You might find a more recent version of this at
- Fix Makefile.am, so it handles exe extensions under Cygwin correctly
for gctest.
+Since 6.7:
+ - Added some support for Dragonfly BSD. (Thanks to Joerg Sonnenberger and
+ Thomas Klausner.)
+ - Improvements to the HP/UX section of configure.in.
+ (Thanks to Andreas Tobler.)
+ - GC_unix_get_mem could neglect to release the malloc lock on Irix, under
+ extremely unlikely circumstances. Thanks to Jean-Baptiste Nivois for
+ some careful code reading.
+ - Added support for kFreeBSD + glibc (Thanks to Petr Salinger)
+ - Fix more MacOS threads memory leaks (Thanks to Allan Hsu)
+ - Added initial Solaris/X86-64 support (Thanks to Rainer Orth)
+ - Applied a long-lost MINGW patch from Gerard Allan for malloc redirection
+ with threads. This one probably makes no sense for 7.0, and was not applied
+ there.
+ - The Solaris/SPARC definition of GC_INIT() in gc.h wasn't C++-compilable.
+
To do:
- The USE_MUNMAP code should really use a separate data structure
indexed by physical page to keep track of time since last use of
* None of this is safe with dlclose and incremental collection.
* But then not much of anything is safe in the presence of dlclose.
*/
-#if defined(__linux__) && !defined(_GNU_SOURCE)
+#if (defined(__linux__) || defined(__GLIBC__)) && !defined(_GNU_SOURCE)
/* Can't test LINUX, since this must be define before other includes */
# define _GNU_SOURCE
#endif
/* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
/* versions. Thanks to Jakub Jelinek for most of the code. */
-# if defined(LINUX) /* Are others OK here, too? */ \
+# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
# define GC_RETURN_ADDR (GC_word)__return_address
#endif
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
# include <features.h>
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
&& !defined(__ia64__)
/* This may also be desirable if it is possible but expensive to */
/* retrieve the call chain. */
#if (defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) \
- || defined(__FreeBSD__)) & !defined(GC_CAN_SAVE_CALL_STACKS)
+ || defined(__FreeBSD__) || defined(__DragonFly__)) & !defined(GC_CAN_SAVE_CALL_STACKS)
# define GC_ADD_CALLER
# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
/* gcc knows how to retrieve return address, but we don't know */
/* be finalized. Return the number of finalizers */
/* that were run. Normally this is also called */
/* implicitly during some allocations. If */
- /* GC-finalize_on_demand is nonzero, it must be called */
+ /* GC_finalize_on_demand is nonzero, it must be called */
/* explicitly. */
/* GC_set_warn_proc can be used to redirect or filter warning messages. */
* from the statically loaded program section.
* This circumvents a Solaris 2.X (X<=4) linker bug.
*/
+ extern int _end[], _etext[];
# ifdef __cplusplus
-# define GC_INIT() { extern int _end[], _etext[]; \
- extern "C" void GC_noop1(GC_word); \
- GC_noop1((GC_word)_end); \
- GC_noop1((GC_word)_etext); }
+ extern "C" void GC_noop1(GC_word);
# else
-# define GC_INIT() { extern int _end[], _etext[]; \
- extern void GC_noop(); \
- GC_noop(_end, _etext); }
+ void GC_noop1();
# endif /* !__cplusplus */
+# define GC_INIT() { GC_noop1((GC_word)_end); \
+ GC_noop1((GC_word)_etext); }
#else
# if defined(__CYGWIN32__) || defined (_AIX)
/*
# define GC_DARWIN_THREADS
# define GC_PTHREADS
# endif
-# if !defined(GC_PTHREADS) && defined(__FreeBSD__)
+# if !defined(GC_PTHREADS) && (defined(__FreeBSD__) || defined(__DragonFly__))
# define GC_FREEBSD_THREADS
# define GC_PTHREADS
# endif
# endif
/* And one for FreeBSD: */
-# if defined(__FreeBSD__) && !defined(FREEBSD)
+# if (defined(__FreeBSD__) || defined(__DragonFly__) || \
+ defined(__FreeBSD_kernel__)) && !defined(FREEBSD)
# define FREEBSD
# endif
# define SUNOS5
# define mach_type_known
# endif
+# if defined(sun) && defined(__amd64)
+# define X86_64
+# define SOLARIS
+# define mach_type_known
+# endif
# if (defined(__OS2__) || defined(__EMX__)) && defined(__32BIT__)
# define I386
# define OS2
# define mach_type_known
# endif
# if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \
- && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
+ && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) \
+ && !defined(__DragonFly__)
# define SPARC
# define DRSNX
# define mach_type_known
# ifndef GC_FREEBSD_THREADS
# define MPROTECT_VDB
# endif
-# define SIG_SUSPEND SIGUSR1
-# define SIG_THR_RESTART SIGUSR2
+# ifdef __GLIBC__
+# define SIG_SUSPEND (32+6)
+# define SIG_THR_RESTART (32+5)
+ extern int _end[];
+# define DATAEND (_end)
+# else
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# endif
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
# define DYNAMIC_LOADING
# define PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1)
# endif
# endif
+# ifdef FREEBSD
+# define OS_TYPE "FREEBSD"
+# ifndef GC_FREEBSD_THREADS
+# define MPROTECT_VDB
+# endif
+# ifdef __GLIBC__
+# define SIG_SUSPEND (32+6)
+# define SIG_THR_RESTART (32+5)
+ extern int _end[];
+# define DATAEND (_end)
+# else
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# endif
+# define FREEBSD_STACKBOTTOM
+# ifdef __ELF__
+# define DYNAMIC_LOADING
+# endif
+ extern char etext[];
+ extern char * GC_FreeBSDGetDataStart();
+# define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
+# endif
# ifdef NETBSD
# define OS_TYPE "NETBSD"
# ifdef __ELF__
extern char etext[];
# define SEARCH_FOR_DATA_START
# endif
+# ifdef SOLARIS
+# define OS_TYPE "SOLARIS"
+# define ELF_CLASS ELFCLASS64
+ extern int _etext[], _end[];
+ extern ptr_t GC_SysVGetDataStart(size_t, ptr_t);
+# define DATASTART GC_SysVGetDataStart(0x1000, (ptr_t)_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. */
+/* HEURISTIC2 probably works, but this appears to be preferable. */
+/* Apparently USRSTACK is defined to be USERLIMIT, but in some */
+/* installations that's undefined. We work around this with a */
+/* gross hack: */
+# include <sys/vmparam.h>
+# ifdef USERLIMIT
+ /* This should work everywhere, but doesn't. */
+# define STACKBOTTOM USRSTACK
+# else
+# define HEURISTIC2
+# endif
+/* At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
+/* It appears to be fixed in 2.8 and 2.9. */
+# ifdef SOLARIS25_PROC_VDB_BUG_FIXED
+# define PROC_VDB
+# endif
+# define DYNAMIC_LOADING
+# if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
+# define USE_MMAP
+ /* Otherwise we now use calloc. Mmap may result in the */
+ /* heap interleaved with thread stacks, which can result in */
+ /* excessive blacklisting. Sbrk is unusable since it */
+ /* doesn't interact correctly with the system malloc. */
+# endif
+# ifdef USE_MMAP
+# define HEAP_START (ptr_t)0x40000000
+# else
+# define HEAP_START DATAEND
+# endif
+# endif
# endif
#if defined(LINUX) && defined(USE_MMAP)
# define SUNOS5SIGS
# endif
-# if defined(FREEBSD) && (__FreeBSD__ >= 4)
+# if defined(FREEBSD) && \
+ (defined(__DragonFly__) || __FreeBSD__ >= 4 || (__FreeBSD_kernel__ >= 4))
# define SUNOS5SIGS
# endif
# define CACHE_LINE_SIZE 32 /* Wild guess */
# endif
-# ifdef LINUX
+# if defined(LINUX) || defined(__GLIBC__)
# define REGISTER_LIBRARIES_EARLY
/* We sometimes use dl_iterate_phdr, which may acquire an internal */
/* lock. This isn't safe after the world has stopped. So we must */
#if defined(SPARC)
# define CAN_SAVE_CALL_ARGS
#endif
-#if (defined(I386) || defined(X86_64)) && defined(LINUX)
+#if (defined(I386) || defined(X86_64)) && (defined(LINUX) || defined(__GLIBC__))
/* SAVE_CALL_CHAIN is supported if the code is compiled to save */
/* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
# define CAN_SAVE_CALL_ARGS
size_t lb;
# endif
{
+# if defined(GC_WIN32_THREADS) && defined(__GNUC__)
+ /* According to Gerard Allen, this helps with MINGW. */
+ /* When using threads need to initalised before use, but GCC uses a malloc
+ in __w32_sharedptr_initialize (w32-shared-ptr.c) */
+ if (!GC_is_initialized) GC_init();
+# endif
/* It might help to manually inline the GC_malloc call here. */
/* But any decent compiler should reduce the extra procedure call */
/* to at most a jump instruction in this case. */
ptr_t cur_brk = (ptr_t)sbrk(0);
SBRK_ARG_T lsbs = (word)cur_brk & (GC_page_size-1);
- if ((SBRK_ARG_T)bytes < 0) return(0); /* too big */
+ if ((SBRK_ARG_T)bytes < 0) {
+ result = 0; /* too big */
+ goto out;
+ }
if (lsbs != 0) {
- if((ptr_t)sbrk(GC_page_size - lsbs) == (ptr_t)(-1)) return(0);
+ if((ptr_t)sbrk(GC_page_size - lsbs) == (ptr_t)(-1)) {
+ result = 0;
+ goto out;
+ }
}
result = (ptr_t)sbrk((SBRK_ARG_T)bytes);
if (result == (ptr_t)(-1)) result = 0;
}
+ out:
# ifdef IRIX5
__UNLOCK_MALLOC();
# endif
} else {
prev -> next = p -> next;
}
+
+#ifdef GC_DARWIN_THREADS
+ mach_port_deallocate(mach_task_self(), p->stop_info.mach_thread);
+#endif
+
GC_INTERNAL_FREE(p);
}
} else {
prev -> next = p -> next;
}
+
+#ifdef GC_DARWIN_THREADS
+ mach_port_deallocate(mach_task_self(), p->stop_info.mach_thread);
+#endif
+
GC_INTERNAL_FREE(p);
}
/* Eventually this one may become unnecessary. For now we need */
/* it to keep the old-style build process working. */
#define GC_TMP_VERSION_MAJOR 6
-#define GC_TMP_VERSION_MINOR 7
+#define GC_TMP_VERSION_MINOR 8
#define GC_TMP_ALPHA_VERSION GC_NOT_ALPHA
#ifndef GC_NOT_ALPHA