Mercurial > gub
changeset 6067:2bb8b25d6144
mingw::libgc: include pthreads in build.
author | Jan Nieuwenhuizen <janneke@gnu.org> |
---|---|
date | Sat, 29 Jan 2011 15:46:03 +0100 |
parents | fd89d51f8b4b |
children | 9eadc306afd9 |
files | gub/specs/libgc.py patches/libgc-6.8-mingw-pthreads.patch |
diffstat | 2 files changed, 57 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gub/specs/libgc.py Wed Jan 26 16:31:56 2011 +0100 +++ b/gub/specs/libgc.py Sat Jan 29 15:46:03 2011 +0100 @@ -1,7 +1,9 @@ from gub import target class Libgc (target.AutoBuild): - source = 'http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz' + configure_flags = target.AutoBuild.configure_flags + ' --enable-threads=pthreads' + #source = 'http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz' + source = 'http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.8.tar.gz&version=6.8' class Libgc__freebsd (Libgc): make_flags = 'THREADDLLIBS=-pthread' @@ -11,5 +13,11 @@ #patches = ['libgc-6.8-freebsd-x86_64.patch'] class Libgc__mingw (Libgc): + dependencies = [ + 'pthreads-w32', + ] + patches = [ + 'libgc-6.8-mingw-pthreads.patch', + ] + force_autoupdate = True source = 'http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.8.tar.gz&version=6.8' - #patches = ['libgc-6.8-freebsd-x86_64.patch']
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/libgc-6.8-mingw-pthreads.patch Sat Jan 29 15:46:03 2011 +0100 @@ -0,0 +1,47 @@ +--- libgc-6.8/configure.in~ 2006-06-07 07:01:52.000000000 +0200 ++++ libgc-6.8/configure.in 2011-01-29 11:50:21.967211128 +0100 +@@ -143,6 +143,10 @@ case "$THREADS" in + *-*-cygwin*) + AC_DEFINE(GC_WIN32_THREADS) + ;; ++ *-*-mingw*) ++ AC_DEFINE(GC_WIN32_THREADS) ++ AC_DEFINE(THREAD_LOCAL_ALLOC) ++ ;; + *-*-darwin*) + AC_DEFINE(GC_DARWIN_THREADS) + AC_DEFINE(THREAD_LOCAL_ALLOC) +--- libgc-6.8/include/gc_pthread_redirects.h~ 2006-02-17 05:07:29.000000000 +0100 ++++ libgc-6.8/include/gc_pthread_redirects.h 2011-01-29 11:17:25.303026857 +0100 +@@ -48,7 +48,8 @@ + /* We treat these similarly. */ + # include <pthread.h> + # include <signal.h> +- ++# define _PID_T_ ++# include <sys/types.h> + int GC_pthread_create(pthread_t *new_thread, + const pthread_attr_t *attr, + void *(*start_routine)(void *), void *arg); +--- libgc-6.8/mark_rts.c~ 2005-02-01 20:05:05.000000000 +0100 ++++ libgc-6.8/mark_rts.c 2011-01-29 12:29:41.444915320 +0100 +@@ -618,7 +618,7 @@ ptr_t cold_gc_frame; + /* If the world is not stopped, this is unsafe. It is */ + /* also unnecessary, since we will do this again with the */ + /* world stopped. */ +-# ifdef THREAD_LOCAL_ALLOC ++# if defined (THREAD_LOCAL_ALLOC) && !defined(GC_WIN32_THREADS) + if (GC_world_stopped) GC_mark_thread_local_free_lists(); + # endif + +--- libgc-6.8/misc.c~ 2006-02-10 20:38:46.000000000 +0100 ++++ libgc-6.8/misc.c 2011-01-29 12:28:31.187195541 +0100 +@@ -498,7 +498,7 @@ void GC_init() + UNLOCK(); + ENABLE_SIGNALS(); + +-# if defined(PARALLEL_MARK) || defined(THREAD_LOCAL_ALLOC) ++#if (defined(PARALLEL_MARK) || defined(THREAD_LOCAL_ALLOC)) && !defined(GC_WIN32_THREADS) + /* Make sure marker threads and started and thread local */ + /* allocation is initialized, in case we didn't get */ + /* called from GC_init_parallel(); */