Tuesday, June 29, 2021

boehm-gc : riscv64 support

Hi,

the patch below adds support for OpenBSD/riscv64 to boehm-gc. All
tests pass:

make check-TESTS
PASS: cordtest
PASS: gctest
PASS: leaktest
PASS: middletest
PASS: smashtest
PASS: hugetest
PASS: realloc_test
PASS: staticrootstest
PASS: test_atomic_ops
PASS: threadleaktest
PASS: threadkey_test
PASS: subthreadcreate_test
PASS: initsecondarythread_test
PASS: test_cpp
PASS: disclaim_test
PASS: disclaim_bench
PASS: disclaim_weakmap_test
============================================================================
Testsuite summary for gc 8.0.4
============================================================================
# TOTAL: 17
# PASS: 17
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================

ok ?

Index: patches/patch-include_private_gcconfig_h
===================================================================
RCS file: /cvs/OpenBSD/ports/devel/boehm-gc/patches/patch-include_private_gcconfig_h,v
retrieving revision 1.24
diff -u -p -u -r1.24 patch-include_private_gcconfig_h
--- patches/patch-include_private_gcconfig_h 5 Feb 2021 18:37:48 -0000 1.24
+++ patches/patch-include_private_gcconfig_h 29 Jun 2021 20:10:45 -0000
@@ -30,6 +30,15 @@ Index: include/private/gcconfig.h
# if defined(OPENBSD) && defined(__sh__)
# define SH
# define mach_type_known
+@@ -670,7 +675,7 @@ EXTERN_C_BEGIN
+ # endif
+ # define mach_type_known
+ # endif
+-# if defined(__riscv) && defined(LINUX)
++# if defined(__riscv) && (defined(LINUX) || defined(OPENBSD))
+ # define RISCV
+ # define mach_type_known
+ # endif
@@ -1076,7 +1081,12 @@ EXTERN_C_BEGIN
# endif
# ifdef OPENBSD
@@ -99,7 +108,33 @@ Index: include/private/gcconfig.h
# ifndef GC_OPENBSD_THREADS
EXTERN_C_END
# include <sys/param.h>
-@@ -2906,6 +2926,8 @@ EXTERN_C_BEGIN
+@@ -2884,6 +2904,25 @@ EXTERN_C_BEGIN
+ # define LINUX_STACKBOTTOM
+ # define DYNAMIC_LOADING
+ # endif
++# ifdef OPENBSD
++# define OS_TYPE "OPENBSD"
++# ifndef GC_OPENBSD_THREADS
++ EXTERN_C_END
++# include <sys/param.h>
++# include <uvm/uvm_extern.h>
++ EXTERN_C_BEGIN
++# ifdef USRSTACK
++# define STACKBOTTOM ((ptr_t)USRSTACK)
++# else
++# define HEURISTIC2
++# endif
++# endif
++ extern int __data_start[];
++# define DATASTART ((ptr_t)__data_start)
++ extern int _end[];
++# define DATAEND ((ptr_t)(&_end))
++# define DYNAMIC_LOADING
++# endif
+ # endif /* RISCV */
+
+ #if defined(__GLIBC__) && !defined(DONT_USE_LIBC_PRIVATES)
+@@ -2906,6 +2945,8 @@ EXTERN_C_BEGIN
#elif defined(LINUX) && defined(USE_MMAP)
/* The kernel may do a somewhat better job merging mappings etc. */
/* with anonymous mappings. */

--
Matthieu Herrb

No comments:

Post a Comment