ports/176716: [patch] devel/boehm-gc update to 7.2d combining previous PRs (2/2)
Hirohisa Yamaguchi
umq at ueo.co.jp
Thu Mar 7 06:00:02 UTC 2013
The following reply was made to PR ports/176716; it has been noted by GNATS.
From: Hirohisa Yamaguchi <umq at ueo.co.jp>
To: bug-followup at freebsd.org, araujo at 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 at 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--
More information about the freebsd-ports-bugs
mailing list