devel/boehm-gc compiles on arm64, but it doesn't actually work.
The regression tests all fail.

There is support for aarch64, but not on OpenBSD.  The patch below
copies the required pieces into place.  With this, the regression
tests all succeed.

ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/boehm-gc/Makefile,v
retrieving revision 1.64
diff -u -p -r1.64 Makefile
--- Makefile    10 Apr 2017 11:45:25 -0000      1.64
+++ Makefile    14 Apr 2017 16:26:07 -0000
@@ -10,6 +10,7 @@ DISTNAME=     gc-${VERSION}
 
 PKGNAME-atomic=        libatomic_ops-${LIBAO_VERSION}
 PKGNAME-main=  boehm-gc-${VERSION}
+REVISION-main= 0
 
 DISTFILES=     ${DISTNAME}${EXTRACT_SUFX} \
                libatomic_ops-${LIBAO_VERSION}${EXTRACT_SUFX}
Index: patches/patch-include_private_gcconfig_h
===================================================================
RCS file: /cvs/ports/devel/boehm-gc/patches/patch-include_private_gcconfig_h,v
retrieving revision 1.21
diff -u -p -r1.21 patch-include_private_gcconfig_h
--- patches/patch-include_private_gcconfig_h    12 Nov 2016 10:33:04 -0000      
1.21
+++ patches/patch-include_private_gcconfig_h    14 Apr 2017 16:26:07 -0000
@@ -2,10 +2,32 @@ $OpenBSD: patch-include_private_gcconfig
 
 - All OpenBSD mips platforms are 64-bit, so correct the wordsize and alignment
 - use __data_start instead of _fdata on OpenBSD/mips64
+- add support for OpenBSD/aarch64
 
 --- include/private/gcconfig.h.orig    Tue Aug  2 21:36:14 2016
-+++ include/private/gcconfig.h Thu Nov 10 04:14:50 2016
-@@ -1712,14 +1712,15 @@
++++ include/private/gcconfig.h Fri Apr 14 17:44:40 2017
+@@ -102,7 +102,8 @@
+ # endif
+ # if defined(__aarch64__)
+ #    define AARCH64
+-#    if !defined(LINUX) && !defined(DARWIN) && !defined(FREEBSD)
++#    if !defined(LINUX) && !defined(DARWIN) && !defined(FREEBSD) \
++      && !defined(OPENBSD)
+ #      define NOSYS
+ #      define mach_type_known
+ #    endif
+@@ -137,6 +138,10 @@
+ #    define ARM32
+ #    define mach_type_known
+ # endif
++# if defined(OPENBSD) && defined(__aarch64__)
++#    define AARCH64
++#    define mach_type_known
++# endif
+ # if defined(OPENBSD) && defined(__sh__)
+ #    define SH
+ #    define mach_type_known
+@@ -1712,14 +1717,15 @@
  #  endif
  #  ifdef OPENBSD
  #    define OS_TYPE "OPENBSD"
@@ -24,3 +46,23 @@ $OpenBSD: patch-include_private_gcconfig
       extern int _end[];
  #    define DATAEND ((ptr_t)(&_end))
  #    define DYNAMIC_LOADING
+@@ -2165,6 +2171,19 @@
+       extern char etext[];
+ #     define DATASTART GC_FreeBSDGetDataStart(0x1000, (ptr_t)etext)
+ #     define DATASTART_USES_BSDGETDATASTART
++#   endif
++#   ifdef OPENBSD
++#     define OS_TYPE "OPENBSD"
++#     ifndef GC_OPENBSD_THREADS
++#       include <sys/param.h>
++#       include <uvm/uvm_extern.h>
++#       define STACKBOTTOM ((ptr_t)USRSTACK)
++#     endif
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++      extern int _end[];
++#     define DATAEND ((ptr_t)(&_end))
++#     define DYNAMIC_LOADING
+ #   endif
+ #   ifdef NOSYS
+       /* __data_start is usually defined in the target linker script.   */
-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to