diff -ruN boehm-gc.orig/Makefile boehm-gc/Makefile --- boehm-gc.orig/Makefile 2012-11-17 07:55:35.000000000 +0200 +++ boehm-gc/Makefile 2013-02-10 17:23:38.000000000 +0200 @@ -1,13 +1,8 @@ -# New ports collection makefile for: boehm-gc -# Date created: 15 November 1996 -# Whom: Mike McGaughey -# +# Created by: Mike McGaughey # $FreeBSD: ports/devel/boehm-gc/Makefile,v 1.67 2012/11/17 05:55:35 svnexp Exp $ -# PORTNAME= boehm-gc -PORTVERSION= 7.1 -PORTREVISION= 0 +PORTVERSION= 7.2d CATEGORIES= devel MASTER_SITES= http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/ DISTNAME= gc-${PORTVERSION:S/.a/alpha/} @@ -20,7 +15,11 @@ USE_LDCONFIG= yes CONFIGURE_ARGS= --enable-cplusplus --disable-static --disable-threads MAKE_JOBS_UNSAFE= yes + OPTIONS_DEFINE= DEBUG +DEBUG_DESC= Additional debugging support (see documentation) + +WRKSRC= ${WRKDIR}/${DISTNAME:C/[a-z]$//} .include @@ -31,16 +30,15 @@ MAN3= gc.3 -.if ${ARCH} == "ia64" -BROKEN= Does not compile on ia64 -.endif +NOT_FOR_ARCHS= ia64 post-patch: @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/doc/gc.man + @${REINPLACE_CMD} \ + -e "s|(datadir)/@PACKAGE@|(datadir)/doc/@PACKAGE@|" \ + ${WRKSRC}/Makefile.in -# # Get rid of .la and static library files -# post-configure: @${REINPLACE_CMD} -E -e \ '/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool @@ -48,7 +46,7 @@ post-install: ${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3 -test: build +regression-test: build cd ${WRKSRC} && ${MAKE} check .include diff -ruN boehm-gc.orig/distinfo boehm-gc/distinfo --- boehm-gc.orig/distinfo 2011-07-03 17:55:16.000000000 +0300 +++ boehm-gc/distinfo 2013-02-10 17:19:09.000000000 +0200 @@ -1,2 +1,2 @@ -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30 -SIZE (gc-7.1.tar.gz) = 1077714 +SHA256 (gc-7.2d.tar.gz) = d9fe0ae8650d43746a48bfb394cab01a319f3809cee19f8ebd16aa985b511c5e +SIZE (gc-7.2d.tar.gz) = 1263064 diff -ruN boehm-gc.orig/files/patch-Makefile.in boehm-gc/files/patch-Makefile.in --- boehm-gc.orig/files/patch-Makefile.in 2009-12-15 07:53:43.000000000 +0200 +++ boehm-gc/files/patch-Makefile.in 1970-01-01 03:00:00.000000000 +0300 @@ -1,11 +0,0 @@ ---- Makefile.in.orig 2009-10-20 01:25:20.000000000 +0400 -+++ Makefile.in 2009-10-20 01:25:30.000000000 +0400 -@@ -75,7 +75,7 @@ - srcdir = @srcdir@ - top_srcdir = @top_srcdir@ - VPATH = @srcdir@ --pkgdatadir = $(datadir)/@PACKAGE@ -+pkgdatadir = $(datadir)/doc/@PACKAGE@ - pkglibdir = $(libdir)/@PACKAGE@ - pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = . diff -ruN boehm-gc.orig/files/patch-ab boehm-gc/files/patch-ab --- boehm-gc.orig/files/patch-ab 2002-02-02 06:48:28.000000000 +0200 +++ boehm-gc/files/patch-ab 1970-01-01 03:00:00.000000000 +0300 @@ -1,60 +0,0 @@ ---- doc/gc.man.orig Mon Oct 8 10:23:01 2001 -+++ doc/gc.man Mon Oct 8 10:28:31 2001 -@@ -9,7 +9,7 @@ - ... malloc(...) ... - .br - .sp --cc ... gc.a -+cc ... -lgc - .LP - .SH DESCRIPTION - .I GC_malloc -@@ -67,6 +67,48 @@ - This may temporarily write protect pages in the heap. See the README file for more information on how this interacts with system calls that write to the heap. - .LP - Other facilities not discussed here include limited facilities to support incremental collection on machines without appropriate VM support, provisions for providing more explicit object layout information to the garbage collector, more direct support for ``weak'' pointers, support for ``abortable'' garbage collections during idle time, etc. -+.LP -+.SH "PORT INFORMATION" -+.LP -+In this (FreeBSD package) installation, -+.I gc.h -+and -+.I gc_cpp.h -+will probably be found in -+.I %%PREFIX%%/include, -+and the library in -+.I %%PREFIX%%/lib. -+.LP -+This library has been compiled as drop-in replacements -+for malloc and free (which is to say, all malloc -+calls will allocate garbage-collectable data). -+There is no need to include "gc.h" in your C files unless you want -+access to the debugging (and other) functions defined there, -+or unless you want to explicitly use -+.I GC_malloc_uncollectable -+for some allocations. -+Just link against them whenever you want either garbage -+collection or leak detection. -+.LP -+The C++ header file, "gc_cpp.h", -+.I is -+necessary for C++ programs, to obtain the appropriate -+definitions of the -+.I new -+and -+.I delete -+operators. -+The comments in both of these header files presently -+provide far better documentation -+for the package than this man page; -+look there for more information. -+.LP -+This library is compiled without (explicit) support -+for the experimental -+.I gc -+extension of -+.I g++. -+This may or may not make a difference. - .LP - .SH "SEE ALSO" - The README and gc.h files in the distribution. More detailed definitions of the functions exported by the collector are given there. (The above list is not complete.) diff -ruN boehm-gc.orig/files/patch-configure boehm-gc/files/patch-configure --- boehm-gc.orig/files/patch-configure 2009-12-19 13:11:14.000000000 +0200 +++ boehm-gc/files/patch-configure 2013-02-10 14:43:52.000000000 +0200 @@ -1,12 +1,22 @@ ---- configure.orig 2009-12-19 14:02:54.000000000 +0300 -+++ configure 2009-12-19 14:04:13.000000000 +0300 -@@ -6161,6 +6161,9 @@ - sparc-*-netbsd*) - machdep="mach_dep.lo sparc_netbsd_mach_dep.lo" +--- configure.orig 2012-07-25 14:48:53.000000000 +0300 ++++ configure 2012-07-25 14:53:59.000000000 +0300 +@@ -4965,6 +4965,9 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5 + $as_echo "$as_me: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&2;} + $as_echo "#define GC_FREEBSD_THREADS 1" >>confdefs.h ++ if test "${enable_parallel_mark}" = yes; then ++ $as_echo "#define PARALLEL_MARK 1" >>confdefs.h ++ fi + + INCLUDES="$INCLUDES -pthread" + ;; +@@ -5508,6 +5511,9 @@ + sparc*-*-openbsd*) + machdep="mach_dep.lo sparc_mach_dep.lo" ;; -+ sparc64-*-freebsd*) ++ sparc*-*-freebsd*) + machdep="mach_dep.lo sparc_mach_dep.lo" + ;; sparc-sun-solaris2.3) machdep="mach_dep.lo sparc_mach_dep.lo" - cat >>confdefs.h <<\_ACEOF + diff -ruN boehm-gc.orig/files/patch-dbg_mlc.c boehm-gc/files/patch-dbg_mlc.c --- boehm-gc.orig/files/patch-dbg_mlc.c 2009-12-15 07:53:43.000000000 +0200 +++ boehm-gc/files/patch-dbg_mlc.c 1970-01-01 03:00:00.000000000 +0300 @@ -1,77 +0,0 @@ ---- dbg_mlc.c.orig 2009-10-20 00:34:39.000000000 +0400 -+++ dbg_mlc.c 2009-10-20 00:41:22.000000000 +0400 -@@ -456,10 +456,34 @@ - GC_register_displacement((word)sizeof(oh) + offset); - } - -+#if defined(__FreeBSD__) -+#include -+static void GC_caller_func_offset(ad, symp, offp) -+const GC_word ad; -+const char **symp; -+int *offp; -+{ -+ Dl_info caller; -+ if (dladdr((const void *)ad, &caller) && caller.dli_sname != NULL) { -+ *symp = caller.dli_sname; -+ *offp = (const char *)ad - (const char *)caller.dli_saddr; -+ } -+} -+#else -+#define GC_caller_func(ad, symp, offp) -+#endif -+ - void * GC_debug_malloc(size_t lb, GC_EXTRA_PARAMS) - { - void * result = GC_malloc(lb + DEBUG_BYTES); -- -+ -+#ifdef GC_ADD_CALLER -+ if (s == NULL) { -+ GC_caller_func_offset(ra, &s, &i); -+ if (s == NULL) -+ s = "unknown"; -+ } -+#endif - if (result == 0) { - GC_err_printf("GC_debug_malloc(%lu) returning NIL (", - (unsigned long) lb); -@@ -764,6 +788,13 @@ - size_t old_sz; - hdr * hhdr; - -+#ifdef GC_ADD_CALLER -+ if (s == NULL) { -+ GC_caller_func_offset(ra, &s, &i); -+ if (s == NULL) -+ s = "unknown"; -+ } -+#endif - if (p == 0) return(GC_debug_malloc(lb, OPT_RA s, i)); - if (base == 0) { - GC_err_printf("Attempt to reallocate invalid pointer %p\n", p); -@@ -1041,17 +1072,21 @@ - } - - #ifdef GC_ADD_CALLER --# define RA GC_RETURN_ADDR, -+# ifdef GC_RETURN_ADDR_PARENT -+# define RA GC_RETURN_ADDR_PARENT, -+# else -+# define RA GC_RETURN_ADDR, -+# endif - #else - # define RA - #endif - - void * GC_debug_malloc_replacement(size_t lb) - { -- return GC_debug_malloc(lb, RA "unknown", 0); -+ return GC_debug_malloc(lb, RA NULL, 0); - } - - void * GC_debug_realloc_replacement(void *p, size_t lb) - { -- return GC_debug_realloc(p, lb, RA "unknown", 0); -+ return GC_debug_realloc(p, lb, RA NULL, 0); - } diff -ruN boehm-gc.orig/files/patch-doc-gc.man boehm-gc/files/patch-doc-gc.man --- boehm-gc.orig/files/patch-doc-gc.man 1970-01-01 03:00:00.000000000 +0300 +++ boehm-gc/files/patch-doc-gc.man 2013-02-10 14:43:52.000000000 +0200 @@ -0,0 +1,60 @@ +--- doc/gc.man.orig 2012-07-25 14:54:48.000000000 +0300 ++++ doc/gc.man 2012-07-25 14:57:40.000000000 +0300 +@@ -11,7 +11,7 @@ + void * GC_realloc(void *ptr, size_t size); + .br + .sp +-cc ... gc.a ++cc ... -lgc + .LP + .SH DESCRIPTION + .I GC_malloc +@@ -88,6 +88,48 @@ + .LP + Other facilities not discussed here include limited facilities to support incremental collection on machines without appropriate VM support, provisions for providing more explicit object layout information to the garbage collector, more direct support for ``weak'' pointers, support for ``abortable'' garbage collections during idle time, etc. + .LP ++.SH "PORT INFORMATION" ++.LP ++In this (FreeBSD package) installation, ++.I gc.h ++and ++.I gc_cpp.h ++will probably be found in ++.I %%PREFIX%%/include, ++and the library in ++.I %%PREFIX%%/lib. ++.LP ++This library has been compiled as drop-in replacements ++for malloc and free (which is to say, all malloc ++calls will allocate garbage-collectable data). ++There is no need to include "gc.h" in your C files unless you want ++access to the debugging (and other) functions defined there, ++or unless you want to explicitly use ++.I GC_malloc_uncollectable ++for some allocations. ++Just link against them whenever you want either garbage ++collection or leak detection. ++.LP ++The C++ header file, "gc_cpp.h", ++.I is ++necessary for C++ programs, to obtain the appropriate ++definitions of the ++.I new ++and ++.I delete ++operators. ++The comments in both of these header files presently ++provide far better documentation ++for the package than this man page; ++look there for more information. ++.LP ++This library is compiled without (explicit) support ++for the experimental ++.I gc ++extension of ++.I g++. ++This may or may not make a difference. ++.LP + .SH "SEE ALSO" + The README and gc.h files in the distribution. More detailed definitions of the functions exported by the collector are given there. (The above list is not complete.) + .LP diff -ruN boehm-gc.orig/files/patch-dyn_load.c boehm-gc/files/patch-dyn_load.c --- boehm-gc.orig/files/patch-dyn_load.c 2004-11-08 18:33:05.000000000 +0200 +++ boehm-gc/files/patch-dyn_load.c 1970-01-01 03:00:00.000000000 +0300 @@ -1,15 +0,0 @@ ---- dyn_load.c.orig Thu May 6 08:03:06 2004 -+++ dyn_load.c Sun Oct 31 01:53:01 2004 -@@ -97,6 +97,12 @@ - # else - # define ElfW(type) Elf64_##type - # endif -+# elif defined(__FreeBSD__) -+# if __ELF_WORD_SIZE == 32 -+# define ElfW(type) Elf32_##type -+# else -+# define ElfW(type) Elf64_##type -+# endif - # else - # if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32 - # define ElfW(type) Elf32_##type diff -ruN boehm-gc.orig/files/patch-include-gc.h boehm-gc/files/patch-include-gc.h --- boehm-gc.orig/files/patch-include-gc.h 2004-05-24 17:54:56.000000000 +0300 +++ boehm-gc/files/patch-include-gc.h 1970-01-01 03:00:00.000000000 +0300 @@ -1,10 +0,0 @@ ---- include/gc.h.orig Wed Jun 4 17:07:33 2003 -+++ include/gc.h Wed May 12 20:03:22 2004 -@@ -487,6 +487,7 @@ - /* gcc knows how to retrieve return address, but we don't know */ - /* how to generate call stacks. */ - # define GC_RETURN_ADDR (GC_word)__builtin_return_address(0) -+# define GC_RETURN_ADDR_PARENT (GC_word)__builtin_return_address(1) - # else - /* Just pass 0 for gcc compatibility. */ - # define GC_RETURN_ADDR 0 diff -ruN boehm-gc.orig/files/patch-include-private-gcconfig.h boehm-gc/files/patch-include-private-gcconfig.h --- boehm-gc.orig/files/patch-include-private-gcconfig.h 2009-12-15 07:53:43.000000000 +0200 +++ boehm-gc/files/patch-include-private-gcconfig.h 2013-02-10 14:43:52.000000000 +0200 @@ -1,42 +1,36 @@ ---- include/private/gcconfig.h.orig 2008-02-20 22:23:00.000000000 +0300 -+++ include/private/gcconfig.h 2009-10-20 01:08:38.000000000 +0400 -@@ -64,7 +64,7 @@ - /* Determine the machine type: */ - # if defined(__arm__) || defined(__thumb__) +--- include/private/gcconfig.h.orig 2012-07-25 15:03:15.000000000 +0300 ++++ include/private/gcconfig.h 2012-07-25 15:07:05.000000000 +0300 +@@ -73,7 +73,8 @@ + # if defined(__arm) || defined(__arm__) || defined(__thumb__) # define ARM32 --# if !defined(LINUX) && !defined(NETBSD) -+# if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) + # if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) \ +- && !defined(DARWIN) && !defined(_WIN32) && !defined(__CEGCC__) ++ && !defined(DARWIN) && !defined(_WIN32) && !defined(__CEGCC__) \ ++ && !defined(FREEBSD) # define NOSYS # define mach_type_known # endif -@@ -334,10 +334,26 @@ - # define X86_64 - # define mach_type_known +@@ -359,10 +360,18 @@ + # define I386 + # define mach_type_known # endif -+# if defined(__FreeBSD__) && defined(__amd64__) -+# define X86_64 -+# define mach_type_known -+# endif -+# if defined(__FreeBSD__) && defined(__ia64__) -+# define IA64 -+# define mach_type_known -+# endif - # if defined(FREEBSD) && defined(__sparc__) - # define SPARC - # define mach_type_known +-# if defined(FREEBSD) && defined(__x86_64__) ++# if defined(FREEBSD) && defined(__amd64__) + # define X86_64 + # define mach_type_known # endif -+# if defined(FREEBSD) && defined(__powerpc__) -+# define POWERPC -+# define mach_type_known ++# if defined(FREEBSD) && defined(__ia64__) ++# define IA64 ++# define mach_type_known +# endif +# if defined(FREEBSD) && defined(__arm__) -+# define ARM32 -+# define mach_type_known ++# define ARM32 ++# define mach_type_known +# endif - # if defined(bsdi) && (defined(i386) || defined(__i386__)) - # define I386 - # define BSDI -@@ -1771,6 +1787,16 @@ + # if defined(__NetBSD__) && (defined(i386) || defined(__i386__)) + # define I386 + # define mach_type_known +@@ -1949,6 +1958,16 @@ # define OS_TYPE "MSWINCE" # define DATAEND /* not needed */ # endif @@ -46,18 +40,10 @@ +# ifdef __ELF__ +# define DYNAMIC_LOADING +# endif -+# define HEURISTIC2 -+ extern char etext[]; -+# define SEARCH_FOR_DATA_START ++# define HEURISTIC2 ++ extern char etext[]; ++# define SEARCH_FOR_DATA_START +# endif - # ifdef NOSYS - /* __data_start is usually defined in the target linker script. */ - extern int __data_start[]; -@@ -1800,6 +1826,7 @@ - # define OS_TYPE "MSWINCE" - # define DATAEND /* not needed */ - # endif -+ - # ifdef LINUX - # define OS_TYPE "LINUX" - # define LINUX_STACKBOTTOM + # ifdef DARWIN + /* iPhone */ + # define OS_TYPE "DARWIN" diff -ruN boehm-gc.orig/files/patch-os_dep.c boehm-gc/files/patch-os_dep.c --- boehm-gc.orig/files/patch-os_dep.c 2010-04-01 11:38:32.000000000 +0300 +++ boehm-gc/files/patch-os_dep.c 2013-02-10 14:43:52.000000000 +0200 @@ -1,44 +1,28 @@ ---- os_dep.c.orig 2008-02-29 11:01:28.000000000 -0800 -+++ os_dep.c 2010-04-01 00:50:34.000000000 -0700 -@@ -816,7 +816,7 @@ - || defined(HURD) || defined(NETBSD) - static struct sigaction old_segv_act; - # if defined(_sigargs) /* !Irix6.x */ || defined(HPUX) \ -- || defined(HURD) || defined(NETBSD) -+ || defined(HURD) || defined(NETBSD) || defined(FREEBSD) - static struct sigaction old_bus_act; - # endif - # else -@@ -826,7 +826,7 @@ - void GC_set_and_save_fault_handler(handler h) +--- os_dep.c.orig 2012-07-25 15:08:26.000000000 +0300 ++++ os_dep.c 2012-07-25 15:16:54.000000000 +0300 +@@ -843,7 +843,7 @@ + GC_INNER void GC_set_and_save_fault_handler(GC_fault_handler_t h) { - # if defined(SUNOS5SIGS) || defined(IRIX5) \ -- || defined(OSF1) || defined(HURD) || defined(NETBSD) -+ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) - struct sigaction act; + # if defined(SUNOS5SIGS) || defined(IRIX5) \ +- || defined(OSF1) || defined(HURD) || defined(NETBSD) ++ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) + struct sigaction act; - act.sa_handler = h; -@@ -846,7 +846,7 @@ - # else - (void) sigaction(SIGSEGV, &act, &old_segv_act); - # if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \ -- || defined(HPUX) || defined(HURD) || defined(NETBSD) -+ || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) - /* Under Irix 5.x or HP/UX, we may get SIGBUS. */ - /* Pthreads doesn't exist under Irix 5.x, so we */ - /* don't have to worry in the threads case. */ -@@ -2713,7 +2713,13 @@ - # include - # if defined(FREEBSD) - # define SIG_OK TRUE --# define CODE_OK (code == BUS_PAGE_FAULT) + act.sa_handler = h; +@@ -3072,8 +3072,15 @@ + # ifndef SEGV_ACCERR + # define SEGV_ACCERR 2 + # endif +-# define CODE_OK (si -> si_code == BUS_PAGE_FAULT \ +# if defined(POWERPC) -+# define AIM /* Pretend that we're AIM. */ -+# include -+# define CODE_OK (code == EXC_DSI) ++# define AIM /* Pretend that we're AIM. */ ++# include ++# define CODE_OK (si -> si_code == EXC_DSI \ ++ || si -> si_code == SEGV_ACCERR) +# else -+# define CODE_OK (code == BUS_PAGE_FAULT) ++# define CODE_OK (si -> si_code == BUS_PAGE_FAULT \ + || si -> si_code == SEGV_ACCERR) +# endif # elif defined(OSF1) - # define SIG_OK (sig == SIGSEGV) - # define CODE_OK (code == 2 /* experimentally determined */) + # define CODE_OK (si -> si_code == 2 /* experimentally determined */) + # elif defined(IRIX5) diff -ruN boehm-gc.orig/pkg-plist boehm-gc/pkg-plist --- boehm-gc.orig/pkg-plist 2009-12-15 07:53:43.000000000 +0200 +++ boehm-gc/pkg-plist 2013-02-10 14:43:52.000000000 +0200 @@ -1,4 +1,5 @@ include/gc.h +include/gc/cord.h include/gc/gc.h include/gc/gc_allocator.h include/gc/gc_amiga_redirects.h @@ -32,6 +33,7 @@ share/doc/gc/README.arm.cross share/doc/gc/README.autoconf share/doc/gc/README.changes +share/doc/gc/README.cmake share/doc/gc/README.contributors share/doc/gc/README.cords share/doc/gc/README.darwin diff -ruN boehm-gc-threaded.orig/Makefile boehm-gc-threaded/Makefile --- boehm-gc-threaded.orig/Makefile 2012-11-17 07:55:35.000000000 +0200 +++ boehm-gc-threaded/Makefile 2013-02-10 17:45:19.000000000 +0200 @@ -1,13 +1,8 @@ -# New ports collection makefile for: boehm-gc-redirect -# Date created: 12/17/2009 -# Whom: stas -# +# Created by: stas # $FreeBSD: ports/devel/boehm-gc-threaded/Makefile,v 1.7 2012/11/17 05:55:35 svnexp Exp $ -# PORTNAME= boehm-gc -PORTVERSION= 7.1 -PORTREVISION= 1 +PORTVERSION= 7.2d CATEGORIES= devel MASTER_SITES= http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/ PKGNAMESUFFIX= -${GC_VARIANT} @@ -16,30 +11,29 @@ MAINTAINER= ports@FreeBSD.org COMMENT= Garbage collection and memory leak detection for C and C++ -RUN_DEPENDS= ${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc +RUN_DEPENDS= ${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc GNU_CONFIGURE= yes USE_LDCONFIG= yes -CONFIGURE_ARGS= --enable-cplusplus --disable-static --enable-threads=posix \ - --enable-thread-local-alloc -CONFIGURE_ENV= CFLAGSS="${CFLAGS} LIBS="${LIBS} +CONFIGURE_ARGS= --enable-cplusplus --disable-static --enable-threads=posix MAKE_JOBS_UNSAFE= yes INSTLIBS= cord gc gccpp GC_VARIANT= threaded -SOVER= 1 +SOVER= 1 OPTIONS_DEFINE= PARALLEL_MARK DEBUG +DEBUG_DESC= Additional debugging support (see documentation) PARALLEL_MARK_DESC= Parallel-thread marking (faster for SMP) PLIST_FILES= ${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so.${SOVER},g} \ ${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g} \ libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc -.include +WRKSRC= ${WRKDIR}/${DISTNAME:C/[a-z]$//} -.if ${ARCH} == "ia64" -BROKEN= Does not compile on ia64 -.endif +NOT_FOR_ARCHS= ia64 + +.include .if ${PORT_OPTIONS:MPARALLEL_MARK} CONFIGURE_ARGS+= --enable-parallel-mark @@ -67,7 +61,7 @@ ${INSTALL_DATA} ${WRKSRC}/bdw-gc.pc \ ${PREFIX}/libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc -test: build +regression-test: build cd ${WRKSRC} && ${MAKE} check .include diff -ruN boehm-gc-threaded.orig/distinfo boehm-gc-threaded/distinfo --- boehm-gc-threaded.orig/distinfo 2011-07-03 17:55:16.000000000 +0300 +++ boehm-gc-threaded/distinfo 2013-02-10 17:21:15.000000000 +0200 @@ -1,2 +1,2 @@ -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30 -SIZE (gc-7.1.tar.gz) = 1077714 +SHA256 (gc-7.2d.tar.gz) = d9fe0ae8650d43746a48bfb394cab01a319f3809cee19f8ebd16aa985b511c5e +SIZE (gc-7.2d.tar.gz) = 1263064 diff -ruN boehm-gc-threaded.orig/files/patch-configure boehm-gc-threaded/files/patch-configure --- boehm-gc-threaded.orig/files/patch-configure 2009-12-19 13:11:15.000000000 +0200 +++ boehm-gc-threaded/files/patch-configure 2013-02-10 14:43:52.000000000 +0200 @@ -1,12 +1,22 @@ ---- configure.orig 2009-12-19 14:02:54.000000000 +0300 -+++ configure 2009-12-19 14:04:13.000000000 +0300 -@@ -6161,6 +6161,9 @@ - sparc-*-netbsd*) - machdep="mach_dep.lo sparc_netbsd_mach_dep.lo" +--- configure.orig 2012-07-25 14:48:53.000000000 +0300 ++++ configure 2012-07-25 14:53:59.000000000 +0300 +@@ -4965,6 +4965,9 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5 + $as_echo "$as_me: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&2;} + $as_echo "#define GC_FREEBSD_THREADS 1" >>confdefs.h ++ if test "${enable_parallel_mark}" = yes; then ++ $as_echo "#define PARALLEL_MARK 1" >>confdefs.h ++ fi + + INCLUDES="$INCLUDES -pthread" + ;; +@@ -5508,6 +5511,9 @@ + sparc*-*-openbsd*) + machdep="mach_dep.lo sparc_mach_dep.lo" ;; -+ sparc64-*-freebsd*) ++ sparc*-*-freebsd*) + machdep="mach_dep.lo sparc_mach_dep.lo" + ;; sparc-sun-solaris2.3) machdep="mach_dep.lo sparc_mach_dep.lo" - cat >>confdefs.h <<\_ACEOF + diff -ruN boehm-gc-threaded.orig/files/patch-dbg_mlc.c boehm-gc-threaded/files/patch-dbg_mlc.c --- boehm-gc-threaded.orig/files/patch-dbg_mlc.c 2009-12-18 06:08:01.000000000 +0200 +++ boehm-gc-threaded/files/patch-dbg_mlc.c 1970-01-01 03:00:00.000000000 +0300 @@ -1,77 +0,0 @@ ---- dbg_mlc.c.orig 2009-10-20 00:34:39.000000000 +0400 -+++ dbg_mlc.c 2009-10-20 00:41:22.000000000 +0400 -@@ -456,10 +456,34 @@ - GC_register_displacement((word)sizeof(oh) + offset); - } - -+#if defined(__FreeBSD__) -+#include -+static void GC_caller_func_offset(ad, symp, offp) -+const GC_word ad; -+const char **symp; -+int *offp; -+{ -+ Dl_info caller; -+ if (dladdr((const void *)ad, &caller) && caller.dli_sname != NULL) { -+ *symp = caller.dli_sname; -+ *offp = (const char *)ad - (const char *)caller.dli_saddr; -+ } -+} -+#else -+#define GC_caller_func(ad, symp, offp) -+#endif -+ - void * GC_debug_malloc(size_t lb, GC_EXTRA_PARAMS) - { - void * result = GC_malloc(lb + DEBUG_BYTES); -- -+ -+#ifdef GC_ADD_CALLER -+ if (s == NULL) { -+ GC_caller_func_offset(ra, &s, &i); -+ if (s == NULL) -+ s = "unknown"; -+ } -+#endif - if (result == 0) { - GC_err_printf("GC_debug_malloc(%lu) returning NIL (", - (unsigned long) lb); -@@ -764,6 +788,13 @@ - size_t old_sz; - hdr * hhdr; - -+#ifdef GC_ADD_CALLER -+ if (s == NULL) { -+ GC_caller_func_offset(ra, &s, &i); -+ if (s == NULL) -+ s = "unknown"; -+ } -+#endif - if (p == 0) return(GC_debug_malloc(lb, OPT_RA s, i)); - if (base == 0) { - GC_err_printf("Attempt to reallocate invalid pointer %p\n", p); -@@ -1041,17 +1072,21 @@ - } - - #ifdef GC_ADD_CALLER --# define RA GC_RETURN_ADDR, -+# ifdef GC_RETURN_ADDR_PARENT -+# define RA GC_RETURN_ADDR_PARENT, -+# else -+# define RA GC_RETURN_ADDR, -+# endif - #else - # define RA - #endif - - void * GC_debug_malloc_replacement(size_t lb) - { -- return GC_debug_malloc(lb, RA "unknown", 0); -+ return GC_debug_malloc(lb, RA NULL, 0); - } - - void * GC_debug_realloc_replacement(void *p, size_t lb) - { -- return GC_debug_realloc(p, lb, RA "unknown", 0); -+ return GC_debug_realloc(p, lb, RA NULL, 0); - } diff -ruN boehm-gc-threaded.orig/files/patch-dyn_load.c boehm-gc-threaded/files/patch-dyn_load.c --- boehm-gc-threaded.orig/files/patch-dyn_load.c 2009-12-18 06:08:01.000000000 +0200 +++ boehm-gc-threaded/files/patch-dyn_load.c 1970-01-01 03:00:00.000000000 +0300 @@ -1,15 +0,0 @@ ---- dyn_load.c.orig Thu May 6 08:03:06 2004 -+++ dyn_load.c Sun Oct 31 01:53:01 2004 -@@ -97,6 +97,12 @@ - # else - # define ElfW(type) Elf64_##type - # endif -+# elif defined(__FreeBSD__) -+# if __ELF_WORD_SIZE == 32 -+# define ElfW(type) Elf32_##type -+# else -+# define ElfW(type) Elf64_##type -+# endif - # else - # if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32 - # define ElfW(type) Elf32_##type diff -ruN boehm-gc-threaded.orig/files/patch-include-gc.h boehm-gc-threaded/files/patch-include-gc.h --- boehm-gc-threaded.orig/files/patch-include-gc.h 2009-12-18 06:08:01.000000000 +0200 +++ boehm-gc-threaded/files/patch-include-gc.h 1970-01-01 03:00:00.000000000 +0300 @@ -1,10 +0,0 @@ ---- include/gc.h.orig Wed Jun 4 17:07:33 2003 -+++ include/gc.h Wed May 12 20:03:22 2004 -@@ -487,6 +487,7 @@ - /* gcc knows how to retrieve return address, but we don't know */ - /* how to generate call stacks. */ - # define GC_RETURN_ADDR (GC_word)__builtin_return_address(0) -+# define GC_RETURN_ADDR_PARENT (GC_word)__builtin_return_address(1) - # else - /* Just pass 0 for gcc compatibility. */ - # define GC_RETURN_ADDR 0 diff -ruN boehm-gc-threaded.orig/files/patch-include-private-gcconfig.h boehm-gc-threaded/files/patch-include-private-gcconfig.h --- boehm-gc-threaded.orig/files/patch-include-private-gcconfig.h 2009-12-18 06:08:01.000000000 +0200 +++ boehm-gc-threaded/files/patch-include-private-gcconfig.h 2013-02-10 14:43:52.000000000 +0200 @@ -1,42 +1,36 @@ ---- include/private/gcconfig.h.orig 2008-02-20 22:23:00.000000000 +0300 -+++ include/private/gcconfig.h 2009-10-20 01:08:38.000000000 +0400 -@@ -64,7 +64,7 @@ - /* Determine the machine type: */ - # if defined(__arm__) || defined(__thumb__) +--- include/private/gcconfig.h.orig 2012-07-25 15:03:15.000000000 +0300 ++++ include/private/gcconfig.h 2012-07-25 15:07:05.000000000 +0300 +@@ -73,7 +73,8 @@ + # if defined(__arm) || defined(__arm__) || defined(__thumb__) # define ARM32 --# if !defined(LINUX) && !defined(NETBSD) -+# if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) + # if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) \ +- && !defined(DARWIN) && !defined(_WIN32) && !defined(__CEGCC__) ++ && !defined(DARWIN) && !defined(_WIN32) && !defined(__CEGCC__) \ ++ && !defined(FREEBSD) # define NOSYS # define mach_type_known # endif -@@ -334,10 +334,26 @@ - # define X86_64 - # define mach_type_known +@@ -359,10 +360,18 @@ + # define I386 + # define mach_type_known # endif -+# if defined(__FreeBSD__) && defined(__amd64__) -+# define X86_64 -+# define mach_type_known -+# endif -+# if defined(__FreeBSD__) && defined(__ia64__) -+# define IA64 -+# define mach_type_known -+# endif - # if defined(FREEBSD) && defined(__sparc__) - # define SPARC - # define mach_type_known +-# if defined(FREEBSD) && defined(__x86_64__) ++# if defined(FREEBSD) && defined(__amd64__) + # define X86_64 + # define mach_type_known # endif -+# if defined(FREEBSD) && defined(__powerpc__) -+# define POWERPC -+# define mach_type_known ++# if defined(FREEBSD) && defined(__ia64__) ++# define IA64 ++# define mach_type_known +# endif +# if defined(FREEBSD) && defined(__arm__) -+# define ARM32 -+# define mach_type_known ++# define ARM32 ++# define mach_type_known +# endif - # if defined(bsdi) && (defined(i386) || defined(__i386__)) - # define I386 - # define BSDI -@@ -1771,6 +1787,16 @@ + # if defined(__NetBSD__) && (defined(i386) || defined(__i386__)) + # define I386 + # define mach_type_known +@@ -1949,6 +1958,16 @@ # define OS_TYPE "MSWINCE" # define DATAEND /* not needed */ # endif @@ -46,18 +40,10 @@ +# ifdef __ELF__ +# define DYNAMIC_LOADING +# endif -+# define HEURISTIC2 -+ extern char etext[]; -+# define SEARCH_FOR_DATA_START ++# define HEURISTIC2 ++ extern char etext[]; ++# define SEARCH_FOR_DATA_START +# endif - # ifdef NOSYS - /* __data_start is usually defined in the target linker script. */ - extern int __data_start[]; -@@ -1800,6 +1826,7 @@ - # define OS_TYPE "MSWINCE" - # define DATAEND /* not needed */ - # endif -+ - # ifdef LINUX - # define OS_TYPE "LINUX" - # define LINUX_STACKBOTTOM + # ifdef DARWIN + /* iPhone */ + # define OS_TYPE "DARWIN" diff -ruN boehm-gc-threaded.orig/files/patch-os_dep.c boehm-gc-threaded/files/patch-os_dep.c --- boehm-gc-threaded.orig/files/patch-os_dep.c 2010-04-01 11:49:01.000000000 +0300 +++ boehm-gc-threaded/files/patch-os_dep.c 2013-02-10 14:43:52.000000000 +0200 @@ -1,44 +1,28 @@ ---- os_dep.c.orig 2008-02-29 11:01:28.000000000 -0800 -+++ os_dep.c 2010-04-01 00:50:34.000000000 -0700 -@@ -816,7 +816,7 @@ - || defined(HURD) || defined(NETBSD) - static struct sigaction old_segv_act; - # if defined(_sigargs) /* !Irix6.x */ || defined(HPUX) \ -- || defined(HURD) || defined(NETBSD) -+ || defined(HURD) || defined(NETBSD) || defined(FREEBSD) - static struct sigaction old_bus_act; - # endif - # else -@@ -826,7 +826,7 @@ - void GC_set_and_save_fault_handler(handler h) +--- os_dep.c.orig 2012-07-25 15:08:26.000000000 +0300 ++++ os_dep.c 2012-07-25 15:16:54.000000000 +0300 +@@ -843,7 +843,7 @@ + GC_INNER void GC_set_and_save_fault_handler(GC_fault_handler_t h) { - # if defined(SUNOS5SIGS) || defined(IRIX5) \ -- || defined(OSF1) || defined(HURD) || defined(NETBSD) -+ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) - struct sigaction act; + # if defined(SUNOS5SIGS) || defined(IRIX5) \ +- || defined(OSF1) || defined(HURD) || defined(NETBSD) ++ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) + struct sigaction act; - act.sa_handler = h; -@@ -846,7 +846,7 @@ - # else - (void) sigaction(SIGSEGV, &act, &old_segv_act); - # if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \ -- || defined(HPUX) || defined(HURD) || defined(NETBSD) -+ || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) - /* Under Irix 5.x or HP/UX, we may get SIGBUS. */ - /* Pthreads doesn't exist under Irix 5.x, so we */ - /* don't have to worry in the threads case. */ -@@ -2713,7 +2713,13 @@ - # include - # if defined(FREEBSD) - # define SIG_OK TRUE --# define CODE_OK (code == BUS_PAGE_FAULT) + act.sa_handler = h; +@@ -3072,8 +3072,15 @@ + # ifndef SEGV_ACCERR + # define SEGV_ACCERR 2 + # endif +-# define CODE_OK (si -> si_code == BUS_PAGE_FAULT \ +# if defined(POWERPC) -+# define AIM /* Pretend that we're AIM. */ -+# include -+# define CODE_OK (code == EXC_DSI) ++# define AIM /* Pretend that we're AIM. */ ++# include ++# define CODE_OK (si -> si_code == EXC_DSI \ ++ || si -> si_code == SEGV_ACCERR) +# else -+# define CODE_OK (code == BUS_PAGE_FAULT) ++# define CODE_OK (si -> si_code == BUS_PAGE_FAULT \ + || si -> si_code == SEGV_ACCERR) +# endif # elif defined(OSF1) - # define SIG_OK (sig == SIGSEGV) - # define CODE_OK (code == 2 /* experimentally determined */) + # define CODE_OK (si -> si_code == 2 /* experimentally determined */) + # elif defined(IRIX5) diff -ruN boehm-gc-redirect.orig/Makefile boehm-gc-redirect/Makefile --- boehm-gc-redirect.orig/Makefile 2012-11-17 07:55:35.000000000 +0200 +++ boehm-gc-redirect/Makefile 2013-02-10 17:23:24.000000000 +0200 @@ -1,12 +1,8 @@ -# New ports collection makefile for: boehm-gc-redirect -# Date created: 12/17/2009 -# Whom: stas -# +# Created by: stas # $FreeBSD: ports/devel/boehm-gc-redirect/Makefile,v 1.6 2012/11/17 05:55:35 svnexp Exp $ -# PORTNAME= boehm-gc -PORTVERSION= 7.1 +PORTVERSION= 7.2d CATEGORIES= devel MASTER_SITES= http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/ PKGNAMESUFFIX= -${GC_VARIANT} @@ -15,28 +11,29 @@ MAINTAINER= ports@FreeBSD.org COMMENT= Garbage collection and memory leak detection for C and C++ -RUN_DEPENDS= ${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc +RUN_DEPENDS= ${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc GNU_CONFIGURE= yes USE_LDCONFIG= yes CONFIGURE_ARGS= --enable-cplusplus --disable-static --disable-threads \ --enable-redirect-malloc -CONFIGURE_ENV= CFLAGSS="${CFLAGS} LIBS="${LIBS} MAKE_JOBS_UNSAFE= yes INSTLIBS= cord gc gccpp GC_VARIANT= redirect -SOVER= 1 +SOVER= 1 OPTIONS_DEFINE= DEBUG +DEBUG_DESC= Additional debugging support (see documentation) PLIST_FILES= ${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so.${SOVER},g} \ - ${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g} + ${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g} \ + libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc -.include +WRKSRC= ${WRKDIR}/${DISTNAME:C/[a-z]$//} -.if ${ARCH} == "ia64" -BROKEN= Does not compile on ia64 -.endif +NOT_FOR_ARCHS= ia64 + +.include .if ${PORT_OPTIONS:MDEBUG} CONFIGURE_ARGS+= --enable-gc-debug @@ -48,6 +45,7 @@ -e 's,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g' \ -e 's,libcord\.la,libcord-${GC_VARIANT}.la,g' \ ${WRKSRC}/Makefile.in + ${REINPLACE_CMD} -e 's,-lgc,-lgc-${GC_VARIANT},' ${WRKSRC}/bdw-gc.pc.in do-install: .for LIB in ${INSTLIBS} @@ -56,8 +54,10 @@ @(cd ${PREFIX}/lib && ${LN} -s lib${LIB}-${GC_VARIANT}.so.${SOVER} \ lib${LIB}-${GC_VARIANT}.so) .endfor + ${INSTALL_DATA} ${WRKSRC}/bdw-gc.pc \ + ${PREFIX}/libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc -test: build +regression-test: build cd ${WRKSRC} && ${MAKE} check .include diff -ruN boehm-gc-redirect.orig/distinfo boehm-gc-redirect/distinfo --- boehm-gc-redirect.orig/distinfo 2011-07-03 17:55:16.000000000 +0300 +++ boehm-gc-redirect/distinfo 2013-02-10 17:21:18.000000000 +0200 @@ -1,2 +1,2 @@ -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30 -SIZE (gc-7.1.tar.gz) = 1077714 +SHA256 (gc-7.2d.tar.gz) = d9fe0ae8650d43746a48bfb394cab01a319f3809cee19f8ebd16aa985b511c5e +SIZE (gc-7.2d.tar.gz) = 1263064 diff -ruN boehm-gc-redirect.orig/files/patch-configure boehm-gc-redirect/files/patch-configure --- boehm-gc-redirect.orig/files/patch-configure 2009-12-19 13:11:14.000000000 +0200 +++ boehm-gc-redirect/files/patch-configure 2013-02-10 14:43:52.000000000 +0200 @@ -1,12 +1,22 @@ ---- configure.orig 2009-12-19 14:02:54.000000000 +0300 -+++ configure 2009-12-19 14:04:13.000000000 +0300 -@@ -6161,6 +6161,9 @@ - sparc-*-netbsd*) - machdep="mach_dep.lo sparc_netbsd_mach_dep.lo" +--- configure.orig 2012-07-25 14:48:53.000000000 +0300 ++++ configure 2012-07-25 14:53:59.000000000 +0300 +@@ -4965,6 +4965,9 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5 + $as_echo "$as_me: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&2;} + $as_echo "#define GC_FREEBSD_THREADS 1" >>confdefs.h ++ if test "${enable_parallel_mark}" = yes; then ++ $as_echo "#define PARALLEL_MARK 1" >>confdefs.h ++ fi + + INCLUDES="$INCLUDES -pthread" + ;; +@@ -5508,6 +5511,9 @@ + sparc*-*-openbsd*) + machdep="mach_dep.lo sparc_mach_dep.lo" ;; -+ sparc64-*-freebsd*) ++ sparc*-*-freebsd*) + machdep="mach_dep.lo sparc_mach_dep.lo" + ;; sparc-sun-solaris2.3) machdep="mach_dep.lo sparc_mach_dep.lo" - cat >>confdefs.h <<\_ACEOF + diff -ruN boehm-gc-redirect.orig/files/patch-dbg_mlc.c boehm-gc-redirect/files/patch-dbg_mlc.c --- boehm-gc-redirect.orig/files/patch-dbg_mlc.c 2009-12-18 06:07:24.000000000 +0200 +++ boehm-gc-redirect/files/patch-dbg_mlc.c 1970-01-01 03:00:00.000000000 +0300 @@ -1,77 +0,0 @@ ---- dbg_mlc.c.orig 2009-10-20 00:34:39.000000000 +0400 -+++ dbg_mlc.c 2009-10-20 00:41:22.000000000 +0400 -@@ -456,10 +456,34 @@ - GC_register_displacement((word)sizeof(oh) + offset); - } - -+#if defined(__FreeBSD__) -+#include -+static void GC_caller_func_offset(ad, symp, offp) -+const GC_word ad; -+const char **symp; -+int *offp; -+{ -+ Dl_info caller; -+ if (dladdr((const void *)ad, &caller) && caller.dli_sname != NULL) { -+ *symp = caller.dli_sname; -+ *offp = (const char *)ad - (const char *)caller.dli_saddr; -+ } -+} -+#else -+#define GC_caller_func(ad, symp, offp) -+#endif -+ - void * GC_debug_malloc(size_t lb, GC_EXTRA_PARAMS) - { - void * result = GC_malloc(lb + DEBUG_BYTES); -- -+ -+#ifdef GC_ADD_CALLER -+ if (s == NULL) { -+ GC_caller_func_offset(ra, &s, &i); -+ if (s == NULL) -+ s = "unknown"; -+ } -+#endif - if (result == 0) { - GC_err_printf("GC_debug_malloc(%lu) returning NIL (", - (unsigned long) lb); -@@ -764,6 +788,13 @@ - size_t old_sz; - hdr * hhdr; - -+#ifdef GC_ADD_CALLER -+ if (s == NULL) { -+ GC_caller_func_offset(ra, &s, &i); -+ if (s == NULL) -+ s = "unknown"; -+ } -+#endif - if (p == 0) return(GC_debug_malloc(lb, OPT_RA s, i)); - if (base == 0) { - GC_err_printf("Attempt to reallocate invalid pointer %p\n", p); -@@ -1041,17 +1072,21 @@ - } - - #ifdef GC_ADD_CALLER --# define RA GC_RETURN_ADDR, -+# ifdef GC_RETURN_ADDR_PARENT -+# define RA GC_RETURN_ADDR_PARENT, -+# else -+# define RA GC_RETURN_ADDR, -+# endif - #else - # define RA - #endif - - void * GC_debug_malloc_replacement(size_t lb) - { -- return GC_debug_malloc(lb, RA "unknown", 0); -+ return GC_debug_malloc(lb, RA NULL, 0); - } - - void * GC_debug_realloc_replacement(void *p, size_t lb) - { -- return GC_debug_realloc(p, lb, RA "unknown", 0); -+ return GC_debug_realloc(p, lb, RA NULL, 0); - } diff -ruN boehm-gc-redirect.orig/files/patch-dyn_load.c boehm-gc-redirect/files/patch-dyn_load.c --- boehm-gc-redirect.orig/files/patch-dyn_load.c 2009-12-18 06:07:24.000000000 +0200 +++ boehm-gc-redirect/files/patch-dyn_load.c 1970-01-01 03:00:00.000000000 +0300 @@ -1,15 +0,0 @@ ---- dyn_load.c.orig Thu May 6 08:03:06 2004 -+++ dyn_load.c Sun Oct 31 01:53:01 2004 -@@ -97,6 +97,12 @@ - # else - # define ElfW(type) Elf64_##type - # endif -+# elif defined(__FreeBSD__) -+# if __ELF_WORD_SIZE == 32 -+# define ElfW(type) Elf32_##type -+# else -+# define ElfW(type) Elf64_##type -+# endif - # else - # if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32 - # define ElfW(type) Elf32_##type diff -ruN boehm-gc-redirect.orig/files/patch-include-gc.h boehm-gc-redirect/files/patch-include-gc.h --- boehm-gc-redirect.orig/files/patch-include-gc.h 2009-12-18 06:07:24.000000000 +0200 +++ boehm-gc-redirect/files/patch-include-gc.h 1970-01-01 03:00:00.000000000 +0300 @@ -1,10 +0,0 @@ ---- include/gc.h.orig Wed Jun 4 17:07:33 2003 -+++ include/gc.h Wed May 12 20:03:22 2004 -@@ -487,6 +487,7 @@ - /* gcc knows how to retrieve return address, but we don't know */ - /* how to generate call stacks. */ - # define GC_RETURN_ADDR (GC_word)__builtin_return_address(0) -+# define GC_RETURN_ADDR_PARENT (GC_word)__builtin_return_address(1) - # else - /* Just pass 0 for gcc compatibility. */ - # define GC_RETURN_ADDR 0 diff -ruN boehm-gc-redirect.orig/files/patch-include-private-gcconfig.h boehm-gc-redirect/files/patch-include-private-gcconfig.h --- boehm-gc-redirect.orig/files/patch-include-private-gcconfig.h 2009-12-18 06:07:24.000000000 +0200 +++ boehm-gc-redirect/files/patch-include-private-gcconfig.h 2013-02-10 14:43:52.000000000 +0200 @@ -1,42 +1,36 @@ ---- include/private/gcconfig.h.orig 2008-02-20 22:23:00.000000000 +0300 -+++ include/private/gcconfig.h 2009-10-20 01:08:38.000000000 +0400 -@@ -64,7 +64,7 @@ - /* Determine the machine type: */ - # if defined(__arm__) || defined(__thumb__) +--- include/private/gcconfig.h.orig 2012-07-25 15:03:15.000000000 +0300 ++++ include/private/gcconfig.h 2012-07-25 15:07:05.000000000 +0300 +@@ -73,7 +73,8 @@ + # if defined(__arm) || defined(__arm__) || defined(__thumb__) # define ARM32 --# if !defined(LINUX) && !defined(NETBSD) -+# if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) + # if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) \ +- && !defined(DARWIN) && !defined(_WIN32) && !defined(__CEGCC__) ++ && !defined(DARWIN) && !defined(_WIN32) && !defined(__CEGCC__) \ ++ && !defined(FREEBSD) # define NOSYS # define mach_type_known # endif -@@ -334,10 +334,26 @@ - # define X86_64 - # define mach_type_known +@@ -359,10 +360,18 @@ + # define I386 + # define mach_type_known # endif -+# if defined(__FreeBSD__) && defined(__amd64__) -+# define X86_64 -+# define mach_type_known -+# endif -+# if defined(__FreeBSD__) && defined(__ia64__) -+# define IA64 -+# define mach_type_known -+# endif - # if defined(FREEBSD) && defined(__sparc__) - # define SPARC - # define mach_type_known +-# if defined(FREEBSD) && defined(__x86_64__) ++# if defined(FREEBSD) && defined(__amd64__) + # define X86_64 + # define mach_type_known # endif -+# if defined(FREEBSD) && defined(__powerpc__) -+# define POWERPC -+# define mach_type_known ++# if defined(FREEBSD) && defined(__ia64__) ++# define IA64 ++# define mach_type_known +# endif +# if defined(FREEBSD) && defined(__arm__) -+# define ARM32 -+# define mach_type_known ++# define ARM32 ++# define mach_type_known +# endif - # if defined(bsdi) && (defined(i386) || defined(__i386__)) - # define I386 - # define BSDI -@@ -1771,6 +1787,16 @@ + # if defined(__NetBSD__) && (defined(i386) || defined(__i386__)) + # define I386 + # define mach_type_known +@@ -1949,6 +1958,16 @@ # define OS_TYPE "MSWINCE" # define DATAEND /* not needed */ # endif @@ -46,18 +40,10 @@ +# ifdef __ELF__ +# define DYNAMIC_LOADING +# endif -+# define HEURISTIC2 -+ extern char etext[]; -+# define SEARCH_FOR_DATA_START ++# define HEURISTIC2 ++ extern char etext[]; ++# define SEARCH_FOR_DATA_START +# endif - # ifdef NOSYS - /* __data_start is usually defined in the target linker script. */ - extern int __data_start[]; -@@ -1800,6 +1826,7 @@ - # define OS_TYPE "MSWINCE" - # define DATAEND /* not needed */ - # endif -+ - # ifdef LINUX - # define OS_TYPE "LINUX" - # define LINUX_STACKBOTTOM + # ifdef DARWIN + /* iPhone */ + # define OS_TYPE "DARWIN" diff -ruN boehm-gc-redirect.orig/files/patch-os_dep.c boehm-gc-redirect/files/patch-os_dep.c --- boehm-gc-redirect.orig/files/patch-os_dep.c 2010-04-01 11:45:10.000000000 +0300 +++ boehm-gc-redirect/files/patch-os_dep.c 2013-02-10 14:43:52.000000000 +0200 @@ -1,44 +1,28 @@ ---- os_dep.c.orig 2008-02-29 11:01:28.000000000 -0800 -+++ os_dep.c 2010-04-01 00:50:34.000000000 -0700 -@@ -816,7 +816,7 @@ - || defined(HURD) || defined(NETBSD) - static struct sigaction old_segv_act; - # if defined(_sigargs) /* !Irix6.x */ || defined(HPUX) \ -- || defined(HURD) || defined(NETBSD) -+ || defined(HURD) || defined(NETBSD) || defined(FREEBSD) - static struct sigaction old_bus_act; - # endif - # else -@@ -826,7 +826,7 @@ - void GC_set_and_save_fault_handler(handler h) +--- os_dep.c.orig 2012-07-25 15:08:26.000000000 +0300 ++++ os_dep.c 2012-07-25 15:16:54.000000000 +0300 +@@ -843,7 +843,7 @@ + GC_INNER void GC_set_and_save_fault_handler(GC_fault_handler_t h) { - # if defined(SUNOS5SIGS) || defined(IRIX5) \ -- || defined(OSF1) || defined(HURD) || defined(NETBSD) -+ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) - struct sigaction act; + # if defined(SUNOS5SIGS) || defined(IRIX5) \ +- || defined(OSF1) || defined(HURD) || defined(NETBSD) ++ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) + struct sigaction act; - act.sa_handler = h; -@@ -846,7 +846,7 @@ - # else - (void) sigaction(SIGSEGV, &act, &old_segv_act); - # if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \ -- || defined(HPUX) || defined(HURD) || defined(NETBSD) -+ || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) - /* Under Irix 5.x or HP/UX, we may get SIGBUS. */ - /* Pthreads doesn't exist under Irix 5.x, so we */ - /* don't have to worry in the threads case. */ -@@ -2713,7 +2713,13 @@ - # include - # if defined(FREEBSD) - # define SIG_OK TRUE --# define CODE_OK (code == BUS_PAGE_FAULT) + act.sa_handler = h; +@@ -3072,8 +3072,15 @@ + # ifndef SEGV_ACCERR + # define SEGV_ACCERR 2 + # endif +-# define CODE_OK (si -> si_code == BUS_PAGE_FAULT \ +# if defined(POWERPC) -+# define AIM /* Pretend that we're AIM. */ -+# include -+# define CODE_OK (code == EXC_DSI) ++# define AIM /* Pretend that we're AIM. */ ++# include ++# define CODE_OK (si -> si_code == EXC_DSI \ ++ || si -> si_code == SEGV_ACCERR) +# else -+# define CODE_OK (code == BUS_PAGE_FAULT) ++# define CODE_OK (si -> si_code == BUS_PAGE_FAULT \ + || si -> si_code == SEGV_ACCERR) +# endif # elif defined(OSF1) - # define SIG_OK (sig == SIGSEGV) - # define CODE_OK (code == 2 /* experimentally determined */) + # define CODE_OK (si -> si_code == 2 /* experimentally determined */) + # elif defined(IRIX5)