Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alexrp@xamarin.com>2015-05-13 12:05:38 +0300
committerAlex Rønne Petersen <alexrp@xamarin.com>2015-05-15 16:16:08 +0300
commitd2986015a23569e02200c46a168f9dd11cdb9c82 (patch)
tree80f2c6a7fa40dd89422aa7d9659aa47d7e659eb1
parentaf1f5f88d661d39c31bd5b681413c82445f35c16 (diff)
[runtime] Drop support for external libgc.
This has not been supported for a while, so remove it.
-rw-r--r--configure.ac62
-rw-r--r--libgc/include/gc.h4
-rw-r--r--mono/metadata/boehm-gc.c71
-rw-r--r--mono/metadata/object.c28
-rwxr-xr-xmono/mini/Makefile.am.in5
-rw-r--r--mono/utils/gc_wrapper.h19
-rw-r--r--msvc/mono.props2
-rw-r--r--winconfig.h12
8 files changed, 17 insertions, 186 deletions
diff --git a/configure.ac b/configure.ac
index 1d40df3cc81..a9fa6317873 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,12 +41,6 @@ esac
#
libgc_configure_args=
-if test -d $srcdir/libgc ; then
- libgc_default=included
-else
- libgc_default=boehm
-fi
-
# These variables are the CPPFLAGS/CFLAGS passed to libgc's configure
# libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
CPPFLAGS_FOR_LIBGC=$CPPFLAGS
@@ -117,7 +111,6 @@ case "$host" in
libmono_ldflags="-mms-bitfields -mwindows"
libdl=
libgc_threads=win32
- libgc_default=included
with_sigaltstack=no
with_tls=pthread
LN_S=cp
@@ -183,7 +176,6 @@ case "$host" in
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID)
libdl=
- libgc_default=boehm
libgc_threads=pthreads
with_sigaltstack=no
use_sigposix=yes
@@ -258,7 +250,6 @@ case "$host" in
libmono_cflags="-D_REENTRANT"
libdl=
libgc_threads=pthreads
- libgc_default=boehm
use_sigposix=yes
ikvm_native=no
AC_DEFINE(DISABLE_SOCKETS,1,[Disable sockets support])
@@ -1010,7 +1001,7 @@ dnl
dnl Boehm GC configuration
dnl
-AC_ARG_WITH(libgc, [ --with-gc=boehm,included,none Controls the Boehm GC config, default=included],[libgc=$with_gc],[libgc=$libgc_default])
+AC_ARG_WITH(libgc, [ --with-gc=included,none Controls the Boehm GC config, default=included],[libgc=$with_gc],[libgc=included])
AC_ARG_ENABLE(boehm, [ --disable-boehm Disable the Boehm GC.], support_boehm=$enableval,support_boehm=${support_boehm:-yes})
AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
@@ -1020,55 +1011,13 @@ if test x$enable_parallel_mark = xyes; then
libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
fi
-gc_headers=no
gc_msg=""
-use_included_gc=no
LIBGC_CPPFLAGS=
LIBGC_LIBS=
LIBGC_STATIC_LIBS=
libgc_dir=
case "x$libgc" in
- xboehm|xbohem|xyes)
- AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
- AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
-
- if test "x$found_boehm" != "xyes"; then
- AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
- fi
- if test "x$gc_headers" != "xyes"; then
- AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
- fi
-
- LIBGC_LIBS="-lgc $libdl"
- LIBGC_STATIC_LIBS="$LIBGC_LIBS"
- libmono_ldflags="$libmono_ldflags -lgc"
- BOEHM_DEFINES="-DHAVE_BOEHM_GC"
-
- # AC_CHECK_FUNCS does not work for some reason...
- AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
- if test "x$found_gcj_malloc" = "xyes"; then
- BOEHM_DEFINES="-DHAVE_GC_GCJ_MALLOC $BOEHM_DEFINES"
- AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "System Boehm (with typed GC)", [GC description])
- gc_msg="System Boehm with typed GC"
- else
- AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "System Boehm (no typed GC)", [GC description])
- gc_msg="System Boehm (without typed GC)"
- fi
- AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
- if test "x$found_gc_enable" = "xyes"; then
- BOEHM_DEFINES="-DHAVE_GC_ENABLE $BOEHM_DEFINES"
- fi
-
- # check whether we need to explicitly allow
- # thread registering
- AC_CHECK_LIB(gc, GC_allow_register_threads, found_allow_register_threads="yes",,$libdl)
- if test "x$found_allow_register_threads" = "xyes"; then
- AC_DEFINE(HAVE_GC_ALLOW_REGISTER_THREADS, 1, [GC requires thread registration])
- fi
- ;;
-
xincluded)
- use_included_gc=yes
if test "x$support_boehm" = "xyes"; then
libgc_dir=libgc
fi
@@ -1077,7 +1026,7 @@ case "x$libgc" in
LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
LIBGC_STATIC_LIBS='$(top_builddir)/libgc/libmonogc-static.la'
- BOEHM_DEFINES="-DHAVE_BOEHM_GC -DHAVE_GC_H -DUSE_INCLUDED_LIBGC -DHAVE_GC_GCJ_MALLOC -DHAVE_GC_ENABLE"
+ BOEHM_DEFINES="-DHAVE_BOEHM_GC"
if test x$target_win32 = xyes; then
BOEHM_DEFINES="$BOEHM_DEFINES -DGC_NOT_DLL"
@@ -1093,6 +1042,10 @@ case "x$libgc" in
fi
;;
+ xboehm|xbohem|xyes)
+ AC_MSG_WARN("External Boehm is no longer supported")
+ ;;
+
xsgen)
AC_MSG_WARN("Use --with-sgen instead, --with-gc= controls Boehm configuration")
;;
@@ -1113,7 +1066,6 @@ if test "x$large_heap" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DLARGE_CONFIG"
fi
-AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
AC_SUBST(LIBGC_CPPFLAGS)
AC_SUBST(LIBGC_LIBS)
AC_SUBST(LIBGC_STATIC_LIBS)
@@ -3665,8 +3617,6 @@ AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
AM_CONDITIONAL(HOST_ARM64, test x$HOST = xARM64)
AM_CONDITIONAL(CROSS_COMPILE, test "x$host" != "x$target")
-AM_CONDITIONAL(INCLUDED_LIBGC, test x$libgc = xincluded)
-
AC_SUBST(LIBC)
AC_SUBST(INTL)
AC_SUBST(SQLITE)
diff --git a/libgc/include/gc.h b/libgc/include/gc.h
index 2265fdbd34a..dd7fb7a86c8 100644
--- a/libgc/include/gc.h
+++ b/libgc/include/gc.h
@@ -927,11 +927,7 @@ GC_API void (*GC_is_visible_print_proc)
#if !defined(GC_USE_LD_WRAP) && \
(defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) || defined(GC_DARWIN_THREADS) || defined(GC_MACOSX_THREADS))
-#if defined(_IN_LIBGC) || defined(USE_INCLUDED_LIBGC)
# include "gc_pthread_redirects.h"
-#else
-# include <gc/gc_pthread_redirects.h>
-#endif
#endif
# if defined(PCR) || defined(GC_SOLARIS_THREADS) || \
diff --git a/mono/metadata/boehm-gc.c b/mono/metadata/boehm-gc.c
index b0b50a531a5..8f381360e8d 100644
--- a/mono/metadata/boehm-gc.c
+++ b/mono/metadata/boehm-gc.c
@@ -34,12 +34,10 @@
#if HAVE_BOEHM_GC
-#ifdef USE_INCLUDED_LIBGC
#undef TRUE
#undef FALSE
#define THREAD_LOCAL_ALLOC 1
#include "private/pthread_support.h"
-#endif
#if defined(PLATFORM_MACOSX) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
void *pthread_get_stackaddr_np(pthread_t);
@@ -169,13 +167,7 @@ mono_gc_base_init (void)
GC_finalize_on_demand = 1;
GC_finalizer_notifier = mono_gc_finalize_notify;
-#ifdef HAVE_GC_GCJ_MALLOC
GC_init_gcj_malloc (5, NULL);
-#endif
-
-#ifdef HAVE_GC_ALLOW_REGISTER_THREADS
- GC_allow_register_threads();
-#endif
if ((env = g_getenv ("MONO_GC_PARAMS"))) {
char **ptr, **opts = g_strsplit (env, ",", -1);
@@ -336,13 +328,7 @@ mono_gc_get_heap_size (void)
gboolean
mono_gc_is_gc_thread (void)
{
-#if GC_VERSION_MAJOR >= 7
- return TRUE;
-#elif defined(USE_INCLUDED_LIBGC)
return GC_thread_is_registered ();
-#else
- return TRUE;
-#endif
}
extern int GC_thread_register_foreign (void *base_addr);
@@ -356,33 +342,13 @@ mono_gc_register_thread (void *baseptr)
static void*
boehm_thread_register (MonoThreadInfo* info, void *baseptr)
{
-#if GC_VERSION_MAJOR >= 7
- struct GC_stack_base sb;
- int res;
-
- res = GC_get_stack_base (&sb);
- if (res != GC_SUCCESS) {
- sb.mem_base = baseptr;
-#ifdef __ia64__
- /* Can't determine the register stack bounds */
- g_error ("mono_gc_register_thread failed ().\n");
-#endif
- }
- res = GC_register_my_thread (&sb);
- if ((res != GC_SUCCESS) && (res != GC_DUPLICATE)) {
- g_warning ("GC_register_my_thread () failed.\n");
- return NULL;
- }
- return info;
-#else
if (mono_gc_is_gc_thread())
return info;
-#if defined(USE_INCLUDED_LIBGC) && !defined(HOST_WIN32)
+#if !defined(HOST_WIN32)
return GC_thread_register_foreign (baseptr) ? info : NULL;
#else
return NULL;
#endif
-#endif
}
static void
@@ -399,11 +365,7 @@ boehm_thread_unregister (MonoThreadInfo *p)
gboolean
mono_object_is_alive (MonoObject* o)
{
-#ifdef USE_INCLUDED_LIBGC
return GC_is_marked ((gpointer)o);
-#else
- return TRUE;
-#endif
}
int
@@ -412,8 +374,6 @@ mono_gc_walk_heap (int flags, MonoGCReferences callback, void *data)
return 1;
}
-#ifdef USE_INCLUDED_LIBGC
-
static gint64 gc_start_time;
static void
@@ -500,15 +460,6 @@ mono_gc_enable_events (void)
GC_on_heap_resize = on_gc_heap_resize;
}
-#else
-
-void
-mono_gc_enable_events (void)
-{
-}
-
-#endif
-
int
mono_gc_register_root (char *start, size_t size, void *descr)
{
@@ -587,15 +538,11 @@ mono_gc_make_descr_for_array (int vector, gsize *elem_bitmap, int numbits, size_
void*
mono_gc_make_descr_from_bitmap (gsize *bitmap, int numbits)
{
-#ifdef HAVE_GC_GCJ_MALLOC
/* It seems there are issues when the bitmap doesn't fit: play it safe */
if (numbits >= 30)
return GC_NO_DESCRIPTOR;
else
return (gpointer)GC_make_descriptor ((GC_bitmap)bitmap, numbits);
-#else
- return NULL;
-#endif
}
void*
@@ -704,24 +651,16 @@ mono_gc_clear_domain (MonoDomain *domain)
int
mono_gc_get_suspend_signal (void)
{
-#ifdef USE_INCLUDED_GC
return GC_get_suspend_signal ();
-#else
- return -1;
-#endif
}
int
mono_gc_get_restart_signal (void)
{
-#ifdef USE_INCLUDED_GC
return GC_get_restart_signal ();
-#else
- return -1;
-#endif
}
-#if defined(USE_INCLUDED_LIBGC) && defined(USE_COMPILER_TLS) && defined(__linux__) && (defined(__i386__) || defined(__x86_64__))
+#if defined(USE_COMPILER_TLS) && defined(__linux__) && (defined(__i386__) || defined(__x86_64__))
extern __thread MONO_TLS_FAST void* GC_thread_tls;
#include "metadata-internals.h"
@@ -1252,11 +1191,7 @@ mono_gc_pthread_create (pthread_t *new_thread, const pthread_attr_t *attr, void
#ifdef HOST_WIN32
BOOL APIENTRY mono_gc_dllmain (HMODULE module_handle, DWORD reason, LPVOID reserved)
{
-#ifdef USE_INCLUDED_LIBGC
return GC_DllMain (module_handle, reason, reserved);
-#else
- return TRUE;
-#endif
}
#endif
@@ -1279,9 +1214,7 @@ mono_gc_get_vtable_bits (MonoClass *class)
void
mono_gc_register_altstack (gpointer stack, gint32 stack_size, gpointer altstack, gint32 altstack_size)
{
-#ifdef USE_INCLUDED_LIBGC
GC_register_altstack (stack, stack_size, altstack, altstack_size);
-#endif
}
int
diff --git a/mono/metadata/object.c b/mono/metadata/object.c
index b56dd2c8265..3e134550c87 100644
--- a/mono/metadata/object.c
+++ b/mono/metadata/object.c
@@ -45,19 +45,13 @@
#include <mono/utils/mono-memory-model.h>
#include "cominterop.h"
-#ifdef HAVE_BOEHM_GC
+#if defined(HAVE_BOEHM_GC)
#define NEED_TO_ZERO_PTRFREE 1
+#define GC_NO_DESCRIPTOR ((gpointer)(0 | GC_DS_LENGTH))
#define ALLOC_PTRFREE(obj,vt,size) do { (obj) = GC_MALLOC_ATOMIC ((size)); (obj)->vtable = (vt); (obj)->synchronisation = NULL;} while (0)
#define ALLOC_OBJECT(obj,vt,size) do { (obj) = GC_MALLOC ((size)); (obj)->vtable = (vt);} while (0)
-#ifdef HAVE_GC_GCJ_MALLOC
-#define GC_NO_DESCRIPTOR ((gpointer)(0 | GC_DS_LENGTH))
#define ALLOC_TYPED(dest,size,type) do { (dest) = GC_GCJ_MALLOC ((size),(type)); } while (0)
-#else
-#define GC_NO_DESCRIPTOR (NULL)
-#define ALLOC_TYPED(dest,size,type) do { (dest) = GC_MALLOC ((size)); *(gpointer*)dest = (type);} while (0)
-#endif
-#else
-#ifdef HAVE_SGEN_GC
+#elif defined(HAVE_SGEN_GC)
#define GC_NO_DESCRIPTOR (NULL)
#define ALLOC_PTRFREE(obj,vt,size) do { (obj) = mono_gc_alloc_obj (vt, size);} while (0)
#define ALLOC_OBJECT(obj,vt,size) do { (obj) = mono_gc_alloc_obj (vt, size);} while (0)
@@ -69,7 +63,6 @@
#define ALLOC_OBJECT(obj,vt,size) do { (obj) = calloc (1, (size)); (obj)->vtable = (vt);} while (0)
#define ALLOC_TYPED(dest,size,type) do { (dest) = calloc (1, (size)); *(gpointer*)dest = (type);} while (0)
#endif
-#endif
static MonoObject* mono_object_new_ptrfree (MonoVTable *vtable);
static MonoObject* mono_object_new_ptrfree_box (MonoVTable *vtable);
@@ -964,21 +957,6 @@ mono_class_compute_gc_descriptor (MonoClass *class)
mono_register_jit_icall (mono_object_new_fast, "mono_object_new_fast", mono_create_icall_signature ("object ptr"), FALSE);
mono_register_jit_icall (mono_string_alloc, "mono_string_alloc", mono_create_icall_signature ("object int"), FALSE);
-#ifdef HAVE_GC_GCJ_MALLOC
- /*
- * This is not needed unless the relevant code in mono_get_allocation_ftn () is
- * turned on.
- */
-#if 0
-#ifdef GC_REDIRECT_TO_LOCAL
- mono_register_jit_icall (GC_local_gcj_malloc, "GC_local_gcj_malloc", mono_create_icall_signature ("object int ptr"), FALSE);
- mono_register_jit_icall (GC_local_gcj_fast_malloc, "GC_local_gcj_fast_malloc", mono_create_icall_signature ("object int ptr"), FALSE);
-#endif
- mono_register_jit_icall (GC_gcj_malloc, "GC_gcj_malloc", mono_create_icall_signature ("object int ptr"), FALSE);
- mono_register_jit_icall (GC_gcj_fast_malloc, "GC_gcj_fast_malloc", mono_create_icall_signature ("object int ptr"), FALSE);
-#endif
-
-#endif
gcj_inited = TRUE;
mono_loader_unlock ();
}
diff --git a/mono/mini/Makefile.am.in b/mono/mini/Makefile.am.in
index fb35bbdd94a..3d36929dc80 100755
--- a/mono/mini/Makefile.am.in
+++ b/mono/mini/Makefile.am.in
@@ -3,13 +3,8 @@ mtest=for_loop
monodir=$(top_builddir)
# This is needed for automake dependency generation
-if INCLUDED_LIBGC
libgc_libs=$(monodir)/libgc/libmonogc.la
libgc_static_libs=$(monodir)/libgc/libmonogc-static.la
-else
-libgc_libs=$(LIBGC_LIBS)
-libgc_static_libs=$(LIBGC_STATIC_LIBS)
-endif
libs= \
$(monodir)/mono/metadata/libmonoruntime.la \
diff --git a/mono/utils/gc_wrapper.h b/mono/utils/gc_wrapper.h
index 5b52087e288..11620b3a425 100644
--- a/mono/utils/gc_wrapper.h
+++ b/mono/utils/gc_wrapper.h
@@ -25,7 +25,7 @@
* it if it is the included one.
*/
-# if defined(HAVE_KW_THREAD) && defined(USE_INCLUDED_LIBGC) && !defined(__powerpc__)
+# if defined(HAVE_KW_THREAD) && !defined(__powerpc__)
/* The local alloc stuff is in pthread_support.c, but solaris uses solaris_threads.c */
/* It is also disabled on solaris/x86 by libgc/configure.ac */
/*
@@ -37,19 +37,10 @@
# endif
# endif
-# ifdef HAVE_GC_GC_H
-# include <gc/gc.h>
-# include <gc/gc_typed.h>
-# include <gc/gc_mark.h>
-# include <gc/gc_gcj.h>
-# elif defined(HAVE_GC_H) || defined(USE_INCLUDED_LIBGC)
-# include <gc.h>
-# include <gc_typed.h>
-# include <gc_mark.h>
-# include <gc_gcj.h>
-# else
-# error have boehm GC without headers, you probably need to install them by hand
-# endif
+# include <gc.h>
+# include <gc_typed.h>
+# include <gc_mark.h>
+# include <gc_gcj.h>
#if defined(HOST_WIN32)
#define CreateThread GC_CreateThread
diff --git a/msvc/mono.props b/msvc/mono.props
index 85e839475af..f1d9b277fc6 100644
--- a/msvc/mono.props
+++ b/msvc/mono.props
@@ -4,7 +4,7 @@
<top_srcdir>$(MSBuildProjectDirectory)\..</top_srcdir>
<LIBGC_CPPFLAGS_INCLUDE>$(top_srcdir)\libgc\include</LIBGC_CPPFLAGS_INCLUDE>
<GLIB_CFLAGS_INCLUDE>$(top_srcdir)\eglib\src</GLIB_CFLAGS_INCLUDE>
- <BOEHM_DEFINES>HAVE_BOEHM_GC;HAVE_GC_H;USE_INCLUDED_LIBGC;HAVE_GC_GCJ_MALLOC;HAVE_GC_ENABLE</BOEHM_DEFINES>
+ <BOEHM_DEFINES>HAVE_BOEHM_GC</BOEHM_DEFINES>
<SGEN_DEFINES>HAVE_SGEN_GC;HAVE_MOVING_COLLECTOR;HAVE_WRITE_BARRIERS</SGEN_DEFINES>
</PropertyGroup>
<ItemDefinitionGroup>
diff --git a/winconfig.h b/winconfig.h
index 1b3d494ebf6..a47c844104d 100644
--- a/winconfig.h
+++ b/winconfig.h
@@ -167,18 +167,6 @@
/* Define to 1 if you have the `fstatvfs' function. */
/* #undef HAVE_FSTATVFS */
-/* Have GC_enable */
-/* #define HAVE_GC_ENABLE 1 */
-
-/* Have GC_gcj_malloc */
-/* #define HAVE_GC_GCJ_MALLOC 1 */
-
-/* Define to 1 if you have the <gc/gc.h> header file. */
-/* #undef HAVE_GC_GC_H */
-
-/* Have gc.h */
-/* #define HAVE_GC_H 1 */
-
/* Define to 1 if you have the `getaddrinfo' function. */
#define HAVE_GETADDRINFO 1