From 2e3bc44b73106f1c0aa8004b6e7cc425a2b85168 Mon Sep 17 00:00:00 2001 From: Lucas Holt Date: Thu, 28 Oct 2021 14:04:13 -0400 Subject: [PATCH] fix some issues with boehm-gc builds --- devel/boehm-gc/Makefile | 7 ++-- devel/boehm-gc/files/patch-configure | 12 ++++++ .../patch-include_gc_pthread_redirects.h | 15 +++++++ .../files/patch-include_private_gcconfig.h | 40 +++++++++++++++++++ devel/boehm-gc/pkg-descr | 2 +- devel/boehm-gc/pkg-plist | 3 ++ 6 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 devel/boehm-gc/files/patch-configure create mode 100644 devel/boehm-gc/files/patch-include_gc_pthread_redirects.h create mode 100644 devel/boehm-gc/files/patch-include_private_gcconfig.h diff --git a/devel/boehm-gc/Makefile b/devel/boehm-gc/Makefile index 3c2b7d8c4f..a7076314d0 100644 --- a/devel/boehm-gc/Makefile +++ b/devel/boehm-gc/Makefile @@ -1,4 +1,3 @@ - PORTNAME= gc PORTVERSION= 8.0.6 CATEGORIES= devel @@ -16,7 +15,7 @@ LICENSE_NAME= Boehm-Demers-Weiser Garbage Collector License LICENSE_TEXT= License can be found at http://www.hboehm.info/gc/license.txt LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept -BUILD_DEPENDS= ${LOCALBASE}/lib/libatomic_ops.a:${PORTSDIR}/devel/libatomic_ops +BUILD_DEPENDS= ${LOCALBASE}/lib/libatomic_ops.a:devel/libatomic_ops GNU_CONFIGURE= yes USES= cpe libtool pathfix pkgconfig @@ -24,7 +23,7 @@ CPE_VENDOR= boehm-demers-weiser CPE_PRODUCT= garbage_collector USE_LDCONFIG= yes INSTALL_TARGET= install-strip -CONFIGURE_ARGS= --enable-cplusplus +CONFIGURE_ARGS= --enable-cplusplus --enable-static MAKE_JOBS_UNSAFE= yes WRKSRC= ${WRKDIR}/${DISTNAME:C/[a-z]$//} @@ -40,7 +39,7 @@ PLIST_FILES= ${INSTLIBS:S,^,lib/lib,:S,$,-${GC_VARIANT}.so,} \ lib/libgc-${GC_VARIANT}.so.1.4.4 \ lib/libgccpp-${GC_VARIANT}.so.1.4.1 \ libdata/pkgconfig/bdw-gc-${GC_VARIANT}.pc -RUN_DEPENDS+= ${LOCALBASE}/include/gc/gc.h:${PORTSDIR}/devel/boehm-gc +RUN_DEPENDS+= ${LOCALBASE}/include/gc/gc.h:devel/boehm-gc . if ${GC_VARIANT} == "redirect" CONFIGURE_ARGS+=--disable-threads --enable-redirect-malloc . endif diff --git a/devel/boehm-gc/files/patch-configure b/devel/boehm-gc/files/patch-configure new file mode 100644 index 0000000000..1abec84be6 --- /dev/null +++ b/devel/boehm-gc/files/patch-configure @@ -0,0 +1,12 @@ +--- configure.orig 2014-06-03 20:08:54 UTC ++++ configure +@@ -15639,6 +15639,9 @@ else + fi + + case "${host}" in ++ *-freebsd*|*-midnightbsd*) ++ gc_use_mmap=yes ++ ;; + *-linux*) + # FIXME: This seems to be no longer needed as configured in gcconfig.h + #gc_use_mmap=yes diff --git a/devel/boehm-gc/files/patch-include_gc_pthread_redirects.h b/devel/boehm-gc/files/patch-include_gc_pthread_redirects.h new file mode 100644 index 0000000000..30e470766a --- /dev/null +++ b/devel/boehm-gc/files/patch-include_gc_pthread_redirects.h @@ -0,0 +1,15 @@ +--- include/gc_pthread_redirects.h.orig 2018-12-23 21:28:41 UTC ++++ include/gc_pthread_redirects.h +@@ -53,12 +53,8 @@ + # endif /* !GC_NO_DLOPEN */ + + # ifndef GC_NO_PTHREAD_SIGMASK +-# if defined(GC_PTHREAD_SIGMASK_NEEDED) \ +- || defined(_BSD_SOURCE) || defined(_GNU_SOURCE) \ +- || (_POSIX_C_SOURCE >= 199506L) || (_XOPEN_SOURCE >= 500) + GC_API int GC_pthread_sigmask(int /* how */, const sigset_t *, + sigset_t * /* oset */); +-# endif + # endif /* !GC_NO_PTHREAD_SIGMASK */ + + # ifndef GC_PTHREAD_CREATE_CONST diff --git a/devel/boehm-gc/files/patch-include_private_gcconfig.h b/devel/boehm-gc/files/patch-include_private_gcconfig.h new file mode 100644 index 0000000000..738f7cee71 --- /dev/null +++ b/devel/boehm-gc/files/patch-include_private_gcconfig.h @@ -0,0 +1,40 @@ +--- include/private/gcconfig.h.orig 2020-11-21 06:02:51 UTC ++++ include/private/gcconfig.h +@@ -239,7 +239,7 @@ EXTERN_C_BEGIN + # define EWS4800 + # endif + # if !defined(LINUX) && !defined(EWS4800) && !defined(NETBSD) \ +- && !defined(OPENBSD) ++ && !defined(OPENBSD) && !defined(FREEBSD) + # if defined(ultrix) || defined(__ultrix) + # define ULTRIX + # else +@@ -670,7 +670,7 @@ EXTERN_C_BEGIN + # endif + # define mach_type_known + # endif +-# if defined(__riscv) && defined(LINUX) ++# if defined(__riscv) + # define RISCV + # define mach_type_known + # endif +@@ -2883,6 +2883,19 @@ EXTERN_C_BEGIN + # define DATASTART ((ptr_t)__data_start) + # define LINUX_STACKBOTTOM + # define DYNAMIC_LOADING ++# endif ++# ifdef FREEBSD ++# define OS_TYPE "FREEBSD" ++# ifndef GC_FREEBSD_THREADS ++# define MPROTECT_VDB ++# endif ++# define SIG_SUSPEND SIGUSR1 ++# define SIG_THR_RESTART SIGUSR2 ++# define FREEBSD_STACKBOTTOM ++# define DYNAMIC_LOADING ++ extern char etext[]; ++# define DATASTART GC_FreeBSDGetDataStart(0x1000, (ptr_t)etext) ++# define DATASTART_USES_BSDGETDATASTART + # endif + # endif /* RISCV */ + diff --git a/devel/boehm-gc/pkg-descr b/devel/boehm-gc/pkg-descr index 497dd81517..2322313f13 100644 --- a/devel/boehm-gc/pkg-descr +++ b/devel/boehm-gc/pkg-descr @@ -14,4 +14,4 @@ such source code modifications. See the man page and header files. ps: garbage collection is addictive. -WWW: http://www.hboehm.info/gc/ +WWW: https://www.hboehm.info/gc/ diff --git a/devel/boehm-gc/pkg-plist b/devel/boehm-gc/pkg-plist index 004799a1c5..6144427949 100644 --- a/devel/boehm-gc/pkg-plist +++ b/devel/boehm-gc/pkg-plist @@ -18,12 +18,15 @@ include/gc/gc_version.h include/gc/javaxfc.h include/gc/leak_detector.h include/gc_cpp.h +lib/libcord.a lib/libcord.so lib/libcord.so.1 lib/libcord.so.1.4.0 +lib/libgc.a lib/libgc.so lib/libgc.so.1 lib/libgc.so.1.4.4 +lib/libgccpp.a lib/libgccpp.so lib/libgccpp.so.1 lib/libgccpp.so.1.4.1