From umq.876@gmail.com  Thu Mar  7 05:37:44 2013
Return-Path: <umq.876@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id A2582969;
	Thu,  7 Mar 2013 05:37:44 +0000 (UTC)
	(envelope-from umq.876@gmail.com)
Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53])
	by mx1.freebsd.org (Postfix) with ESMTP id 60993FD4;
	Thu,  7 Mar 2013 05:37:44 +0000 (UTC)
Received: by mail-pb0-f53.google.com with SMTP id un1so91959pbc.26
        for <multiple recipients>; Wed, 06 Mar 2013 21:37:38 -0800 (PST)
Received: from nafbsd2.m.nd.to (p057007.dynamic.ppp.asahi-net.or.jp. [221.113.57.7])
        by mx.google.com with ESMTPS id vd4sm384230pbc.35.2013.03.06.21.37.34
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Wed, 06 Mar 2013 21:37:36 -0800 (PST)
Message-Id: <86haknwz23.wl%umq@ueo.co.jp>
Date: Thu, 07 Mar 2013 14:37:08 +0900
From: Hirohisa Yamaguchi <umq@ueo.co.jp>
Sender: Hirohisa Yamaguchi <umq.876@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org, araujo@freebsd.org
Cc: tkato432@yahoo.com, vmagerya@gmail.com, hirosho.oota+sp@firstclass.ddo.jp
Subject: [patch] devel/boehm-gc update to 7.2d combining previous PRs (1/2)
X-Send-Pr-Version: 3.113

>Number:         176716
>Category:       ports
>Synopsis:       [patch] devel/boehm-gc update to 7.2d combining previous PRs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bsam
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 07 05:40:01 UTC 2013
>Closed-Date:    Thu Oct 17 20:57:06 UTC 2013
>Last-Modified:  Thu Oct 17 20:57:06 UTC 2013
>Originator:     Hirohisa Yamaguchi
>Release:        FreeBSD 8.3-RELEASE-p3 amd64
>Organization:
<organization of PR author (multiple lines)>
>Environment:
System: FreeBSD **** 8.3-RELEASE-p3 FreeBSD 8.3-RELEASE-p3 #0: Tue Jun 12 00:39:29 UTC 2012 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64

>Description:
	There are two PRs updating devel/boehm-gc and its variants;
	ports/175590 and ports/176011.

	The former makes devel/boehm-gc as a master port and others as slaves,
	and delete redundant files.
	The latter has patches brushed up.

	I've combined those two sets of patch.


	There is another PR open for devel/boehm-gc, ports/175233.
	The test code on that report no longer build aginst the new version.
	I don't know whether the problem was fixed.


>How-To-Repeat:
	N/A
>Fix:

	The patch follows:

Index: devel/boehm-gc/Makefile
===================================================================
--- devel/boehm-gc/Makefile	(revision 313503)
+++ devel/boehm-gc/Makefile	(working copy)
@@ -1,54 +1,112 @@
-# New ports collection makefile for:	boehm-gc
-# Date created:		15 November 1996
-# Whom:			Mike McGaughey <mmcg@cs.monash.edu.au>
-#
+# Created by: Mike McGaughey <mmcg@cs.monash.edu.au>
 # $FreeBSD$
-#
 
-PORTNAME=	boehm-gc
-PORTVERSION=	7.1
-PORTREVISION=	0
+PORTNAME=	gc
+PORTVERSION=	7.2d
+PORTREVISION?=	0
 CATEGORIES=	devel
 MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
-DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
+PKGNAMEPREFIX=	boehm-
+.ifdef GC_VARIANT
+PKGNAMESUFFIX=	-${GC_VARIANT}
+.endif
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Garbage collection and memory leak detection for C and C++
 
+LICENSE=	MIT
+
 GNU_CONFIGURE=	yes
 USE_GNOME=	gnomehack
 USE_LDCONFIG=	yes
-CONFIGURE_ARGS=	--enable-cplusplus --disable-static --disable-threads
+CONFIGURE_ARGS=	--enable-cplusplus --disable-static
 MAKE_JOBS_UNSAFE=	yes
-OPTIONS_DEFINE=	DEBUG
 
-.include <bsd.port.pre.mk>
+WRKSRC=		${WRKDIR}/${DISTNAME:C/[a-z]$//}
 
+OPTIONS_DEFINE=		DEBUG PARALLEL_MARK
+DEBUG_DESC=		Additional debugging support (see documentation)
+PARALLEL_MARK_DESC=	Parallel-thread marking (faster for SMP)
+
+.ifdef GC_VARIANT
+INSTLIBS=		cord gc gccpp
+OPTIONS_EXCLUDE+=	DOCS
+PLIST=			${NONEXISTENT}
+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
+RUN_DEPENDS+=		${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
+SOVER=			1
+. if ${GC_VARIANT} == "redirect"
+CONFIGURE_ARGS+=	--disable-threads --enable-redirect-malloc
+. endif
+. if ${GC_VARIANT} == "threaded"
+CONFIGURE_ARGS+=	--enable-threads=posix --disable-redirect-malloc
+. endif
+.else
+CONFIGURE_ARGS+=	--disable-threads --disable-redirect-malloc
+MAN3=			gc.3
+PORTDOCS=		*
+.endif
+
+.include <bsd.port.options.mk>
+
 .if ${PORT_OPTIONS:MDEBUG}
 CONFIGURE_ARGS+=	--enable-gc-debug
 PKGNAMESUFFIX:=		${PKGNAMESUFFIX}+fulldebug
 .endif
 
-MAN3=		gc.3
+.if ! ${PORT_OPTIONS:MDOCS}
+CONFIGURE_ARGS+=	--datarootdir=${WRKDIR}/doc
+.endif
 
-.if ${ARCH} == "ia64"
-BROKEN=	Does not compile on ia64
+.if defined(GC_VARIANT) && ${GC_VARIANT} == "threaded"
+. if ${PORT_OPTIONS:MPARALLEL_MARK}
+CONFIGURE_ARGS+=	--enable-parallel-mark
+. endif
 .endif
 
+.include <bsd.port.pre.mk>
+
+NOT_FOR_ARCHS=	ia64
+
+.ifdef GC_VARIANT
 post-patch:
+	@${REINPLACE_CMD} -e \
+		's,libgc\.la,libgc-${GC_VARIANT}.la,g ; \
+		 s,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g ; \
+		 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}
+	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
+		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
+	${LN} -sf lib${LIB}-${GC_VARIANT}.so.${SOVER} \
+		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so
+.endfor
+	${INSTALL_DATA} ${WRKSRC}/bdw-gc.pc \
+		${PREFIX}/libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc
+
+.else # ! GC_VARIANT
+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
 
-#
+post-install:
+	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
+
+.endif
+
 # Get rid of .la and static library files
-#
 post-configure:
 	@${REINPLACE_CMD} -E -e \
 	'/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
 
-post-install:
-	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
-
-test: build
+regression-test: build
 	cd ${WRKSRC} && ${MAKE} check
 
 .include <bsd.port.post.mk>
Index: devel/boehm-gc/distinfo
===================================================================
--- devel/boehm-gc/distinfo	(revision 313503)
+++ devel/boehm-gc/distinfo	(working copy)
@@ -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
Index: devel/boehm-gc/files/patch-Makefile.in
===================================================================
--- devel/boehm-gc/files/patch-Makefile.in	(revision 313562)
+++ devel/boehm-gc/files/patch-Makefile.in	(working copy)
@@ -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 = .
Index: devel/boehm-gc/files/patch-ab
===================================================================
--- devel/boehm-gc/files/patch-ab	(revision 313562)
+++ devel/boehm-gc/files/patch-ab	(working copy)
@@ -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.)
Index: devel/boehm-gc/files/patch-configure
===================================================================
--- devel/boehm-gc/files/patch-configure	(revision 313503)
+++ devel/boehm-gc/files/patch-configure	(working copy)
@@ -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
+ 
Index: devel/boehm-gc/files/patch-dbg_mlc.c
===================================================================
--- devel/boehm-gc/files/patch-dbg_mlc.c	(revision 313562)
+++ devel/boehm-gc/files/patch-dbg_mlc.c	(working copy)
@@ -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 <dlfcn.h>
-+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);
- }
Index: devel/boehm-gc/files/patch-doc-gc.man
===================================================================
--- devel/boehm-gc/files/patch-doc-gc.man	(.../patch-ab)	(revision 313562)
+++ devel/boehm-gc/files/patch-doc-gc.man	(.../patch-doc-gc.man)	(working copy)
@@ -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.)
Index: devel/boehm-gc/files/patch-dyn_load.c
===================================================================
--- devel/boehm-gc/files/patch-dyn_load.c	(revision 313562)
+++ devel/boehm-gc/files/patch-dyn_load.c	(working copy)
@@ -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
Index: devel/boehm-gc/files/patch-include-gc.h
===================================================================
--- devel/boehm-gc/files/patch-include-gc.h	(revision 313562)
+++ devel/boehm-gc/files/patch-include-gc.h	(working copy)
@@ -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
Index: devel/boehm-gc/files/patch-include-private-gcconfig.h
===================================================================
--- devel/boehm-gc/files/patch-include-private-gcconfig.h	(revision 313503)
+++ devel/boehm-gc/files/patch-include-private-gcconfig.h	(working copy)
@@ -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"
Index: devel/boehm-gc/files/patch-os_dep.c
===================================================================
--- devel/boehm-gc/files/patch-os_dep.c	(revision 313503)
+++ devel/boehm-gc/files/patch-os_dep.c	(working copy)
@@ -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 <errno.h>
- #   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 <machine/trap.h>
-+#       define CODE_OK (code == EXC_DSI)
++#      define AIM      /* Pretend that we're AIM. */
++#      include <machine/trap.h>
++#       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)
Index: devel/boehm-gc/pkg-plist
===================================================================
--- devel/boehm-gc/pkg-plist	(revision 313503)
+++ devel/boehm-gc/pkg-plist	(working copy)
@@ -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
@@ -23,40 +24,4 @@
 lib/libgccpp.so
 lib/libgccpp.so.1
 libdata/pkgconfig/bdw-gc.pc
-share/doc/gc/README
-share/doc/gc/README.DGUX386
-share/doc/gc/README.Mac
-share/doc/gc/README.MacOSX
-share/doc/gc/README.OS2
-share/doc/gc/README.amiga
-share/doc/gc/README.arm.cross
-share/doc/gc/README.autoconf
-share/doc/gc/README.changes
-share/doc/gc/README.contributors
-share/doc/gc/README.cords
-share/doc/gc/README.darwin
-share/doc/gc/README.dj
-share/doc/gc/README.environment
-share/doc/gc/README.ews4800
-share/doc/gc/README.hp
-share/doc/gc/README.linux
-share/doc/gc/README.macros
-share/doc/gc/README.rs6000
-share/doc/gc/README.sgi
-share/doc/gc/README.solaris2
-share/doc/gc/README.uts
-share/doc/gc/README.win32
-share/doc/gc/README.win64
-share/doc/gc/barrett_diagram
-share/doc/gc/debugging.html
-share/doc/gc/gc.man
-share/doc/gc/gcdescr.html
-share/doc/gc/gcinterface.html
-share/doc/gc/leak.html
-share/doc/gc/overview.html
-share/doc/gc/porting.html
-share/doc/gc/scale.html
-share/doc/gc/simple_example.html
-share/doc/gc/tree.html
-@dirrm share/doc/gc
 @dirrm include/gc
Index: devel/boehm-gc-redirect/Makefile
===================================================================
--- devel/boehm-gc-redirect/Makefile	(revision 313503)
+++ devel/boehm-gc-redirect/Makefile	(working copy)
@@ -1,63 +1,15 @@
-# New ports collection makefile for:	boehm-gc-redirect
-# Date created:		12/17/2009
-# Whom:			stas
-#
+# Created by: stas
 # $FreeBSD$
-#
 
-PORTNAME=	boehm-gc
-PORTVERSION=	7.1
-CATEGORIES=	devel
-MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
-PKGNAMESUFFIX=	-${GC_VARIANT}
-DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
+PORTREVISION=	0
 
-MAINTAINER=	ports@FreeBSD.org
-COMMENT=	Garbage collection and memory leak detection for C and C++
+COMMENT=	Garbage collection and memory leak detection for C and C++ with malloc redirection
 
-RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
+LICENSE=	MIT
 
-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
+MASTERDIR=	${.CURDIR}/../boehm-gc
+DESCR=		${.CURDIR}/pkg-descr
+
 GC_VARIANT=	redirect
-SOVER=	1
 
-OPTIONS_DEFINE=	DEBUG
-
-PLIST_FILES=	${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so.${SOVER},g} \
-		${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g}
-
-.include <bsd.port.pre.mk>
-
-.if ${ARCH} == "ia64"
-BROKEN=	Does not compile on ia64
-.endif
-
-.if ${PORT_OPTIONS:MDEBUG}
-CONFIGURE_ARGS+=	--enable-gc-debug
-PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
-.endif
-
-post-patch:
-	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
-		-e 's,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g' \
-		-e 's,libcord\.la,libcord-${GC_VARIANT}.la,g' \
-		${WRKSRC}/Makefile.in
-
-do-install:
-.for LIB in ${INSTLIBS}
-	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
-	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
-	@(cd ${PREFIX}/lib && ${LN} -s lib${LIB}-${GC_VARIANT}.so.${SOVER} \
-	    lib${LIB}-${GC_VARIANT}.so)
-.endfor
-
-test: build
-	cd ${WRKSRC} && ${MAKE} check
-
-.include <bsd.port.post.mk>
+.include "${MASTERDIR}/Makefile"
Index: devel/boehm-gc-redirect/distinfo
===================================================================
--- devel/boehm-gc-redirect/distinfo	(revision 313562)
+++ devel/boehm-gc-redirect/distinfo	(working copy)
@@ -1,2 +0,0 @@
-SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
-SIZE (gc-7.1.tar.gz) = 1077714
Index: devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h
===================================================================
--- devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(revision 313562)
+++ devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(working copy)
@@ -1,63 +0,0 @@
---- 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__)
- #    define ARM32
--#    if !defined(LINUX) && !defined(NETBSD)
-+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
- #      define NOSYS
- #      define mach_type_known
- #    endif
-@@ -334,10 +334,26 @@
- #    define X86_64
- #    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
- # endif
-+# if defined(FREEBSD) && defined(__powerpc__)
-+#    define POWERPC
-+#    define mach_type_known
-+# endif
-+# if defined(FREEBSD) && defined(__arm__)
-+#    define ARM32
-+#    define mach_type_known
-+# endif
- # if defined(bsdi) && (defined(i386) || defined(__i386__))
- #    define I386
- #    define BSDI
-@@ -1771,6 +1787,16 @@
- #     define OS_TYPE "MSWINCE"
- #     define DATAEND /* not needed */
- #   endif
-+#   ifdef FREEBSD
-+#   define ALIGNMENT 4
-+#       define OS_TYPE "FREEBSD"
-+#       ifdef __ELF__
-+#           define DYNAMIC_LOADING
-+#       endif
-+#	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
Index: devel/boehm-gc-redirect/files/patch-include-gc.h
===================================================================
--- devel/boehm-gc-redirect/files/patch-include-gc.h	(revision 313562)
+++ devel/boehm-gc-redirect/files/patch-include-gc.h	(working copy)
@@ -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
Index: devel/boehm-gc-redirect/files/patch-configure
===================================================================
--- devel/boehm-gc-redirect/files/patch-configure	(revision 313562)
+++ devel/boehm-gc-redirect/files/patch-configure	(working copy)
@@ -1,12 +0,0 @@
---- 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"
-     ;;
-+ sparc64-*-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
Index: devel/boehm-gc-redirect/files/patch-dbg_mlc.c
===================================================================
--- devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(revision 313562)
+++ devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(working copy)
@@ -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 <dlfcn.h>
-+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);
- }
Index: devel/boehm-gc-redirect/files/patch-dyn_load.c
===================================================================
--- devel/boehm-gc-redirect/files/patch-dyn_load.c	(revision 313562)
+++ devel/boehm-gc-redirect/files/patch-dyn_load.c	(working copy)
@@ -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
Index: devel/boehm-gc-redirect/files/patch-os_dep.c
===================================================================
--- devel/boehm-gc-redirect/files/patch-os_dep.c	(revision 313562)
+++ devel/boehm-gc-redirect/files/patch-os_dep.c	(working copy)
>Release-Note:
>Audit-Trail:

From: Hirohisa Yamaguchi <umq@ueo.co.jp>
To: bug-followup@freebsd.org, araujo@freebsd.org
Cc:  
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining previous PRs (2/2)
Date: Thu, 07 Mar 2013 14:58:10 +0900

 - 	  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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-redirect/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-configure	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-redirect/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-redirect/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-redirect/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-os_dep.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-threaded/Makefile
 ===================================================================
 --- devel/boehm-gc-threaded/Makefile	(revision 313503)
 +++ devel/boehm-gc-threaded/Makefile	(working copy)
 @@ -1,73 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with threading support
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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}
 -MAKE_JOBS_UNSAFE=	yes
 -INSTLIBS=	cord gc gccpp
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	threaded
 -SOVER=	1
  
 -OPTIONS_DEFINE=	PARALLEL_MARK DEBUG
 -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 <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MPARALLEL_MARK}
 -CONFIGURE_ARGS+=	--enable-parallel-mark
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-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}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(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
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-threaded/distinfo
 ===================================================================
 --- devel/boehm-gc-threaded/distinfo	(revision 313562)
 +++ devel/boehm-gc-threaded/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-threaded/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-threaded/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-os_dep.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-threaded/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-configure	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-threaded/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-configure	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-threaded/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-threaded/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-threaded/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-os_dep.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 
 --Multipart_Thu_Mar__7_14:58:00_2013-1--

From: Hirohisa Yamaguchi <umq@ueo.co.jp>
To: bug-followup@freebsd.org, araujo@freebsd.org
Cc:  
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining previous PRs (1/2)
Date: Thu, 07 Mar 2013 14:58:00 +0900

 From: Hirohisa Yamaguchi <umq@ueo.co.jp>
 To: bug-followup@freebsd.org, araujo@freebsd.org
 Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining previous PRs
 User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9
  (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.2
  (amd64-portbld-freebsd8.3) MULE/6.0 (HANACHIRUSATO)
 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")
 Content-Type: multipart/mixed;
  boundary="Multipart_Thu_Mar__7_14:58:00_2013-1"
 
 --Multipart_Thu_Mar__7_14:58:00_2013-1
 Content-Type: text/plain; charset=US-ASCII
 
 Either of GNATS or my MUA went wrong, the patch looks splited.
 attaching the same patch again.
 
 
 Regards,
 -- 
 
 	Hirohisa Yamaguchi
 	  <umq@ueo.co.jp>
 
 --Multipart_Thu_Mar__7_14:58:00_2013-1
 Content-Type: application/octet-stream; type=patch
 Content-Disposition: attachment; filename="devel_boehm-gc_176716.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: devel/boehm-gc/Makefile
 ===================================================================
 --- devel/boehm-gc/Makefile	(revision 313503)
 +++ devel/boehm-gc/Makefile	(working copy)
 @@ -1,54 +1,112 @@
 -# New ports collection makefile for:	boehm-gc
 -# Date created:		15 November 1996
 -# Whom:			Mike McGaughey <mmcg@cs.monash.edu.au>
 -#
 +# Created by: Mike McGaughey <mmcg@cs.monash.edu.au>
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	0
 +PORTNAME=	gc
 +PORTVERSION=	7.2d
 +PORTREVISION?=	0
  CATEGORIES=	devel
  MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PKGNAMEPREFIX=	boehm-
 +.ifdef GC_VARIANT
 +PKGNAMESUFFIX=	-${GC_VARIANT}
 +.endif
  
  MAINTAINER=	ports@FreeBSD.org
  COMMENT=	Garbage collection and memory leak detection for C and C++
  
 +LICENSE=	MIT
 +
  GNU_CONFIGURE=	yes
  USE_GNOME=	gnomehack
  USE_LDCONFIG=	yes
 -CONFIGURE_ARGS=	--enable-cplusplus --disable-static --disable-threads
 +CONFIGURE_ARGS=	--enable-cplusplus --disable-static
  MAKE_JOBS_UNSAFE=	yes
 -OPTIONS_DEFINE=	DEBUG
  
 -.include <bsd.port.pre.mk>
 +WRKSRC=		${WRKDIR}/${DISTNAME:C/[a-z]$//}
  
 +OPTIONS_DEFINE=		DEBUG PARALLEL_MARK
 +DEBUG_DESC=		Additional debugging support (see documentation)
 +PARALLEL_MARK_DESC=	Parallel-thread marking (faster for SMP)
 +
 +.ifdef GC_VARIANT
 +INSTLIBS=		cord gc gccpp
 +OPTIONS_EXCLUDE+=	DOCS
 +PLIST=			${NONEXISTENT}
 +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
 +RUN_DEPENDS+=		${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +SOVER=			1
 +. if ${GC_VARIANT} == "redirect"
 +CONFIGURE_ARGS+=	--disable-threads --enable-redirect-malloc
 +. endif
 +. if ${GC_VARIANT} == "threaded"
 +CONFIGURE_ARGS+=	--enable-threads=posix --disable-redirect-malloc
 +. endif
 +.else
 +CONFIGURE_ARGS+=	--disable-threads --disable-redirect-malloc
 +MAN3=			gc.3
 +PORTDOCS=		*
 +.endif
 +
 +.include <bsd.port.options.mk>
 +
  .if ${PORT_OPTIONS:MDEBUG}
  CONFIGURE_ARGS+=	--enable-gc-debug
  PKGNAMESUFFIX:=		${PKGNAMESUFFIX}+fulldebug
  .endif
  
 -MAN3=		gc.3
 +.if ! ${PORT_OPTIONS:MDOCS}
 +CONFIGURE_ARGS+=	--datarootdir=${WRKDIR}/doc
 +.endif
  
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 +.if defined(GC_VARIANT) && ${GC_VARIANT} == "threaded"
 +. if ${PORT_OPTIONS:MPARALLEL_MARK}
 +CONFIGURE_ARGS+=	--enable-parallel-mark
 +. endif
  .endif
  
 +.include <bsd.port.pre.mk>
 +
 +NOT_FOR_ARCHS=	ia64
 +
 +.ifdef GC_VARIANT
  post-patch:
 +	@${REINPLACE_CMD} -e \
 +		's,libgc\.la,libgc-${GC_VARIANT}.la,g ; \
 +		 s,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g ; \
 +		 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}
 +	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 +	${LN} -sf lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so
 +.endfor
 +	${INSTALL_DATA} ${WRKSRC}/bdw-gc.pc \
 +		${PREFIX}/libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc
 +
 +.else # ! GC_VARIANT
 +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
  
 -#
 +post-install:
 +	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
 +
 +.endif
 +
  # Get rid of .la and static library files
 -#
  post-configure:
  	@${REINPLACE_CMD} -E -e \
  	'/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
  
 -post-install:
 -	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
 -
 -test: build
 +regression-test: build
  	cd ${WRKSRC} && ${MAKE} check
  
  .include <bsd.port.post.mk>
 Index: devel/boehm-gc/distinfo
 ===================================================================
 --- devel/boehm-gc/distinfo	(revision 313503)
 +++ devel/boehm-gc/distinfo	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-Makefile.in
 ===================================================================
 --- devel/boehm-gc/files/patch-Makefile.in	(revision 313562)
 +++ devel/boehm-gc/files/patch-Makefile.in	(working copy)
 @@ -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 = .
 Index: devel/boehm-gc/files/patch-ab
 ===================================================================
 --- devel/boehm-gc/files/patch-ab	(revision 313562)
 +++ devel/boehm-gc/files/patch-ab	(working copy)
 @@ -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.)
 Index: devel/boehm-gc/files/patch-configure
 ===================================================================
 --- devel/boehm-gc/files/patch-configure	(revision 313503)
 +++ devel/boehm-gc/files/patch-configure	(working copy)
 @@ -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
 + 
 Index: devel/boehm-gc/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc/files/patch-doc-gc.man
 ===================================================================
 --- devel/boehm-gc/files/patch-doc-gc.man	(.../patch-ab)	(revision 313562)
 +++ devel/boehm-gc/files/patch-doc-gc.man	(.../patch-doc-gc.man)	(working copy)
 @@ -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.)
 Index: devel/boehm-gc/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-private-gcconfig.h	(revision 313503)
 +++ devel/boehm-gc/files/patch-include-private-gcconfig.h	(working copy)
 @@ -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"
 Index: devel/boehm-gc/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc/files/patch-os_dep.c	(revision 313503)
 +++ devel/boehm-gc/files/patch-os_dep.c	(working copy)
 @@ -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 <errno.h>
 - #   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 <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 ++#      define AIM      /* Pretend that we're AIM. */
 ++#      include <machine/trap.h>
 ++#       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)
 Index: devel/boehm-gc/pkg-plist
 ===================================================================
 --- devel/boehm-gc/pkg-plist	(revision 313503)
 +++ devel/boehm-gc/pkg-plist	(working copy)
 @@ -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
 @@ -23,40 +24,4 @@
  lib/libgccpp.so
  lib/libgccpp.so.1
  libdata/pkgconfig/bdw-gc.pc
 -share/doc/gc/README
 -share/doc/gc/README.DGUX386
 -share/doc/gc/README.Mac
 -share/doc/gc/README.MacOSX
 -share/doc/gc/README.OS2
 -share/doc/gc/README.amiga
 -share/doc/gc/README.arm.cross
 -share/doc/gc/README.autoconf
 -share/doc/gc/README.changes
 -share/doc/gc/README.contributors
 -share/doc/gc/README.cords
 -share/doc/gc/README.darwin
 -share/doc/gc/README.dj
 -share/doc/gc/README.environment
 -share/doc/gc/README.ews4800
 -share/doc/gc/README.hp
 -share/doc/gc/README.linux
 -share/doc/gc/README.macros
 -share/doc/gc/README.rs6000
 -share/doc/gc/README.sgi
 -share/doc/gc/README.solaris2
 -share/doc/gc/README.uts
 -share/doc/gc/README.win32
 -share/doc/gc/README.win64
 -share/doc/gc/barrett_diagram
 -share/doc/gc/debugging.html
 -share/doc/gc/gc.man
 -share/doc/gc/gcdescr.html
 -share/doc/gc/gcinterface.html
 -share/doc/gc/leak.html
 -share/doc/gc/overview.html
 -share/doc/gc/porting.html
 -share/doc/gc/scale.html
 -share/doc/gc/simple_example.html
 -share/doc/gc/tree.html
 -@dirrm share/doc/gc
  @dirrm include/gc
 Index: devel/boehm-gc-redirect/Makefile
 ===================================================================
 --- devel/boehm-gc-redirect/Makefile	(revision 313503)
 +++ devel/boehm-gc-redirect/Makefile	(working copy)
 @@ -1,63 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with malloc redirection
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	redirect
 -SOVER=	1
  
 -OPTIONS_DEFINE=	DEBUG
 -
 -PLIST_FILES=	${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so.${SOVER},g} \
 -		${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g}
 -
 -.include <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-e 's,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g' \
 -		-e 's,libcord\.la,libcord-${GC_VARIANT}.la,g' \
 -		${WRKSRC}/Makefile.in
 -
 -do-install:
 -.for LIB in ${INSTLIBS}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(cd ${PREFIX}/lib && ${LN} -s lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    lib${LIB}-${GC_VARIANT}.so)
 -.endfor
 -
 -test: build
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-redirect/distinfo
 ===================================================================
 --- devel/boehm-gc-redirect/distinfo	(revision 313562)
 +++ devel/boehm-gc-redirect/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-redirect/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-configure	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-redirect/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-redirect/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-os_dep.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	if defined(SUNOS5SIGS) || defined(IRIX5)  \
 --        || defined(OSF1) || defined(HURD) || defined(NETBSD)
 -+        || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
 - 	  struct sigaction	act;
 - 

From: Hirohisa Yamaguchi <umq@ueo.co.jp>
To: bug-followup@freebsd.org, araujo@freebsd.org
Cc:  
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining previous PRs
Date: Thu, 07 Mar 2013 15:12:35 +0900

 --Multipart_Thu_Mar__7_15:12:35_2013-1
 Content-Type: text/plain; charset=US-ASCII
 
 Give another try.
 
 --
 
 	Hirohisa Yamaguch
 	  <umq@ueo.co.jp>
 
 --Multipart_Thu_Mar__7_15:12:35_2013-1
 Content-Type: application/octet-stream; type=patch
 Content-Disposition: attachment; filename="devel_boehm-gc_176716.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: devel/boehm-gc/Makefile
 ===================================================================
 --- devel/boehm-gc/Makefile	(revision 313503)
 +++ devel/boehm-gc/Makefile	(working copy)
 @@ -1,54 +1,112 @@
 -# New ports collection makefile for:	boehm-gc
 -# Date created:		15 November 1996
 -# Whom:			Mike McGaughey <mmcg@cs.monash.edu.au>
 -#
 +# Created by: Mike McGaughey <mmcg@cs.monash.edu.au>
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	0
 +PORTNAME=	gc
 +PORTVERSION=	7.2d
 +PORTREVISION?=	0
  CATEGORIES=	devel
  MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PKGNAMEPREFIX=	boehm-
 +.ifdef GC_VARIANT
 +PKGNAMESUFFIX=	-${GC_VARIANT}
 +.endif
  
  MAINTAINER=	ports@FreeBSD.org
  COMMENT=	Garbage collection and memory leak detection for C and C++
  
 +LICENSE=	MIT
 +
  GNU_CONFIGURE=	yes
  USE_GNOME=	gnomehack
  USE_LDCONFIG=	yes
 -CONFIGURE_ARGS=	--enable-cplusplus --disable-static --disable-threads
 +CONFIGURE_ARGS=	--enable-cplusplus --disable-static
  MAKE_JOBS_UNSAFE=	yes
 -OPTIONS_DEFINE=	DEBUG
  
 -.include <bsd.port.pre.mk>
 +WRKSRC=		${WRKDIR}/${DISTNAME:C/[a-z]$//}
  
 +OPTIONS_DEFINE=		DEBUG PARALLEL_MARK
 +DEBUG_DESC=		Additional debugging support (see documentation)
 +PARALLEL_MARK_DESC=	Parallel-thread marking (faster for SMP)
 +
 +.ifdef GC_VARIANT
 +INSTLIBS=		cord gc gccpp
 +OPTIONS_EXCLUDE+=	DOCS
 +PLIST=			${NONEXISTENT}
 +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
 +RUN_DEPENDS+=		${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +SOVER=			1
 +. if ${GC_VARIANT} == "redirect"
 +CONFIGURE_ARGS+=	--disable-threads --enable-redirect-malloc
 +. endif
 +. if ${GC_VARIANT} == "threaded"
 +CONFIGURE_ARGS+=	--enable-threads=posix --disable-redirect-malloc
 +. endif
 +.else
 +CONFIGURE_ARGS+=	--disable-threads --disable-redirect-malloc
 +MAN3=			gc.3
 +PORTDOCS=		*
 +.endif
 +
 +.include <bsd.port.options.mk>
 +
  .if ${PORT_OPTIONS:MDEBUG}
  CONFIGURE_ARGS+=	--enable-gc-debug
  PKGNAMESUFFIX:=		${PKGNAMESUFFIX}+fulldebug
  .endif
  
 -MAN3=		gc.3
 +.if ! ${PORT_OPTIONS:MDOCS}
 +CONFIGURE_ARGS+=	--datarootdir=${WRKDIR}/doc
 +.endif
  
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 +.if defined(GC_VARIANT) && ${GC_VARIANT} == "threaded"
 +. if ${PORT_OPTIONS:MPARALLEL_MARK}
 +CONFIGURE_ARGS+=	--enable-parallel-mark
 +. endif
  .endif
  
 +.include <bsd.port.pre.mk>
 +
 +NOT_FOR_ARCHS=	ia64
 +
 +.ifdef GC_VARIANT
  post-patch:
 +	@${REINPLACE_CMD} -e \
 +		's,libgc\.la,libgc-${GC_VARIANT}.la,g ; \
 +		 s,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g ; \
 +		 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}
 +	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 +	${LN} -sf lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so
 +.endfor
 +	${INSTALL_DATA} ${WRKSRC}/bdw-gc.pc \
 +		${PREFIX}/libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc
 +
 +.else # ! GC_VARIANT
 +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
  
 -#
 +post-install:
 +	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
 +
 +.endif
 +
  # Get rid of .la and static library files
 -#
  post-configure:
  	@${REINPLACE_CMD} -E -e \
  	'/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
  
 -post-install:
 -	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
 -
 -test: build
 +regression-test: build
  	cd ${WRKSRC} && ${MAKE} check
  
  .include <bsd.port.post.mk>
 Index: devel/boehm-gc/distinfo
 ===================================================================
 --- devel/boehm-gc/distinfo	(revision 313503)
 +++ devel/boehm-gc/distinfo	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-Makefile.in
 ===================================================================
 --- devel/boehm-gc/files/patch-Makefile.in	(revision 313562)
 +++ devel/boehm-gc/files/patch-Makefile.in	(working copy)
 @@ -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 = .
 Index: devel/boehm-gc/files/patch-ab
 ===================================================================
 --- devel/boehm-gc/files/patch-ab	(revision 313562)
 +++ devel/boehm-gc/files/patch-ab	(working copy)
 @@ -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.)
 Index: devel/boehm-gc/files/patch-configure
 ===================================================================
 --- devel/boehm-gc/files/patch-configure	(revision 313503)
 +++ devel/boehm-gc/files/patch-configure	(working copy)
 @@ -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
 + 
 Index: devel/boehm-gc/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc/files/patch-doc-gc.man
 ===================================================================
 --- devel/boehm-gc/files/patch-doc-gc.man	(.../patch-ab)	(revision 313562)
 +++ devel/boehm-gc/files/patch-doc-gc.man	(.../patch-doc-gc.man)	(working copy)
 @@ -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.)
 Index: devel/boehm-gc/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-private-gcconfig.h	(revision 313503)
 +++ devel/boehm-gc/files/patch-include-private-gcconfig.h	(working copy)
 @@ -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"
 Index: devel/boehm-gc/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc/files/patch-os_dep.c	(revision 313503)
 +++ devel/boehm-gc/files/patch-os_dep.c	(working copy)
 @@ -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 <errno.h>
 - #   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 <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 ++#      define AIM      /* Pretend that we're AIM. */
 ++#      include <machine/trap.h>
 ++#       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)
 Index: devel/boehm-gc/pkg-plist
 ===================================================================
 --- devel/boehm-gc/pkg-plist	(revision 313503)
 +++ devel/boehm-gc/pkg-plist	(working copy)
 @@ -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
 @@ -23,40 +24,4 @@
  lib/libgccpp.so
  lib/libgccpp.so.1
  libdata/pkgconfig/bdw-gc.pc
 -share/doc/gc/README
 -share/doc/gc/README.DGUX386
 -share/doc/gc/README.Mac
 -share/doc/gc/README.MacOSX
 -share/doc/gc/README.OS2
 -share/doc/gc/README.amiga
 -share/doc/gc/README.arm.cross
 -share/doc/gc/README.autoconf
 -share/doc/gc/README.changes
 -share/doc/gc/README.contributors
 -share/doc/gc/README.cords
 -share/doc/gc/README.darwin
 -share/doc/gc/README.dj
 -share/doc/gc/README.environment
 -share/doc/gc/README.ews4800
 -share/doc/gc/README.hp
 -share/doc/gc/README.linux
 -share/doc/gc/README.macros
 -share/doc/gc/README.rs6000
 -share/doc/gc/README.sgi
 -share/doc/gc/README.solaris2
 -share/doc/gc/README.uts
 -share/doc/gc/README.win32
 -share/doc/gc/README.win64
 -share/doc/gc/barrett_diagram
 -share/doc/gc/debugging.html
 -share/doc/gc/gc.man
 -share/doc/gc/gcdescr.html
 -share/doc/gc/gcinterface.html
 -share/doc/gc/leak.html
 -share/doc/gc/overview.html
 -share/doc/gc/porting.html
 -share/doc/gc/scale.html
 -share/doc/gc/simple_example.html
 -share/doc/gc/tree.html
 -@dirrm share/doc/gc
  @dirrm include/gc
 Index: devel/boehm-gc-redirect/Makefile
 ===================================================================
 --- devel/boehm-gc-redirect/Makefile	(revision 313503)
 +++ devel/boehm-gc-redirect/Makefile	(working copy)
 @@ -1,63 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with malloc redirection
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	redirect
 -SOVER=	1
  
 -OPTIONS_DEFINE=	DEBUG
 -
 -PLIST_FILES=	${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so.${SOVER},g} \
 -		${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g}
 -
 -.include <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-e 's,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g' \
 -		-e 's,libcord\.la,libcord-${GC_VARIANT}.la,g' \
 -		${WRKSRC}/Makefile.in
 -
 -do-install:
 -.for LIB in ${INSTLIBS}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(cd ${PREFIX}/lib && ${LN} -s lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    lib${LIB}-${GC_VARIANT}.so)
 -.endfor
 -
 -test: build
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-redirect/distinfo
 ===================================================================
 --- devel/boehm-gc-redirect/distinfo	(revision 313562)
 +++ devel/boehm-gc-redirect/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-redirect/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-configure	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-redirect/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-redirect/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-os_dep.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-redirect/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-configure	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-redirect/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-redirect/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-redirect/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-os_dep.c	(revision 313562)
 +++ devel/boehm-gc-redirect/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-threaded/Makefile
 ===================================================================
 --- devel/boehm-gc-threaded/Makefile	(revision 313503)
 +++ devel/boehm-gc-threaded/Makefile	(working copy)
 @@ -1,73 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with threading support
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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}
 -MAKE_JOBS_UNSAFE=	yes
 -INSTLIBS=	cord gc gccpp
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	threaded
 -SOVER=	1
  
 -OPTIONS_DEFINE=	PARALLEL_MARK DEBUG
 -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 <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MPARALLEL_MARK}
 -CONFIGURE_ARGS+=	--enable-parallel-mark
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-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}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(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
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-threaded/distinfo
 ===================================================================
 --- devel/boehm-gc-threaded/distinfo	(revision 313562)
 +++ devel/boehm-gc-threaded/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-threaded/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-threaded/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-os_dep.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-threaded/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-configure	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-threaded/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-configure	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-threaded/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-threaded/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dyn_load.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-gc.h	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-threaded/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-os_dep.c	(revision 313562)
 +++ devel/boehm-gc-threaded/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 
 --Multipart_Thu_Mar__7_15:12:35_2013-1--

From: Vitaly Magerya <vmagerya@gmail.com>
To: bug-followup@FreeBSD.org, umq@ueo.co.jp
Cc:  
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining
 previous PRs
Date: Thu, 07 Mar 2013 17:47:48 +0200

 The last patch seems broken: there are multiple diffs for the same files
 (e.g. boehm-gc-redirect/files/patch-configure), and one diff against a
 non-existent file (boehm-gc/files/patch-doc-gc.man).

From: Hirohisa Yamaguchi <umq@ueo.co.jp>
To: bug-followup@FreeBSD.org, vmagerya@gmail.com
Cc: araujo@freebsd.org
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining previous PRs
Date: Fri, 08 Mar 2013 14:09:53 +0900

 --Multipart_Fri_Mar__8_14:09:53_2013-1
 Content-Type: text/plain; charset=US-ASCII
 
 
 Vitaly Magerya <vmagerya@gmail.com> wrote:
 > The last patch seems broken: there are multiple diffs for the same files
 > (e.g. boehm-gc-redirect/files/patch-configure), and one diff against a
 > non-existent file (boehm-gc/files/patch-doc-gc.man).
 
 I made a mistake when I tried to reorder svn diff output.
 I intended to rename boehm-gc/files/patch-ab to
 boehm-gc/files/patch-doc-gc.man, this didn't work, too.
 
 Here I attach a fixed patch.
 
 
 Regards,
 -- 
 
 	Hirohisa Yamaguchi
 	  <umq@ueo.co.jp>
 
 --Multipart_Fri_Mar__8_14:09:53_2013-1
 Content-Type: application/octet-stream; type=patch
 Content-Disposition: attachment; filename="devel_boehm-gc_176716_0.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: devel/boehm-gc/Makefile
 ===================================================================
 --- devel/boehm-gc/Makefile	(revision 313614)
 +++ devel/boehm-gc/Makefile	(working copy)
 @@ -1,54 +1,112 @@
 -# New ports collection makefile for:	boehm-gc
 -# Date created:		15 November 1996
 -# Whom:			Mike McGaughey <mmcg@cs.monash.edu.au>
 -#
 +# Created by: Mike McGaughey <mmcg@cs.monash.edu.au>
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	0
 +PORTNAME=	gc
 +PORTVERSION=	7.2d
 +PORTREVISION?=	0
  CATEGORIES=	devel
  MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PKGNAMEPREFIX=	boehm-
 +.ifdef GC_VARIANT
 +PKGNAMESUFFIX=	-${GC_VARIANT}
 +.endif
  
  MAINTAINER=	ports@FreeBSD.org
  COMMENT=	Garbage collection and memory leak detection for C and C++
  
 +LICENSE=	MIT
 +
  GNU_CONFIGURE=	yes
  USE_GNOME=	gnomehack
  USE_LDCONFIG=	yes
 -CONFIGURE_ARGS=	--enable-cplusplus --disable-static --disable-threads
 +CONFIGURE_ARGS=	--enable-cplusplus --disable-static
  MAKE_JOBS_UNSAFE=	yes
 -OPTIONS_DEFINE=	DEBUG
  
 -.include <bsd.port.pre.mk>
 +WRKSRC=		${WRKDIR}/${DISTNAME:C/[a-z]$//}
  
 +OPTIONS_DEFINE=		DEBUG PARALLEL_MARK
 +DEBUG_DESC=		Additional debugging support (see documentation)
 +PARALLEL_MARK_DESC=	Parallel-thread marking (faster for SMP)
 +
 +.ifdef GC_VARIANT
 +INSTLIBS=		cord gc gccpp
 +OPTIONS_EXCLUDE+=	DOCS
 +PLIST=			${NONEXISTENT}
 +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
 +RUN_DEPENDS+=		${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +SOVER=			1
 +. if ${GC_VARIANT} == "redirect"
 +CONFIGURE_ARGS+=	--disable-threads --enable-redirect-malloc
 +. endif
 +. if ${GC_VARIANT} == "threaded"
 +CONFIGURE_ARGS+=	--enable-threads=posix --disable-redirect-malloc
 +. endif
 +.else
 +CONFIGURE_ARGS+=	--disable-threads --disable-redirect-malloc
 +MAN3=			gc.3
 +PORTDOCS=		*
 +.endif
 +
 +.include <bsd.port.options.mk>
 +
  .if ${PORT_OPTIONS:MDEBUG}
  CONFIGURE_ARGS+=	--enable-gc-debug
  PKGNAMESUFFIX:=		${PKGNAMESUFFIX}+fulldebug
  .endif
  
 -MAN3=		gc.3
 +.if ! ${PORT_OPTIONS:MDOCS}
 +CONFIGURE_ARGS+=	--datarootdir=${WRKDIR}/doc
 +.endif
  
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 +.if defined(GC_VARIANT) && ${GC_VARIANT} == "threaded"
 +. if ${PORT_OPTIONS:MPARALLEL_MARK}
 +CONFIGURE_ARGS+=	--enable-parallel-mark
 +. endif
  .endif
  
 +.include <bsd.port.pre.mk>
 +
 +NOT_FOR_ARCHS=	ia64
 +
 +.ifdef GC_VARIANT
  post-patch:
 +	@${REINPLACE_CMD} -e \
 +		's,libgc\.la,libgc-${GC_VARIANT}.la,g ; \
 +		 s,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g ; \
 +		 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}
 +	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 +	${LN} -sf lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so
 +.endfor
 +	${INSTALL_DATA} ${WRKSRC}/bdw-gc.pc \
 +		${PREFIX}/libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc
 +
 +.else # ! GC_VARIANT
 +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
  
 -#
 +post-install:
 +	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
 +
 +.endif
 +
  # Get rid of .la and static library files
 -#
  post-configure:
  	@${REINPLACE_CMD} -E -e \
  	'/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
  
 -post-install:
 -	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
 -
 -test: build
 +regression-test: build
  	cd ${WRKSRC} && ${MAKE} check
  
  .include <bsd.port.post.mk>
 Index: devel/boehm-gc/distinfo
 ===================================================================
 --- devel/boehm-gc/distinfo	(revision 313614)
 +++ devel/boehm-gc/distinfo	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-Makefile.in
 ===================================================================
 --- devel/boehm-gc/files/patch-Makefile.in	(revision 313614)
 +++ devel/boehm-gc/files/patch-Makefile.in	(working copy)
 @@ -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 = .
 Index: devel/boehm-gc/files/patch-ab
 ===================================================================
 --- devel/boehm-gc/files/patch-ab	(revision 313614)
 +++ devel/boehm-gc/files/patch-ab	(working copy)
 @@ -1,7 +1,7 @@
 ---- 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(...) ...
 +--- 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
 @@ -9,11 +9,10 @@
   .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.
 +@@ -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
 + .LP
  +.SH "PORT INFORMATION"
  +.LP
  +In this (FreeBSD package) installation,
 @@ -55,6 +54,7 @@
  +extension of
  +.I g++.
  +This may or may not make a difference.
 - .LP
 ++.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
 Index: devel/boehm-gc/files/patch-configure
 ===================================================================
 --- devel/boehm-gc/files/patch-configure	(revision 313614)
 +++ devel/boehm-gc/files/patch-configure	(working copy)
 @@ -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
 + 
 Index: devel/boehm-gc/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dbg_mlc.c	(revision 313614)
 +++ devel/boehm-gc/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dyn_load.c	(revision 313614)
 +++ devel/boehm-gc/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-gc.h	(revision 313614)
 +++ devel/boehm-gc/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-private-gcconfig.h	(revision 313614)
 +++ devel/boehm-gc/files/patch-include-private-gcconfig.h	(working copy)
 @@ -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"
 Index: devel/boehm-gc/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc/files/patch-os_dep.c	(revision 313614)
 +++ devel/boehm-gc/files/patch-os_dep.c	(working copy)
 @@ -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 <errno.h>
 - #   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 <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 ++#      define AIM      /* Pretend that we're AIM. */
 ++#      include <machine/trap.h>
 ++#       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)
 Index: devel/boehm-gc/pkg-plist
 ===================================================================
 --- devel/boehm-gc/pkg-plist	(revision 313614)
 +++ devel/boehm-gc/pkg-plist	(working copy)
 @@ -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
 @@ -23,40 +24,4 @@
  lib/libgccpp.so
  lib/libgccpp.so.1
  libdata/pkgconfig/bdw-gc.pc
 -share/doc/gc/README
 -share/doc/gc/README.DGUX386
 -share/doc/gc/README.Mac
 -share/doc/gc/README.MacOSX
 -share/doc/gc/README.OS2
 -share/doc/gc/README.amiga
 -share/doc/gc/README.arm.cross
 -share/doc/gc/README.autoconf
 -share/doc/gc/README.changes
 -share/doc/gc/README.contributors
 -share/doc/gc/README.cords
 -share/doc/gc/README.darwin
 -share/doc/gc/README.dj
 -share/doc/gc/README.environment
 -share/doc/gc/README.ews4800
 -share/doc/gc/README.hp
 -share/doc/gc/README.linux
 -share/doc/gc/README.macros
 -share/doc/gc/README.rs6000
 -share/doc/gc/README.sgi
 -share/doc/gc/README.solaris2
 -share/doc/gc/README.uts
 -share/doc/gc/README.win32
 -share/doc/gc/README.win64
 -share/doc/gc/barrett_diagram
 -share/doc/gc/debugging.html
 -share/doc/gc/gc.man
 -share/doc/gc/gcdescr.html
 -share/doc/gc/gcinterface.html
 -share/doc/gc/leak.html
 -share/doc/gc/overview.html
 -share/doc/gc/porting.html
 -share/doc/gc/scale.html
 -share/doc/gc/simple_example.html
 -share/doc/gc/tree.html
 -@dirrm share/doc/gc
  @dirrm include/gc
 Index: devel/boehm-gc-redirect/Makefile
 ===================================================================
 --- devel/boehm-gc-redirect/Makefile	(revision 313614)
 +++ devel/boehm-gc-redirect/Makefile	(working copy)
 @@ -1,63 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with malloc redirection
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	redirect
 -SOVER=	1
  
 -OPTIONS_DEFINE=	DEBUG
 -
 -PLIST_FILES=	${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so.${SOVER},g} \
 -		${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g}
 -
 -.include <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-e 's,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g' \
 -		-e 's,libcord\.la,libcord-${GC_VARIANT}.la,g' \
 -		${WRKSRC}/Makefile.in
 -
 -do-install:
 -.for LIB in ${INSTLIBS}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(cd ${PREFIX}/lib && ${LN} -s lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    lib${LIB}-${GC_VARIANT}.so)
 -.endfor
 -
 -test: build
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-redirect/distinfo
 ===================================================================
 --- devel/boehm-gc-redirect/distinfo	(revision 313614)
 +++ devel/boehm-gc-redirect/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-redirect/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-configure	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-redirect/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-redirect/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dyn_load.c	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-gc.h	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-redirect/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-os_dep.c	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-threaded/Makefile
 ===================================================================
 --- devel/boehm-gc-threaded/Makefile	(revision 313614)
 +++ devel/boehm-gc-threaded/Makefile	(working copy)
 @@ -1,73 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with threading support
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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}
 -MAKE_JOBS_UNSAFE=	yes
 -INSTLIBS=	cord gc gccpp
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	threaded
 -SOVER=	1
  
 -OPTIONS_DEFINE=	PARALLEL_MARK DEBUG
 -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 <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MPARALLEL_MARK}
 -CONFIGURE_ARGS+=	--enable-parallel-mark
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-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}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(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
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-threaded/distinfo
 ===================================================================
 --- devel/boehm-gc-threaded/distinfo	(revision 313614)
 +++ devel/boehm-gc-threaded/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-threaded/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-configure	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-threaded/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-threaded/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dyn_load.c	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-gc.h	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-threaded/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-os_dep.c	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 
 --Multipart_Fri_Mar__8_14:09:53_2013-1--

From: Vitaly Magerya <vmagerya@gmail.com>
To: Hirohisa Yamaguchi <umq@ueo.co.jp>
Cc: bug-followup@freebsd.org
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining
 previous PRs
Date: Fri, 8 Mar 2013 12:52:33 +0200

 OK, as the submitter of ports/176011 I endorse this patch instead
 of the one in ports/176011, with a few exceptions:
 
 1. Only the -threaded variant should have the PARALLEL_MARK
 option (it doesn't work for others).
 
 2. DOCS option should be defined for devel/boehm-gc (it is
 currently excluded for others but not defined for this one).
 
 3. The part that sets LICENSE to MIT is wrong; see README.QUICK
 or doc/README files: the license is similar to MIT, but not quite
 it (and some files appear to be under different licenses).

From: Hirohisa Yamaguchi <umq@ueo.co.jp>
To: Vitaly Magerya <vmagerya@gmail.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining previous PRs
Date: Fri, 08 Mar 2013 21:36:42 +0900

 --Multipart_Fri_Mar__8_21:36:42_2013-1
 Content-Type: text/plain; charset=US-ASCII
 
 Vitaly Magerya <vmagerya@gmail.com> wrote:
 > OK, as the submitter of ports/176011 I endorse this patch instead
 > of the one in ports/176011, with a few exceptions:
 
 Thanks
 
 > 1. Only the -threaded variant should have the PARALLEL_MARK
 > option (it doesn't work for others).
 
 I know configure script does not run when both --enable-parallel-mark and
 --disable-threads are passed.
 I've added PARALLEL_MARK to share the same OPTIONSFILE among three ports.
 
 I agree that showing effective option only is better(patch updated).
 
 
 > 2. DOCS option should be defined for devel/boehm-gc (it is
 > currently excluded for others but not defined for this one).
 
 DOCS is one of pre-defined global options.
 We do not need to have it in OPTIONS_DEFINE each port.
 When NOPORTDOCS is not defined, DOCS will be defined.
  #  see ports/Mk/bsd.options.mk
 
 
 > 3. The part that sets LICENSE to MIT is wrong; see README.QUICK
 > or doc/README files: the license is similar to MIT, but not quite
 > it (and some files appear to be under different licenses).
 
 I thought boehm-gc is X11-like license (wikipedia said so).
 Both MIT and X11 licenses are tagged as ``MIT'' in
 ports/Mk/bsd.license.db.mk.
 So, I marked it as ``MIT''.
 
 yes, libatomic_ops is GPLv2'ed.
 I've updated the patch, which is attached.
 
 
 Regards,
 -- 
 
 	Hirohisa Yamaguchi
 	  <umq@ueo.co.jp>
 
 --Multipart_Fri_Mar__8_21:36:42_2013-1
 Content-Type: application/octet-stream; type=patch
 Content-Disposition: attachment; filename="devel_boehm-gc-176716_1.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: devel/boehm-gc/Makefile
 ===================================================================
 --- devel/boehm-gc/Makefile	(revision 313614)
 +++ devel/boehm-gc/Makefile	(working copy)
 @@ -1,54 +1,115 @@
 -# New ports collection makefile for:	boehm-gc
 -# Date created:		15 November 1996
 -# Whom:			Mike McGaughey <mmcg@cs.monash.edu.au>
 -#
 +# Created by: Mike McGaughey <mmcg@cs.monash.edu.au>
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	0
 +PORTNAME=	gc
 +PORTVERSION=	7.2d
 +PORTREVISION?=	0
  CATEGORIES=	devel
  MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PKGNAMEPREFIX=	boehm-
 +.ifdef GC_VARIANT
 +PKGNAMESUFFIX=	-${GC_VARIANT}
 +.endif
  
  MAINTAINER=	ports@FreeBSD.org
  COMMENT=	Garbage collection and memory leak detection for C and C++
  
 +LICENSE=	MIT GPLv2
 +LICENSE_COMB=	multi
 +
  GNU_CONFIGURE=	yes
  USE_GNOME=	gnomehack
  USE_LDCONFIG=	yes
 -CONFIGURE_ARGS=	--enable-cplusplus --disable-static --disable-threads
 +CONFIGURE_ARGS=	--enable-cplusplus --disable-static
  MAKE_JOBS_UNSAFE=	yes
 -OPTIONS_DEFINE=	DEBUG
  
 -.include <bsd.port.pre.mk>
 +WRKSRC=		${WRKDIR}/${DISTNAME:C/[a-z]$//}
  
 +OPTIONS_DEFINE=		DEBUG
 +DEBUG_DESC=		Additional debugging support (see documentation)
 +
 +.ifdef GC_VARIANT
 +INSTLIBS=		cord gc gccpp
 +OPTIONS_EXCLUDE+=	DOCS
 +PLIST=			${NONEXISTENT}
 +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
 +RUN_DEPENDS+=		${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +SOVER=			1
 +. if ${GC_VARIANT} == "redirect"
 +CONFIGURE_ARGS+=	--disable-threads --enable-redirect-malloc
 +. endif
 +. if ${GC_VARIANT} == "threaded"
 +CONFIGURE_ARGS+=	--enable-threads=posix --disable-redirect-malloc
 +OPTIONS_DEFINE+=	PARALLEL_MARK
 +PARALLEL_MARK_DESC=	Parallel-thread marking (faster for SMP)
 +UNIQUENAME=		${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
 +. endif
 +.else
 +CONFIGURE_ARGS+=	--disable-threads --disable-redirect-malloc
 +MAN3=			gc.3
 +PORTDOCS=		*
 +.endif
 +
 +.include <bsd.port.options.mk>
 +
  .if ${PORT_OPTIONS:MDEBUG}
  CONFIGURE_ARGS+=	--enable-gc-debug
  PKGNAMESUFFIX:=		${PKGNAMESUFFIX}+fulldebug
  .endif
  
 -MAN3=		gc.3
 +.if ! ${PORT_OPTIONS:MDOCS}
 +CONFIGURE_ARGS+=	--datarootdir=${WRKDIR}/doc
 +.endif
  
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 +.if defined(GC_VARIANT) && ${GC_VARIANT} == "threaded"
 +. if ${PORT_OPTIONS:MPARALLEL_MARK}
 +CONFIGURE_ARGS+=	--enable-parallel-mark
 +. endif
  .endif
  
 +.include <bsd.port.pre.mk>
 +
 +NOT_FOR_ARCHS=	ia64
 +
 +.ifdef GC_VARIANT
  post-patch:
 +	@${REINPLACE_CMD} -e \
 +		's,libgc\.la,libgc-${GC_VARIANT}.la,g ; \
 +		 s,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g ; \
 +		 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}
 +	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 +	${LN} -sf lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so
 +.endfor
 +	${INSTALL_DATA} ${WRKSRC}/bdw-gc.pc \
 +		${PREFIX}/libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc
 +
 +.else # ! GC_VARIANT
 +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
  
 -#
 +post-install:
 +	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${MAN3PREFIX}/man/man3/gc.3
 +
 +.endif
 +
  # Get rid of .la and static library files
 -#
  post-configure:
  	@${REINPLACE_CMD} -E -e \
  	'/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
  
 -post-install:
 -	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
 -
 -test: build
 +regression-test: build
  	cd ${WRKSRC} && ${MAKE} check
  
  .include <bsd.port.post.mk>
 Index: devel/boehm-gc/distinfo
 ===================================================================
 --- devel/boehm-gc/distinfo	(revision 313614)
 +++ devel/boehm-gc/distinfo	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-Makefile.in
 ===================================================================
 --- devel/boehm-gc/files/patch-Makefile.in	(revision 313614)
 +++ devel/boehm-gc/files/patch-Makefile.in	(working copy)
 @@ -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 = .
 Index: devel/boehm-gc/files/patch-ab
 ===================================================================
 --- devel/boehm-gc/files/patch-ab	(revision 313614)
 +++ devel/boehm-gc/files/patch-ab	(working copy)
 @@ -1,7 +1,7 @@
 ---- 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(...) ...
 +--- 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
 @@ -9,11 +9,10 @@
   .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.
 +@@ -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
 + .LP
  +.SH "PORT INFORMATION"
  +.LP
  +In this (FreeBSD package) installation,
 @@ -55,6 +54,7 @@
  +extension of
  +.I g++.
  +This may or may not make a difference.
 - .LP
 ++.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
 Index: devel/boehm-gc/files/patch-configure
 ===================================================================
 --- devel/boehm-gc/files/patch-configure	(revision 313614)
 +++ devel/boehm-gc/files/patch-configure	(working copy)
 @@ -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
 + 
 Index: devel/boehm-gc/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dbg_mlc.c	(revision 313614)
 +++ devel/boehm-gc/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dyn_load.c	(revision 313614)
 +++ devel/boehm-gc/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-gc.h	(revision 313614)
 +++ devel/boehm-gc/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-private-gcconfig.h	(revision 313614)
 +++ devel/boehm-gc/files/patch-include-private-gcconfig.h	(working copy)
 @@ -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"
 Index: devel/boehm-gc/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc/files/patch-os_dep.c	(revision 313614)
 +++ devel/boehm-gc/files/patch-os_dep.c	(working copy)
 @@ -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 <errno.h>
 - #   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 <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 ++#      define AIM      /* Pretend that we're AIM. */
 ++#      include <machine/trap.h>
 ++#       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)
 Index: devel/boehm-gc/pkg-plist
 ===================================================================
 --- devel/boehm-gc/pkg-plist	(revision 313614)
 +++ devel/boehm-gc/pkg-plist	(working copy)
 @@ -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
 @@ -23,40 +24,4 @@
  lib/libgccpp.so
  lib/libgccpp.so.1
  libdata/pkgconfig/bdw-gc.pc
 -share/doc/gc/README
 -share/doc/gc/README.DGUX386
 -share/doc/gc/README.Mac
 -share/doc/gc/README.MacOSX
 -share/doc/gc/README.OS2
 -share/doc/gc/README.amiga
 -share/doc/gc/README.arm.cross
 -share/doc/gc/README.autoconf
 -share/doc/gc/README.changes
 -share/doc/gc/README.contributors
 -share/doc/gc/README.cords
 -share/doc/gc/README.darwin
 -share/doc/gc/README.dj
 -share/doc/gc/README.environment
 -share/doc/gc/README.ews4800
 -share/doc/gc/README.hp
 -share/doc/gc/README.linux
 -share/doc/gc/README.macros
 -share/doc/gc/README.rs6000
 -share/doc/gc/README.sgi
 -share/doc/gc/README.solaris2
 -share/doc/gc/README.uts
 -share/doc/gc/README.win32
 -share/doc/gc/README.win64
 -share/doc/gc/barrett_diagram
 -share/doc/gc/debugging.html
 -share/doc/gc/gc.man
 -share/doc/gc/gcdescr.html
 -share/doc/gc/gcinterface.html
 -share/doc/gc/leak.html
 -share/doc/gc/overview.html
 -share/doc/gc/porting.html
 -share/doc/gc/scale.html
 -share/doc/gc/simple_example.html
 -share/doc/gc/tree.html
 -@dirrm share/doc/gc
  @dirrm include/gc
 Index: devel/boehm-gc-redirect/Makefile
 ===================================================================
 --- devel/boehm-gc-redirect/Makefile	(revision 313614)
 +++ devel/boehm-gc-redirect/Makefile	(working copy)
 @@ -1,63 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with malloc redirection
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	redirect
 -SOVER=	1
  
 -OPTIONS_DEFINE=	DEBUG
 -
 -PLIST_FILES=	${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so.${SOVER},g} \
 -		${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g}
 -
 -.include <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-e 's,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g' \
 -		-e 's,libcord\.la,libcord-${GC_VARIANT}.la,g' \
 -		${WRKSRC}/Makefile.in
 -
 -do-install:
 -.for LIB in ${INSTLIBS}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(cd ${PREFIX}/lib && ${LN} -s lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    lib${LIB}-${GC_VARIANT}.so)
 -.endfor
 -
 -test: build
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-redirect/distinfo
 ===================================================================
 --- devel/boehm-gc-redirect/distinfo	(revision 313614)
 +++ devel/boehm-gc-redirect/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-redirect/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-configure	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-redirect/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-redirect/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dyn_load.c	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-gc.h	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-redirect/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-os_dep.c	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-threaded/Makefile
 ===================================================================
 --- devel/boehm-gc-threaded/Makefile	(revision 313614)
 +++ devel/boehm-gc-threaded/Makefile	(working copy)
 @@ -1,73 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with threading support
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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}
 -MAKE_JOBS_UNSAFE=	yes
 -INSTLIBS=	cord gc gccpp
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	threaded
 -SOVER=	1
  
 -OPTIONS_DEFINE=	PARALLEL_MARK DEBUG
 -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 <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MPARALLEL_MARK}
 -CONFIGURE_ARGS+=	--enable-parallel-mark
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-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}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(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
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-threaded/distinfo
 ===================================================================
 --- devel/boehm-gc-threaded/distinfo	(revision 313614)
 +++ devel/boehm-gc-threaded/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-threaded/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-configure	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-threaded/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-threaded/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dyn_load.c	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-gc.h	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-threaded/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-os_dep.c	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 
 --Multipart_Fri_Mar__8_21:36:42_2013-1--

From: Vitaly Magerya <vmagerya@gmail.com>
To: Hirohisa Yamaguchi <umq@ueo.co.jp>
Cc: bug-followup@freebsd.org
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining
 previous PRs
Date: Fri, 8 Mar 2013 15:41:06 +0200

 Hirohisa Yamaguchi <umq@ueo.co.jp> wrote:
 > I agree that showing effective option only is better(patch updated).
 
 Looks good.
 
 > DOCS is one of pre-defined global options.
 > We do not need to have it in OPTIONS_DEFINE each port.
 > When NOPORTDOCS is not defined, DOCS will be defined.
 >  #  see ports/Mk/bsd.options.mk
 
 Right, but it's not shown in the 'make config' dialog (or is it
 a problem on my end?). The rule of thumb I'm following is this:
 if the port has any other options, or if enabling DOCS pulls in
 new dependencies, show DOCS in the dialog. Otherwise leave it
 silent.
 
 This is a minor point though; I don't really mind the way it
 works now.
 
 > I thought boehm-gc is X11-like license (wikipedia said so).
 > [...]
 > yes, libatomic_ops is GPLv2'ed.
 
 The problem here (aside from libatomic_ops) is that the wording
 of the license in README matches neither MIT/Expat [1,2] nor
 MIT/X11 [3] licenses.
 
 For example, boehm-gc require you to add a notice about modified
 code if you want to redistribute modifications, which is something
 MIT/Expat doesn't require.
 
 [1] http://directory.fsf.org/wiki/License:Expat
 [2] http://opensource.org/licenses/MIT
 [3] http://directory.fsf.org/wiki/License:X11
State-Changed-From-To: open->open 
State-Changed-By: linimon 
State-Changed-When: Sun Mar 10 04:35:34 UTC 2013 
State-Changed-Why:  
Clean up some stray text. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176716 

From: Hirohisa Yamaguchi <umq@ueo.co.jp>
To: Vitaly Magerya <vmagerya@gmail.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining previous PRs
Date: Mon, 11 Mar 2013 10:49:40 +0900

 --Multipart_Mon_Mar_11_10:49:40_2013-1
 Content-Type: text/plain; charset=US-ASCII
 
 Vitaly Magerya <vmagerya@gmail.com> wrote:
 > The rule of thumb I'm following is this:
 > if the port has any other options, or if enabling DOCS pulls in
 > new dependencies, show DOCS in the dialog. Otherwise leave it
 > silent.
 
 I take your point.
 Now, it will be in the dialog when the option makes difference.
 
 
 > The problem here (aside from libatomic_ops) is that the wording
 > of the license in README matches neither MIT/Expat nor
 > MIT/X11 licenses.
 >
 > For example, boehm-gc require you to add a notice about modified
 > code if you want to redistribute modifications, which is something
 > MIT/Expat doesn't require.
 
 I've overlooked this point.
 make it have it dedicated name.
 
 LICENSE_FILE will be copied into ${PREFIX}/share/licenses/${UNIQUENAME}/
 regardless PORTDOCS is installed or not.
 
 
  # Hope this patch will be the last :)
 Regards,
 -- 
 
 	Hirohisa Yamaguchi
 	  <umq@ueo.co.jp>
 
 --Multipart_Mon_Mar_11_10:49:40_2013-1
 Content-Type: application/octet-stream; type=patch
 Content-Disposition: attachment; filename="devel_boehm-gc-176716_2.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: devel/boehm-gc/Makefile
 ===================================================================
 --- devel/boehm-gc/Makefile	(revision 313614)
 +++ devel/boehm-gc/Makefile	(working copy)
 @@ -1,54 +1,117 @@
 -# New ports collection makefile for:	boehm-gc
 -# Date created:		15 November 1996
 -# Whom:			Mike McGaughey <mmcg@cs.monash.edu.au>
 -#
 +# Created by: Mike McGaughey <mmcg@cs.monash.edu.au>
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	0
 +PORTNAME=	gc
 +PORTVERSION=	7.2d
 +PORTREVISION?=	0
  CATEGORIES=	devel
  MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PKGNAMEPREFIX=	boehm-
 +.ifdef GC_VARIANT
 +PKGNAMESUFFIX=	-${GC_VARIANT}
 +.endif
  
  MAINTAINER=	ports@FreeBSD.org
  COMMENT=	Garbage collection and memory leak detection for C and C++
  
 +LICENSE=	BDWGC
 +LICENSE_NAME=	Boehm-Demers-Weiser Garbage Collector License
 +LICENSE_FILE=	${WRKSRC}/doc/README
 +LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 +
  GNU_CONFIGURE=	yes
 +LATEST_LINK=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
  USE_GNOME=	gnomehack
  USE_LDCONFIG=	yes
 -CONFIGURE_ARGS=	--enable-cplusplus --disable-static --disable-threads
 +CONFIGURE_ARGS=	--enable-cplusplus --disable-static
  MAKE_JOBS_UNSAFE=	yes
 -OPTIONS_DEFINE=	DEBUG
  
 -.include <bsd.port.pre.mk>
 +WRKSRC=		${WRKDIR}/${DISTNAME:C/[a-z]$//}
  
 +OPTIONS_DEFINE=		DEBUG
 +DEBUG_DESC=		Additional debugging support (see documentation)
 +
 +.ifdef GC_VARIANT
 +INSTLIBS=		cord gc gccpp
 +PLIST=			${NONEXISTENT}
 +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
 +RUN_DEPENDS+=		${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +SOVER=			1
 +. if ${GC_VARIANT} == "redirect"
 +CONFIGURE_ARGS+=	--disable-threads --enable-redirect-malloc
 +. endif
 +. if ${GC_VARIANT} == "threaded"
 +CONFIGURE_ARGS+=	--enable-threads=posix --disable-redirect-malloc
 +OPTIONS_DEFINE+=	PARALLEL_MARK
 +PARALLEL_MARK_DESC=	Parallel-thread marking (faster for SMP)
 +. endif
 +.else
 +CONFIGURE_ARGS+=	--disable-threads --disable-redirect-malloc
 +MAN3=			gc.3
 +OPTIONS_DEFINE+=	DOCS
 +PORTDOCS=		*
 +.endif
 +
 +.include <bsd.port.options.mk>
 +
  .if ${PORT_OPTIONS:MDEBUG}
  CONFIGURE_ARGS+=	--enable-gc-debug
  PKGNAMESUFFIX:=		${PKGNAMESUFFIX}+fulldebug
  .endif
  
 -MAN3=		gc.3
 +.if ! ${PORT_OPTIONS:MDOCS}
 +CONFIGURE_ARGS+=	--datarootdir=${WRKDIR}/doc
 +.endif
  
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 +.if defined(GC_VARIANT) && ${GC_VARIANT} == "threaded"
 +. if ${PORT_OPTIONS:MPARALLEL_MARK}
 +CONFIGURE_ARGS+=	--enable-parallel-mark
 +. endif
  .endif
  
 +.include <bsd.port.pre.mk>
 +
 +NOT_FOR_ARCHS=	ia64
 +
 +.ifdef GC_VARIANT
  post-patch:
 +	@${REINPLACE_CMD} -e \
 +		's,libgc\.la,libgc-${GC_VARIANT}.la,g ; \
 +		 s,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g ; \
 +		 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}
 +	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 +	${LN} -sf lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so
 +.endfor
 +	${INSTALL_DATA} ${WRKSRC}/bdw-gc.pc \
 +		${PREFIX}/libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc
 +
 +.else # ! GC_VARIANT
 +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
  
 -#
 +post-install:
 +	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${MAN3PREFIX}/man/man3/gc.3
 +
 +.endif
 +
  # Get rid of .la and static library files
 -#
  post-configure:
  	@${REINPLACE_CMD} -E -e \
  	'/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
  
 -post-install:
 -	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
 -
 -test: build
 +regression-test: build
  	cd ${WRKSRC} && ${MAKE} check
  
  .include <bsd.port.post.mk>
 Index: devel/boehm-gc/distinfo
 ===================================================================
 --- devel/boehm-gc/distinfo	(revision 313614)
 +++ devel/boehm-gc/distinfo	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-Makefile.in
 ===================================================================
 --- devel/boehm-gc/files/patch-Makefile.in	(revision 313614)
 +++ devel/boehm-gc/files/patch-Makefile.in	(working copy)
 @@ -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 = .
 Index: devel/boehm-gc/files/patch-ab
 ===================================================================
 --- devel/boehm-gc/files/patch-ab	(revision 313614)
 +++ devel/boehm-gc/files/patch-ab	(working copy)
 @@ -1,7 +1,7 @@
 ---- 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(...) ...
 +--- 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
 @@ -9,11 +9,10 @@
   .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.
 +@@ -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
 + .LP
  +.SH "PORT INFORMATION"
  +.LP
  +In this (FreeBSD package) installation,
 @@ -55,6 +54,7 @@
  +extension of
  +.I g++.
  +This may or may not make a difference.
 - .LP
 ++.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
 Index: devel/boehm-gc/files/patch-configure
 ===================================================================
 --- devel/boehm-gc/files/patch-configure	(revision 313614)
 +++ devel/boehm-gc/files/patch-configure	(working copy)
 @@ -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
 + 
 Index: devel/boehm-gc/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dbg_mlc.c	(revision 313614)
 +++ devel/boehm-gc/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dyn_load.c	(revision 313614)
 +++ devel/boehm-gc/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-gc.h	(revision 313614)
 +++ devel/boehm-gc/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-private-gcconfig.h	(revision 313614)
 +++ devel/boehm-gc/files/patch-include-private-gcconfig.h	(working copy)
 @@ -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"
 Index: devel/boehm-gc/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc/files/patch-os_dep.c	(revision 313614)
 +++ devel/boehm-gc/files/patch-os_dep.c	(working copy)
 @@ -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 <errno.h>
 - #   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 <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 ++#      define AIM      /* Pretend that we're AIM. */
 ++#      include <machine/trap.h>
 ++#       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)
 Index: devel/boehm-gc/pkg-plist
 ===================================================================
 --- devel/boehm-gc/pkg-plist	(revision 313614)
 +++ devel/boehm-gc/pkg-plist	(working copy)
 @@ -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
 @@ -23,40 +24,4 @@
  lib/libgccpp.so
  lib/libgccpp.so.1
  libdata/pkgconfig/bdw-gc.pc
 -share/doc/gc/README
 -share/doc/gc/README.DGUX386
 -share/doc/gc/README.Mac
 -share/doc/gc/README.MacOSX
 -share/doc/gc/README.OS2
 -share/doc/gc/README.amiga
 -share/doc/gc/README.arm.cross
 -share/doc/gc/README.autoconf
 -share/doc/gc/README.changes
 -share/doc/gc/README.contributors
 -share/doc/gc/README.cords
 -share/doc/gc/README.darwin
 -share/doc/gc/README.dj
 -share/doc/gc/README.environment
 -share/doc/gc/README.ews4800
 -share/doc/gc/README.hp
 -share/doc/gc/README.linux
 -share/doc/gc/README.macros
 -share/doc/gc/README.rs6000
 -share/doc/gc/README.sgi
 -share/doc/gc/README.solaris2
 -share/doc/gc/README.uts
 -share/doc/gc/README.win32
 -share/doc/gc/README.win64
 -share/doc/gc/barrett_diagram
 -share/doc/gc/debugging.html
 -share/doc/gc/gc.man
 -share/doc/gc/gcdescr.html
 -share/doc/gc/gcinterface.html
 -share/doc/gc/leak.html
 -share/doc/gc/overview.html
 -share/doc/gc/porting.html
 -share/doc/gc/scale.html
 -share/doc/gc/simple_example.html
 -share/doc/gc/tree.html
 -@dirrm share/doc/gc
  @dirrm include/gc
 Index: devel/boehm-gc-redirect/Makefile
 ===================================================================
 --- devel/boehm-gc-redirect/Makefile	(revision 313614)
 +++ devel/boehm-gc-redirect/Makefile	(working copy)
 @@ -1,63 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with malloc redirection
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	redirect
 -SOVER=	1
  
 -OPTIONS_DEFINE=	DEBUG
 -
 -PLIST_FILES=	${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so.${SOVER},g} \
 -		${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g}
 -
 -.include <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-e 's,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g' \
 -		-e 's,libcord\.la,libcord-${GC_VARIANT}.la,g' \
 -		${WRKSRC}/Makefile.in
 -
 -do-install:
 -.for LIB in ${INSTLIBS}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(cd ${PREFIX}/lib && ${LN} -s lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    lib${LIB}-${GC_VARIANT}.so)
 -.endfor
 -
 -test: build
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-redirect/distinfo
 ===================================================================
 --- devel/boehm-gc-redirect/distinfo	(revision 313614)
 +++ devel/boehm-gc-redirect/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-redirect/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-configure	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-redirect/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-redirect/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dyn_load.c	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-gc.h	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-redirect/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-os_dep.c	(revision 313614)
 +++ devel/boehm-gc-redirect/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-threaded/Makefile
 ===================================================================
 --- devel/boehm-gc-threaded/Makefile	(revision 313614)
 +++ devel/boehm-gc-threaded/Makefile	(working copy)
 @@ -1,73 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with threading support
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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}
 -MAKE_JOBS_UNSAFE=	yes
 -INSTLIBS=	cord gc gccpp
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	threaded
 -SOVER=	1
  
 -OPTIONS_DEFINE=	PARALLEL_MARK DEBUG
 -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 <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MPARALLEL_MARK}
 -CONFIGURE_ARGS+=	--enable-parallel-mark
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-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}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(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
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-threaded/distinfo
 ===================================================================
 --- devel/boehm-gc-threaded/distinfo	(revision 313614)
 +++ devel/boehm-gc-threaded/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-threaded/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-configure	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-threaded/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-threaded/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dyn_load.c	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-gc.h	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-threaded/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-os_dep.c	(revision 313614)
 +++ devel/boehm-gc-threaded/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 
 --Multipart_Mon_Mar_11_10:49:40_2013-1--

From: Vitaly Magerya <vmagerya@gmail.com>
To: Hirohisa Yamaguchi <umq@ueo.co.jp>
Cc: bug-followup@freebsd.org
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining
 previous PRs
Date: Mon, 11 Mar 2013 10:45:37 +0200

 Hirohisa Yamaguchi <umq@ueo.co.jp> wrote:
 >  # Hope this patch will be the last :)
 
 Yup, looks good to me.

From: Hirohisa Yamaguchi <umq@ueo.co.jp>
To: bug-followup@FreeBSD.ORG
Cc:  
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining previous PRs (1/2)
Date: Wed, 20 Mar 2013 20:05:07 +0900

 --Multipart_Wed_Mar_20_20:05:07_2013-1
 Content-Type: text/plain; charset=US-ASCII
 
 update patch to follow changeset 314640
  http://svnweb.freebsd.org/ports?view=revision&revision=314640
 
 -- 
 
 	Hirohisa Yamaguchi
 	  umq@ueo.co.jp
 
 --Multipart_Wed_Mar_20_20:05:07_2013-1
 Content-Type: application/octet-stream; type=patch
 Content-Disposition: attachment; filename="devel_boehm-gc-176716-3.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: devel/boehm-gc/Makefile
 ===================================================================
 --- devel/boehm-gc/Makefile	(revision 314722)
 +++ devel/boehm-gc/Makefile	(working copy)
 @@ -1,54 +1,117 @@
 -# New ports collection makefile for:	boehm-gc
 -# Date created:		15 November 1996
 -# Whom:			Mike McGaughey <mmcg@cs.monash.edu.au>
 -#
 +# Created by: Mike McGaughey <mmcg@cs.monash.edu.au>
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	0
 +PORTNAME=	gc
 +PORTVERSION=	7.2d
 +PORTREVISION?=	0
  CATEGORIES=	devel
  MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PKGNAMEPREFIX=	boehm-
 +.ifdef GC_VARIANT
 +PKGNAMESUFFIX=	-${GC_VARIANT}
 +.endif
  
  MAINTAINER=	ports@FreeBSD.org
  COMMENT=	Garbage collection and memory leak detection for C and C++
  
 +LICENSE=	BDWGC
 +LICENSE_NAME=	Boehm-Demers-Weiser Garbage Collector License
 +LICENSE_FILE=	${WRKSRC}/doc/README
 +LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 +
  GNU_CONFIGURE=	yes
 +LATEST_LINK=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
  USES=	pathfix
  USE_LDCONFIG=	yes
 -CONFIGURE_ARGS=	--enable-cplusplus --disable-static --disable-threads
 +CONFIGURE_ARGS=	--enable-cplusplus --disable-static
  MAKE_JOBS_UNSAFE=	yes
 -OPTIONS_DEFINE=	DEBUG
  
 -.include <bsd.port.pre.mk>
 +WRKSRC=		${WRKDIR}/${DISTNAME:C/[a-z]$//}
  
 +OPTIONS_DEFINE=		DEBUG
 +DEBUG_DESC=		Additional debugging support (see documentation)
 +
 +.ifdef GC_VARIANT
 +INSTLIBS=		cord gc gccpp
 +PLIST=			${NONEXISTENT}
 +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
 +RUN_DEPENDS+=		${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +SOVER=			1
 +. if ${GC_VARIANT} == "redirect"
 +CONFIGURE_ARGS+=	--disable-threads --enable-redirect-malloc
 +. endif
 +. if ${GC_VARIANT} == "threaded"
 +CONFIGURE_ARGS+=	--enable-threads=posix --disable-redirect-malloc
 +OPTIONS_DEFINE+=	PARALLEL_MARK
 +PARALLEL_MARK_DESC=	Parallel-thread marking (faster for SMP)
 +. endif
 +.else
 +CONFIGURE_ARGS+=	--disable-threads --disable-redirect-malloc
 +MAN3=			gc.3
 +OPTIONS_DEFINE+=	DOCS
 +PORTDOCS=		*
 +.endif
 +
 +.include <bsd.port.options.mk>
 +
  .if ${PORT_OPTIONS:MDEBUG}
  CONFIGURE_ARGS+=	--enable-gc-debug
  PKGNAMESUFFIX:=		${PKGNAMESUFFIX}+fulldebug
  .endif
  
 -MAN3=		gc.3
 +.if ! ${PORT_OPTIONS:MDOCS}
 +CONFIGURE_ARGS+=	--datarootdir=${WRKDIR}/doc
 +.endif
  
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 +.if defined(GC_VARIANT) && ${GC_VARIANT} == "threaded"
 +. if ${PORT_OPTIONS:MPARALLEL_MARK}
 +CONFIGURE_ARGS+=	--enable-parallel-mark
 +. endif
  .endif
  
 +.include <bsd.port.pre.mk>
 +
 +NOT_FOR_ARCHS=	ia64
 +
 +.ifdef GC_VARIANT
  post-patch:
 +	@${REINPLACE_CMD} -e \
 +		's,libgc\.la,libgc-${GC_VARIANT}.la,g ; \
 +		 s,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g ; \
 +		 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}
 +	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 +	${LN} -sf lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 +		${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so
 +.endfor
 +	${INSTALL_DATA} ${WRKSRC}/bdw-gc.pc \
 +		${PREFIX}/libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc
 +
 +.else # ! GC_VARIANT
 +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
  
 -#
 +post-install:
 +	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${MAN3PREFIX}/man/man3/gc.3
 +
 +.endif
 +
  # Get rid of .la and static library files
 -#
  post-configure:
  	@${REINPLACE_CMD} -E -e \
  	'/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
  
 -post-install:
 -	${INSTALL_MAN} ${WRKSRC}/doc/gc.man ${PREFIX}/man/man3/gc.3
 -
 -test: build
 +regression-test: build
  	cd ${WRKSRC} && ${MAKE} check
  
  .include <bsd.port.post.mk>
 Index: devel/boehm-gc/distinfo
 ===================================================================
 --- devel/boehm-gc/distinfo	(revision 314722)
 +++ devel/boehm-gc/distinfo	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-Makefile.in
 ===================================================================
 --- devel/boehm-gc/files/patch-Makefile.in	(revision 314722)
 +++ devel/boehm-gc/files/patch-Makefile.in	(working copy)
 @@ -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 = .
 Index: devel/boehm-gc/files/patch-ab
 ===================================================================
 --- devel/boehm-gc/files/patch-ab	(revision 314722)
 +++ devel/boehm-gc/files/patch-ab	(working copy)
 @@ -1,7 +1,7 @@
 ---- 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(...) ...
 +--- 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
 @@ -9,11 +9,10 @@
   .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.
 +@@ -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
 + .LP
  +.SH "PORT INFORMATION"
  +.LP
  +In this (FreeBSD package) installation,
 @@ -55,6 +54,7 @@
  +extension of
  +.I g++.
  +This may or may not make a difference.
 - .LP
 ++.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
 Index: devel/boehm-gc/files/patch-configure
 ===================================================================
 --- devel/boehm-gc/files/patch-configure	(revision 314722)
 +++ devel/boehm-gc/files/patch-configure	(working copy)
 @@ -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
 + 
 Index: devel/boehm-gc/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dbg_mlc.c	(revision 314722)
 +++ devel/boehm-gc/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc/files/patch-dyn_load.c	(revision 314722)
 +++ devel/boehm-gc/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-gc.h	(revision 314722)
 +++ devel/boehm-gc/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc/files/patch-include-private-gcconfig.h	(revision 314722)
 +++ devel/boehm-gc/files/patch-include-private-gcconfig.h	(working copy)
 @@ -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"
 Index: devel/boehm-gc/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc/files/patch-os_dep.c	(revision 314722)
 +++ devel/boehm-gc/files/patch-os_dep.c	(working copy)
 @@ -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 <errno.h>
 - #   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 <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 ++#      define AIM      /* Pretend that we're AIM. */
 ++#      include <machine/trap.h>
 ++#       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)
 Index: devel/boehm-gc/pkg-plist
 ===================================================================
 --- devel/boehm-gc/pkg-plist	(revision 314722)
 +++ devel/boehm-gc/pkg-plist	(working copy)
 @@ -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
 @@ -23,40 +24,4 @@
  lib/libgccpp.so
  lib/libgccpp.so.1
  libdata/pkgconfig/bdw-gc.pc
 -share/doc/gc/README
 -share/doc/gc/README.DGUX386
 -share/doc/gc/README.Mac
 -share/doc/gc/README.MacOSX
 -share/doc/gc/README.OS2
 -share/doc/gc/README.amiga
 -share/doc/gc/README.arm.cross
 -share/doc/gc/README.autoconf
 -share/doc/gc/README.changes
 -share/doc/gc/README.contributors
 -share/doc/gc/README.cords
 -share/doc/gc/README.darwin
 -share/doc/gc/README.dj
 -share/doc/gc/README.environment
 -share/doc/gc/README.ews4800
 -share/doc/gc/README.hp
 -share/doc/gc/README.linux
 -share/doc/gc/README.macros
 -share/doc/gc/README.rs6000
 -share/doc/gc/README.sgi
 -share/doc/gc/README.solaris2
 -share/doc/gc/README.uts
 -share/doc/gc/README.win32
 -share/doc/gc/README.win64
 -share/doc/gc/barrett_diagram
 -share/doc/gc/debugging.html
 -share/doc/gc/gc.man
 -share/doc/gc/gcdescr.html
 -share/doc/gc/gcinterface.html
 -share/doc/gc/leak.html
 -share/doc/gc/overview.html
 -share/doc/gc/porting.html
 -share/doc/gc/scale.html
 -share/doc/gc/simple_example.html
 -share/doc/gc/tree.html
 -@dirrm share/doc/gc
  @dirrm include/gc
 Index: devel/boehm-gc-redirect/Makefile
 ===================================================================
 --- devel/boehm-gc-redirect/Makefile	(revision 314722)
 +++ devel/boehm-gc-redirect/Makefile	(working copy)
 @@ -1,63 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with malloc redirection
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	redirect
 -SOVER=	1
  
 -OPTIONS_DEFINE=	DEBUG
 -
 -PLIST_FILES=	${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so.${SOVER},g} \
 -		${INSTLIBS:S,^,lib/lib,g:S,$,-${GC_VARIANT}.so,g}
 -
 -.include <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-e 's,libgccpp\.la,libgccpp-${GC_VARIANT}.la,g' \
 -		-e 's,libcord\.la,libcord-${GC_VARIANT}.la,g' \
 -		${WRKSRC}/Makefile.in
 -
 -do-install:
 -.for LIB in ${INSTLIBS}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(cd ${PREFIX}/lib && ${LN} -s lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    lib${LIB}-${GC_VARIANT}.so)
 -.endfor
 -
 -test: build
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-redirect/distinfo
 ===================================================================
 --- devel/boehm-gc-redirect/distinfo	(revision 314722)
 +++ devel/boehm-gc-redirect/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-redirect/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-configure	(revision 314722)
 +++ devel/boehm-gc-redirect/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-redirect/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(revision 314722)
 +++ devel/boehm-gc-redirect/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-redirect/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-dyn_load.c	(revision 314722)
 +++ devel/boehm-gc-redirect/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-gc.h	(revision 314722)
 +++ devel/boehm-gc-redirect/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(revision 314722)
 +++ devel/boehm-gc-redirect/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-redirect/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-redirect/files/patch-os_dep.c	(revision 314722)
 +++ devel/boehm-gc-redirect/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 Index: devel/boehm-gc-threaded/Makefile
 ===================================================================
 --- devel/boehm-gc-threaded/Makefile	(revision 314722)
 +++ devel/boehm-gc-threaded/Makefile	(working copy)
 @@ -1,73 +1,15 @@
 -# New ports collection makefile for:	boehm-gc-redirect
 -# Date created:		12/17/2009
 -# Whom:			stas
 -#
 +# Created by: stas
  # $FreeBSD$
 -#
  
 -PORTNAME=	boehm-gc
 -PORTVERSION=	7.1
 -PORTREVISION=	1
 -CATEGORIES=	devel
 -MASTER_SITES=	http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
 -PKGNAMESUFFIX=	-${GC_VARIANT}
 -DISTNAME=	gc-${PORTVERSION:S/.a/alpha/}
 +PORTREVISION=	0
  
 -MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	Garbage collection and memory leak detection for C and C++
 +COMMENT=	Garbage collection and memory leak detection for C and C++ with threading support
  
 -RUN_DEPENDS=	${PREFIX}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc
 +LICENSE=	MIT
  
 -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}
 -MAKE_JOBS_UNSAFE=	yes
 -INSTLIBS=	cord gc gccpp
 +MASTERDIR=	${.CURDIR}/../boehm-gc
 +DESCR=		${.CURDIR}/pkg-descr
 +
  GC_VARIANT=	threaded
 -SOVER=	1
  
 -OPTIONS_DEFINE=	PARALLEL_MARK DEBUG
 -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 <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "ia64"
 -BROKEN=	Does not compile on ia64
 -.endif
 -
 -.if ${PORT_OPTIONS:MPARALLEL_MARK}
 -CONFIGURE_ARGS+=	--enable-parallel-mark
 -.endif
 -
 -.if ${PORT_OPTIONS:MDEBUG}
 -CONFIGURE_ARGS+=	--enable-gc-debug
 -PKGNAMESUFFIX:=	${PKGNAMESUFFIX}+fulldebug
 -.endif
 -
 -post-patch:
 -	${REINPLACE_CMD} -E -e 's,libgc\.la,libgc-${GC_VARIANT}.la,g' \
 -		-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}
 -	${INSTALL_DATA} ${WRKSRC}/.libs/lib${LIB}-${GC_VARIANT}.so.${SOVER} \
 -	    ${PREFIX}/lib/lib${LIB}-${GC_VARIANT}.so.${SOVER}
 -	@(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
 -	cd ${WRKSRC} && ${MAKE} check
 -
 -.include <bsd.port.post.mk>
 +.include "${MASTERDIR}/Makefile"
 Index: devel/boehm-gc-threaded/distinfo
 ===================================================================
 --- devel/boehm-gc-threaded/distinfo	(revision 314722)
 +++ devel/boehm-gc-threaded/distinfo	(working copy)
 @@ -1,2 +0,0 @@
 -SHA256 (gc-7.1.tar.gz) = e3cef6028fe3efe7de3bcf4107c880eae50b3ee79841450d885467c09bcebf30
 -SIZE (gc-7.1.tar.gz) = 1077714
 Index: devel/boehm-gc-threaded/files/patch-configure
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-configure	(revision 314722)
 +++ devel/boehm-gc-threaded/files/patch-configure	(working copy)
 @@ -1,12 +0,0 @@
 ---- 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"
 -     ;;
 -+ sparc64-*-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
 Index: devel/boehm-gc-threaded/files/patch-dbg_mlc.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(revision 314722)
 +++ devel/boehm-gc-threaded/files/patch-dbg_mlc.c	(working copy)
 @@ -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 <dlfcn.h>
 -+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);
 - }
 Index: devel/boehm-gc-threaded/files/patch-dyn_load.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-dyn_load.c	(revision 314722)
 +++ devel/boehm-gc-threaded/files/patch-dyn_load.c	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-gc.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-gc.h	(revision 314722)
 +++ devel/boehm-gc-threaded/files/patch-include-gc.h	(working copy)
 @@ -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
 Index: devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(revision 314722)
 +++ devel/boehm-gc-threaded/files/patch-include-private-gcconfig.h	(working copy)
 @@ -1,63 +0,0 @@
 ---- 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__)
 - #    define ARM32
 --#    if !defined(LINUX) && !defined(NETBSD)
 -+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 - #      define NOSYS
 - #      define mach_type_known
 - #    endif
 -@@ -334,10 +334,26 @@
 - #    define X86_64
 - #    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
 - # endif
 -+# if defined(FREEBSD) && defined(__powerpc__)
 -+#    define POWERPC
 -+#    define mach_type_known
 -+# endif
 -+# if defined(FREEBSD) && defined(__arm__)
 -+#    define ARM32
 -+#    define mach_type_known
 -+# endif
 - # if defined(bsdi) && (defined(i386) || defined(__i386__))
 - #    define I386
 - #    define BSDI
 -@@ -1771,6 +1787,16 @@
 - #     define OS_TYPE "MSWINCE"
 - #     define DATAEND /* not needed */
 - #   endif
 -+#   ifdef FREEBSD
 -+#   define ALIGNMENT 4
 -+#       define OS_TYPE "FREEBSD"
 -+#       ifdef __ELF__
 -+#           define DYNAMIC_LOADING
 -+#       endif
 -+#	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
 Index: devel/boehm-gc-threaded/files/patch-os_dep.c
 ===================================================================
 --- devel/boehm-gc-threaded/files/patch-os_dep.c	(revision 314722)
 +++ devel/boehm-gc-threaded/files/patch-os_dep.c	(working copy)
 @@ -1,44 +0,0 @@
 ---- 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)
 -     {
 - #	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 <errno.h>
 - #   if defined(FREEBSD)
 - #     define SIG_OK TRUE
 --#     define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     if defined(POWERPC)
 -+#	define AIM	/* Pretend that we're AIM. */
 -+#	include <machine/trap.h>
 -+#       define CODE_OK (code == EXC_DSI)
 -+#     else
 -+#       define CODE_OK (code == BUS_PAGE_FAULT)
 -+#     endif
 - #   elif defined(OSF1)
 - #     define SIG_OK (sig == SIGSEGV)
 - #     define CODE_OK (code == 2 /* experimentally determined */)
 
 --Multipart_Wed_Mar_20_20:05:07_2013-1--

From: Vitaly Magerya <vmagerya@gmail.com>
To: bug-followup@FreeBSD.org, umq@ueo.co.jp
Cc:  
Subject: Re: ports/176716: [patch] devel/boehm-gc update to 7.2d combining
 previous PRs
Date: Sun, 21 Jul 2013 20:26:56 +0300

 Turns out that the latest patch has incomplete pkg-plist: all the files
 installed into share/doc/gc/ when DOCS option is set are missing.
Responsible-Changed-From-To: freebsd-ports-bugs->bsam 
Responsible-Changed-By: bsam 
Responsible-Changed-When: Thu Oct 17 18:07:45 UTC 2013 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176716 
State-Changed-From-To: open->closed 
State-Changed-By: bsam 
State-Changed-When: Thu Oct 17 20:57:05 UTC 2013 
State-Changed-Why:  
Committed with some changes, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176716 
>Unformatted:
