1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

Ports/bdwgc: Update bdwgc to version 8.2.2

This commit is contained in:
Cameron Youell 2023-03-27 20:35:57 +11:00 committed by Linus Groh
parent fb3a1e2341
commit 4900b34ae1
10 changed files with 105 additions and 215 deletions

View file

@ -17,7 +17,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
| [`bash`](bash/) | GNU Bash | 5.2.15 | https://www.gnu.org/software/bash/ | | [`bash`](bash/) | GNU Bash | 5.2.15 | https://www.gnu.org/software/bash/ |
| [`bass`](bass/) | Beneath a Steel Sky | cd-1.2 | https://www.scummvm.org/games | | [`bass`](bass/) | Beneath a Steel Sky | cd-1.2 | https://www.scummvm.org/games |
| [`bc`](bc/) | bc | 6.5.0 | https://github.com/gavinhoward/bc | | [`bc`](bc/) | bc | 6.5.0 | https://github.com/gavinhoward/bc |
| [`bdwgc`](bdwgc/) | Boehm-Demers-Weiser Garbage Collector (libgc) | 8.0.6 | https://github.com/ivmai/bdwgc | | [`bdwgc`](bdwgc/) | Boehm-Demers-Weiser Garbage Collector (libgc) | 8.2.2 | https://github.com/ivmai/bdwgc |
| [`binutils`](binutils/) | GNU Binutils | 2.40 | https://www.gnu.org/software/binutils/ | | [`binutils`](binutils/) | GNU Binutils | 2.40 | https://www.gnu.org/software/binutils/ |
| [`bison`](bison/) | GNU Bison | 1.25 | https://www.gnu.org/software/bison/ | | [`bison`](bison/) | GNU Bison | 1.25 | https://www.gnu.org/software/bison/ |
| [`bochs`](bochs/) | Bochs x86 PC emulator | 2.7 | https://sourceforge.net/projects/bochs/ | | [`bochs`](bochs/) | Bochs x86 PC emulator | 2.7 | https://sourceforge.net/projects/bochs/ |

View file

@ -1,14 +1,14 @@
#!/usr/bin/env -S bash ../.port_include.sh #!/usr/bin/env -S bash ../.port_include.sh
port=bdwgc port='bdwgc'
version=8.0.6 version='8.2.2'
use_fresh_config_sub=true use_fresh_config_sub='true'
files="https://github.com/ivmai/bdwgc/releases/download/v$version/gc-$version.tar.gz bdwgc.tar.gz 3b4914abc9fa76593596773e4da671d7ed4d5390e3d46fbf2e5f155e121bea11" files="https://github.com/ivmai/bdwgc/releases/download/v$version/gc-$version.tar.gz bdwgc.tar.gz f30107bcb062e0920a790ffffa56d9512348546859364c23a14be264b38836a0"
depends=(libatomic_ops) depends=("libatomic_ops")
workdir=gc-$version workdir="gc-$version"
auth_type=sha256 auth_type='sha256'
useconfigure=true useconfigure='true'
configopts=("--enable-threads=posix") configopts=("--enable-threads=posix")
pre_configure() { pre_configure() {
run ./autogen.sh run ./autogen.sh

View file

@ -1,20 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <ali.mpfard@gmail.com> From: Ali Mohammad Pur <ali.mpfard@gmail.com>
Date: Thu, 24 Feb 2022 01:00:57 +0330 Date: Mon, 27 Mar 2023 20:03:03 +1100
Subject: [PATCH] Teach os_dep and gcconfig.h about serenity Subject: [PATCH] Teach os_dep and gcconfig.h about serenity
--- ---
include/private/gcconfig.h | 48 +++++++++++++++++++++++++++++++++++--- include/private/gcconfig.h | 32 +++++++++++++++++++++++++++++---
os_dep.c | 34 ++++++++++++++++++++------- os_dep.c | 32 ++++++++++++++++++++++++--------
2 files changed, 70 insertions(+), 12 deletions(-) 2 files changed, 53 insertions(+), 11 deletions(-)
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index 1979c58..e9d1d42 100644 index 2de01af..8e9fb29 100644
--- a/include/private/gcconfig.h --- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h +++ b/include/private/gcconfig.h
@@ -351,6 +351,15 @@ EXTERN_C_BEGIN @@ -337,6 +337,15 @@ EXTERN_C_BEGIN
# define HAIKU # endif
# define mach_type_known # define mach_type_known
# endif # endif
+# if defined(__serenity__) +# if defined(__serenity__)
+# define SERENITY +# define SERENITY
@ -25,13 +25,13 @@ index 1979c58..e9d1d42 100644
+# define X86_64 +# define X86_64
+# endif +# endif
+#endif +#endif
# if defined(__HAIKU__) && (defined(__amd64__) || defined(__x86_64__)) # if (defined(__BEOS__) || defined(__HAIKU__)) && defined(_X86_)
# define X86_64 # define I386
# define HAIKU # define HAIKU
@@ -1377,6 +1386,22 @@ EXTERN_C_BEGIN @@ -1058,6 +1067,23 @@ EXTERN_C_BEGIN
# define DYNAMIC_LOADING
# define MPROTECT_VDB
# endif # endif
# endif /* OPENBSD */
+# ifdef SERENITY +# ifdef SERENITY
+# define OS_TYPE "SERENITY" +# define OS_TYPE "SERENITY"
+ EXTERN_C_END + EXTERN_C_END
@ -48,34 +48,11 @@ index 1979c58..e9d1d42 100644
+# define USE_MMAP 1 +# define USE_MMAP 1
+# endif +# endif
+# endif +# endif
# ifdef SOLARIS +
# define OS_TYPE "SOLARIS" # ifdef SOLARIS
extern int _etext[], _end[]; # define OS_TYPE "SOLARIS"
@@ -2727,6 +2752,23 @@ EXTERN_C_BEGIN extern int _etext[], _end[];
# define DYNAMIC_LOADING @@ -2703,7 +2729,7 @@ EXTERN_C_BEGIN
# define MPROTECT_VDB
# endif
+# ifdef SERENITY
+# define OS_TYPE "SERENITY"
+ EXTERN_C_END
+# include <unistd.h>
+ EXTERN_C_BEGIN
+# define GETPAGESIZE() (unsigned)sysconf(_SC_PAGESIZE)
+# define HEURISTIC2
+ extern int etext[], _end[];
+# define DATASTART ((ptr_t)((((word)(etext)) + 0xfff) & ~0xfff))
+# define DATAEND ((ptr_t)(_end))
+# define DYNAMIC_LOADING
+# define MPROTECT_VDB
+# define USE_MMAP_ANON
+# ifndef USE_MMAP
+# define USE_MMAP 1
+# endif
+# endif
# ifdef SOLARIS
# define OS_TYPE "SOLARIS"
# define ELF_CLASS ELFCLASS64
@@ -3068,7 +3110,7 @@ EXTERN_C_BEGIN
#if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \ #if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \
|| defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \ || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
|| defined(DGUX) || defined(BSD) || defined(HAIKU) || defined(HURD) \ || defined(DGUX) || defined(BSD) || defined(HAIKU) || defined(HURD) \
@ -84,7 +61,7 @@ index 1979c58..e9d1d42 100644
# define UNIX_LIKE /* Basic Unix-like system calls work. */ # define UNIX_LIKE /* Basic Unix-like system calls work. */
#endif #endif
@@ -3118,7 +3160,7 @@ EXTERN_C_BEGIN @@ -2753,7 +2779,7 @@ EXTERN_C_BEGIN
#if defined(DARWIN) || defined(FREEBSD) || defined(HAIKU) \ #if defined(DARWIN) || defined(FREEBSD) || defined(HAIKU) \
|| defined(IRIX5) || defined(LINUX) || defined(NETBSD) \ || defined(IRIX5) || defined(LINUX) || defined(NETBSD) \
@ -93,7 +70,7 @@ index 1979c58..e9d1d42 100644
|| ((defined(CYGWIN32) || defined(USE_MMAP) || defined(USE_MUNMAP)) \ || ((defined(CYGWIN32) || defined(USE_MMAP) || defined(USE_MUNMAP)) \
&& !defined(USE_WINALLOC)) && !defined(USE_WINALLOC))
/* Try both sbrk and mmap, in that order. */ /* Try both sbrk and mmap, in that order. */
@@ -3223,7 +3265,7 @@ EXTERN_C_BEGIN @@ -2880,7 +2906,7 @@ EXTERN_C_BEGIN
#if ((defined(UNIX_LIKE) && (defined(DARWIN) || defined(HAIKU) \ #if ((defined(UNIX_LIKE) && (defined(DARWIN) || defined(HAIKU) \
|| defined(HURD) || defined(OPENBSD) \ || defined(HURD) || defined(OPENBSD) \
@ -103,10 +80,10 @@ index 1979c58..e9d1d42 100644
|| defined(NIOS2) || defined(OR1K))) \ || defined(NIOS2) || defined(OR1K))) \
|| (defined(LINUX) && !defined(__gnu_linux__)) \ || (defined(LINUX) && !defined(__gnu_linux__)) \
diff --git a/os_dep.c b/os_dep.c diff --git a/os_dep.c b/os_dep.c
index b183423..a6d62b9 100644 index eaf5bb0..afd73f7 100644
--- a/os_dep.c --- a/os_dep.c
+++ b/os_dep.c +++ b/os_dep.c
@@ -845,6 +845,22 @@ GC_INNER size_t GC_page_size = 0; @@ -854,6 +854,22 @@ GC_INNER size_t GC_page_size = 0;
# define HAVE_GET_STACK_BASE # define HAVE_GET_STACK_BASE
#endif /* HAIKU */ #endif /* HAIKU */
@ -129,34 +106,34 @@ index b183423..a6d62b9 100644
#ifdef OS2 #ifdef OS2
GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb) GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb)
{ {
@@ -873,7 +889,7 @@ GC_INNER size_t GC_page_size = 0; @@ -882,7 +898,7 @@ GC_INNER size_t GC_page_size = 0;
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \ # if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \
|| defined(HAIKU) || defined(HURD) || defined(FREEBSD) \ || defined(HAIKU) || defined(HURD) || defined(FREEBSD) \
- || defined(NETBSD) - || defined(NETBSD)
+ || defined(NETBSD) || defined(SERENITY) + || defined(NETBSD) || defined(SERENITY)
static struct sigaction old_segv_act; static struct sigaction old_segv_act;
# if defined(_sigargs) /* !Irix6.x */ \ # if defined(_sigargs) /* !Irix6.x */ || defined(HPUX) \
|| defined(HURD) || defined(NETBSD) || defined(FREEBSD) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
@@ -890,7 +906,7 @@ GC_INNER size_t GC_page_size = 0; @@ -899,7 +915,7 @@ GC_INNER size_t GC_page_size = 0;
{ {
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \ # if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \
|| defined(HAIKU) || defined(HURD) || defined(FREEBSD) \ || defined(HAIKU) || defined(HURD) || defined(FREEBSD) \
- || defined(NETBSD) - || defined(NETBSD) || defined(OPENBSD)
+ || defined(NETBSD) || defined(SERENITY) + || defined(NETBSD) || defined(OPENBSD) || defined(SERENITY)
struct sigaction act; struct sigaction act;
act.sa_handler = h; act.sa_handler = h;
@@ -955,7 +971,7 @@ GC_INNER size_t GC_page_size = 0; @@ -965,7 +981,7 @@ GC_INNER size_t GC_page_size = 0;
{ {
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \ # if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \
|| defined(HAIKU) || defined(HURD) || defined(FREEBSD) \ || defined(HAIKU) || defined(HURD) || defined(FREEBSD) \
- || defined(NETBSD) - || defined(NETBSD) || defined(OPENBSD)
+ || defined(NETBSD) || defined(SERENITY) + || defined(NETBSD) || defined(OPENBSD) || defined(SERENITY)
(void) sigaction(SIGSEGV, &old_segv_act, 0); (void) sigaction(SIGSEGV, &old_segv_act, 0);
# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \ # if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
|| defined(HURD) || defined(NETBSD) || defined(HPUX) || defined(HURD) || defined(NETBSD) \
@@ -1227,7 +1243,7 @@ GC_INNER size_t GC_page_size = 0; @@ -1253,7 +1269,7 @@ GC_INNER size_t GC_page_size = 0;
# define GET_MAIN_STACKBASE_SPECIAL # define GET_MAIN_STACKBASE_SPECIAL
#elif !defined(AMIGA) && !defined(HAIKU) && !defined(OS2) \ #elif !defined(AMIGA) && !defined(HAIKU) && !defined(OS2) \
&& !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32) \ && !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32) \
@ -165,7 +142,7 @@ index b183423..a6d62b9 100644
&& (!defined(GC_SOLARIS_THREADS) || defined(_STRICT_STDC)) && (!defined(GC_SOLARIS_THREADS) || defined(_STRICT_STDC))
# if (defined(HAVE_PTHREAD_ATTR_GET_NP) || defined(HAVE_PTHREAD_GETATTR_NP)) \ # if (defined(HAVE_PTHREAD_ATTR_GET_NP) || defined(HAVE_PTHREAD_GETATTR_NP)) \
@@ -1328,7 +1344,7 @@ GC_INNER size_t GC_page_size = 0; @@ -1356,7 +1372,7 @@ GC_INNER size_t GC_page_size = 0;
return(result); return(result);
} }
# define GET_MAIN_STACKBASE_SPECIAL # define GET_MAIN_STACKBASE_SPECIAL
@ -174,25 +151,16 @@ index b183423..a6d62b9 100644
#if (defined(HAVE_PTHREAD_ATTR_GET_NP) || defined(HAVE_PTHREAD_GETATTR_NP)) \ #if (defined(HAVE_PTHREAD_ATTR_GET_NP) || defined(HAVE_PTHREAD_GETATTR_NP)) \
&& defined(THREADS) && !defined(HAVE_GET_STACK_BASE) && defined(THREADS) && !defined(HAVE_GET_STACK_BASE)
@@ -2584,7 +2600,7 @@ GC_INNER void GC_unmap(ptr_t start, size_t bytes) @@ -2647,7 +2663,7 @@ static void block_unmap_inner(ptr_t start_addr, size_t len)
/* accidentally grabbing the same address space. */ ps3_free_mem(start_addr, len);
{ # elif defined(AIX) || defined(CYGWIN32) || defined(HAIKU) \
# if defined(AIX) || defined(CYGWIN32) || defined(HAIKU) \ || (defined(LINUX) && !defined(PREFER_MMAP_PROT_NONE)) \
- || defined(HPUX) - || defined(HPUX)
+ || defined(HPUX) || defined(SERENITY) + || defined(HPUX) || defined(SERENITY)
/* On AIX, mmap(PROT_NONE) fails with ENOMEM unless the */ /* On AIX, mmap(PROT_NONE) fails with ENOMEM unless the */
/* environment variable XPG_SUS_ENV is set to ON. */ /* environment variable XPG_SUS_ENV is set to ON. */
/* On Cygwin, calling mmap() with the new protection flags on */ /* On Cygwin, calling mmap() with the new protection flags on */
@@ -2715,7 +2731,7 @@ GC_INNER void GC_unmap_gap(ptr_t start1, size_t bytes1, ptr_t start2, @@ -3140,7 +3156,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void)
if (len != 0) {
/* Immediately remap as above. */
# if defined(AIX) || defined(CYGWIN32) || defined(HAIKU) \
- || defined(HPUX)
+ || defined(HPUX) || defined(SERENITY)
if (mprotect(start_addr, len, PROT_NONE))
ABORT("mprotect(PROT_NONE) failed");
# else
@@ -3035,7 +3051,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void)
# elif !defined(USE_WINALLOC) # elif !defined(USE_WINALLOC)
# include <sys/mman.h> # include <sys/mman.h>
# include <signal.h> # include <signal.h>
@ -201,7 +169,7 @@ index b183423..a6d62b9 100644
# include <sys/syscall.h> # include <sys/syscall.h>
# endif # endif
@@ -3160,7 +3176,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void) @@ -3255,7 +3271,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void)
# define CODE_OK (si -> si_code == 2 /* experimentally determined */) # define CODE_OK (si -> si_code == 2 /* experimentally determined */)
# elif defined(IRIX5) # elif defined(IRIX5)
# define CODE_OK (si -> si_code == EACCES) # define CODE_OK (si -> si_code == EACCES)

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <ali.mpfard@gmail.com> From: Ali Mohammad Pur <ali.mpfard@gmail.com>
Date: Thu, 24 Feb 2022 01:50:40 +0330 Date: Mon, 27 Mar 2023 20:04:41 +1100
Subject: [PATCH] Error on unknown arch Subject: [PATCH] Error on unknown arch
--- ---
@ -8,10 +8,10 @@ Subject: [PATCH] Error on unknown arch
1 file changed, 2 insertions(+) 1 file changed, 2 insertions(+)
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index e9d1d42..8e48b66 100644 index 2126a12..7b8b86f 100644
--- a/include/private/gcconfig.h --- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h +++ b/include/private/gcconfig.h
@@ -358,6 +358,8 @@ EXTERN_C_BEGIN @@ -344,6 +344,8 @@ EXTERN_C_BEGIN
# define I386 # define I386
# elif defined(__x86_64__) # elif defined(__x86_64__)
# define X86_64 # define X86_64
@ -19,4 +19,4 @@ index e9d1d42..8e48b66 100644
+# error "Invalid arch for serenity" +# error "Invalid arch for serenity"
# endif # endif
#endif #endif
# if defined(__HAIKU__) && (defined(__amd64__) || defined(__x86_64__)) # if (defined(__BEOS__) || defined(__HAIKU__)) && defined(_X86_)

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <ali.mpfard@gmail.com> From: Ali Mohammad Pur <ali.mpfard@gmail.com>
Date: Thu, 24 Feb 2022 01:54:50 +0330 Date: Mon, 27 Mar 2023 20:07:46 +1100
Subject: [PATCH] Teach dyn_load.c about serenity Subject: [PATCH] Teach dyn_load.c about serenity
--- ---
@ -8,27 +8,27 @@ Subject: [PATCH] Teach dyn_load.c about serenity
1 file changed, 20 insertions(+), 3 deletions(-) 1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/dyn_load.c b/dyn_load.c diff --git a/dyn_load.c b/dyn_load.c
index d857246..734643d 100644 index 46c53af..9026932 100644
--- a/dyn_load.c --- a/dyn_load.c
+++ b/dyn_load.c +++ b/dyn_load.c
@@ -60,7 +60,7 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0; @@ -63,7 +63,7 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
&& !(defined(FREEBSD) && defined(__ELF__)) \
&& !((defined(LINUX) || defined(NACL)) && defined(__ELF__)) \
&& !(defined(NETBSD) && defined(__ELF__)) \ && !(defined(NETBSD) && defined(__ELF__)) \
- && !defined(HAIKU) && !defined(HURD) \
+ && !defined(HAIKU) && !defined(HURD) && !defined(SERENITY) \
&& !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) \ && !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) \
&& !defined(CPPCHECK) && !defined(HAIKU) && !defined(HURD) && !defined(NACL) \
- && !defined(CPPCHECK)
+ && !defined(CPPCHECK) && !defined(SERENITY)
# error We only know how to find data segments of dynamic libraries for above. # error We only know how to find data segments of dynamic libraries for above.
@@ -88,7 +88,7 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0; # error Additional SVR4 variants might not be too hard to add.
#endif
@@ -89,7 +89,7 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
# endif # endif
#endif /* OPENBSD */ #endif /* OPENBSD */
-#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \ -#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) || defined(NACL) \
+#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) || defined(SERENITY) \ +#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) || defined(NACL) || defined(SERENITY) \
|| (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \ || (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
|| defined(NACL) || defined(NETBSD) \ || defined(NETBSD) || defined(OPENBSD)))
|| defined(OPENBSD))) # include <stddef.h>
@@ -98,6 +98,23 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0; @@ -98,6 +98,23 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
/* Exclude Android because linker.h below includes its own version. */ /* Exclude Android because linker.h below includes its own version. */
# include <elf.h> # include <elf.h>
@ -53,12 +53,12 @@ index d857246..734643d 100644
# ifdef HOST_ANDROID # ifdef HOST_ANDROID
/* If you don't need the "dynamic loading" feature, you may build */ /* If you don't need the "dynamic loading" feature, you may build */
/* the collector with -D IGNORE_DYNAMIC_LOADING. */ /* the collector with -D IGNORE_DYNAMIC_LOADING. */
@@ -259,7 +276,7 @@ GC_INNER void GC_register_dynamic_libraries(void) @@ -261,7 +278,7 @@ GC_INNER void GC_register_dynamic_libraries(void)
# endif /* !USE_PROC ... */ # endif /* !USE_PROC ... */
# endif /* SOLARISDL */ # endif /* SOLARISDL */
-#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \ -#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) || defined(NACL) \
+#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) || defined(SERENITY) \ +#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) || defined(NACL) || defined(SERENITY) \
|| (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \ || (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
|| defined(NACL) || defined(NETBSD) \ || defined(NETBSD) || defined(OPENBSD)))
|| defined(OPENBSD)))

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <ali.mpfard@gmail.com> From: Ali Mohammad Pur <ali.mpfard@gmail.com>
Date: Thu, 24 Feb 2022 03:30:02 +0330 Date: Mon, 27 Mar 2023 20:10:51 +1100
Subject: [PATCH] Teach bdwgc about serenity signals Subject: [PATCH] Teach bdwgc about serenity signals
Serenity doesn't have the realtime POSIX signals, so use SIGXCPU and Serenity doesn't have the realtime POSIX signals, so use SIGXCPU and
@ -12,10 +12,10 @@ SIGXFSZ instead.
3 files changed, 7 insertions(+), 3 deletions(-) 3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h
index 14c65ee..c19b050 100644 index 3bbc5fe..da783ce 100644
--- a/include/gc_config_macros.h --- a/include/gc_config_macros.h
+++ b/include/gc_config_macros.h +++ b/include/gc_config_macros.h
@@ -72,7 +72,7 @@ @@ -73,7 +73,7 @@
#if defined(GC_AIX_THREADS) || defined(GC_DARWIN_THREADS) \ #if defined(GC_AIX_THREADS) || defined(GC_DARWIN_THREADS) \
|| defined(GC_DGUX386_THREADS) || defined(GC_FREEBSD_THREADS) \ || defined(GC_DGUX386_THREADS) || defined(GC_FREEBSD_THREADS) \
@ -24,7 +24,7 @@ index 14c65ee..c19b050 100644
|| defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \ || defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \ || defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \
|| defined(GC_OSF1_THREADS) || defined(GC_SOLARIS_THREADS) \ || defined(GC_OSF1_THREADS) || defined(GC_SOLARIS_THREADS) \
@@ -83,6 +83,8 @@ @@ -84,6 +84,8 @@
#elif defined(GC_THREADS) #elif defined(GC_THREADS)
# if defined(__linux__) # if defined(__linux__)
# define GC_LINUX_THREADS # define GC_LINUX_THREADS
@ -34,23 +34,23 @@ index 14c65ee..c19b050 100644
# define GC_OPENBSD_THREADS # define GC_OPENBSD_THREADS
# elif defined(_PA_RISC1_1) || defined(_PA_RISC2_0) || defined(hppa) \ # elif defined(_PA_RISC1_1) || defined(_PA_RISC2_0) || defined(hppa) \
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h
index 629418f..1278091 100644 index b26543e..23e911e 100644
--- a/include/private/gc_priv.h --- a/include/private/gc_priv.h
+++ b/include/private/gc_priv.h +++ b/include/private/gc_priv.h
@@ -2641,7 +2641,7 @@ GC_INNER void *GC_store_debug_info_inner(void *p, word sz, const char *str, @@ -2985,7 +2985,7 @@ GC_INNER void *GC_store_debug_info_inner(void *p, word sz, const char *str,
/* Linuxthreads itself uses SIGUSR1 and SIGUSR2. */ && !defined(GC_USESIGRT_SIGNALS)
# define SIG_SUSPEND SIGPWR # define SIG_SUSPEND SIGUSR1
# endif /* SIGTSTP and SIGCONT could be used alternatively on FreeBSD. */
-# elif defined(GC_OPENBSD_THREADS) -# elif defined(GC_OPENBSD_THREADS) && !defined(GC_USESIGRT_SIGNALS)
+# elif defined(GC_OPENBSD_THREADS) || defined(GC_SERENITY_THREADS) +# elif (defined(GC_OPENBSD_THREADS) && !defined(GC_USESIGRT_SIGNALS)) || defined(GC_SERENITY_THREADS)
# ifndef GC_OPENBSD_UTHREADS # ifndef GC_OPENBSD_UTHREADS
# define SIG_SUSPEND SIGXFSZ # define SIG_SUSPEND SIGXFSZ
# endif # endif
diff --git a/pthread_stop_world.c b/pthread_stop_world.c diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 4b2c429..25eb2a5 100644 index b865d30..f0cf1a6 100644
--- a/pthread_stop_world.c --- a/pthread_stop_world.c
+++ b/pthread_stop_world.c +++ b/pthread_stop_world.c
@@ -146,7 +146,9 @@ STATIC volatile AO_t GC_world_is_stopped = FALSE; @@ -165,7 +165,9 @@ STATIC volatile AO_t GC_world_is_stopped = FALSE;
* pointer(s) and acknowledge. * pointer(s) and acknowledge.
*/ */
#ifndef SIG_THR_RESTART #ifndef SIG_THR_RESTART

View file

@ -1,70 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <ali.mpfard@gmail.com>
Date: Thu, 24 Feb 2022 03:47:50 +0330
Subject: [PATCH] Explicitly link with pthread
The cmakelists was using the wrong variable to link against pthread.
---
CMakeLists.txt | 5 +++--
tests/CMakeLists.txt | 12 ++++++------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8ebd9b..e9c52f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,7 +52,8 @@ IF(enable_threads)
FIND_PACKAGE(Threads REQUIRED)
MESSAGE("Thread Model: ${CMAKE_THREAD_LIBS_INIT}" )
INCLUDE_DIRECTORIES(${Threads_INCLUDE_DIR})
- SET(LIBS ${LIBS} ${Threads_LIBRARIES})
+ SET(LIBS ${LIBS} ${Threads_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+ MESSAGE("Libs: ${LIBS}" )
ENDIF(enable_threads)
OPTION(enable_handle_fork "Attempt to ensure a usable collector after fork()" ON)
@@ -235,7 +236,7 @@ ENDIF(enable_checksums)
ADD_LIBRARY( gc-lib STATIC ${SRC})
SET_TARGET_PROPERTIES(gc-lib PROPERTIES
COMPILE_DEFINITIONS GC_NOT_DLL)
-#TODO TARGET_LINK_LIBRARIES(... ... ${LIBS})
+TARGET_LINK_LIBRARIES(gc-lib ${LIBS})
ADD_LIBRARY( gcmt-dll SHARED ${SRC})
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 3c84220..5e15727 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -23,25 +23,25 @@ SET_SOURCE_FILES_PROPERTIES(
PROPERTIES LANGUAGE CXX)
ADD_EXECUTABLE(gctest WIN32 test.c)
-TARGET_LINK_LIBRARIES(gctest gc-lib)
+TARGET_LINK_LIBRARIES(gctest gc-lib ${LIBS})
ADD_TEST(NAME gctest COMMAND gctest)
ADD_EXECUTABLE(hugetest huge_test.c)
-TARGET_LINK_LIBRARIES(hugetest gc-lib)
+TARGET_LINK_LIBRARIES(hugetest gc-lib ${LIBS})
ADD_TEST(NAME hugetest COMMAND hugetest)
ADD_EXECUTABLE(leaktest leak_test.c)
-TARGET_LINK_LIBRARIES(leaktest gc-lib)
+TARGET_LINK_LIBRARIES(leaktest gc-lib ${LIBS})
ADD_TEST(NAME leaktest COMMAND leaktest)
ADD_EXECUTABLE(middletest middle.c)
-TARGET_LINK_LIBRARIES(middletest gc-lib)
+TARGET_LINK_LIBRARIES(middletest gc-lib ${LIBS})
ADD_TEST(NAME middletest COMMAND middletest)
ADD_EXECUTABLE(realloc_test realloc_test.c)
-TARGET_LINK_LIBRARIES(realloc_test gc-lib)
+TARGET_LINK_LIBRARIES(realloc_test gc-lib ${LIBS})
ADD_TEST(NAME realloc_test COMMAND realloc_test)
ADD_EXECUTABLE(smashtest smash_test.c)
-TARGET_LINK_LIBRARIES(smashtest gc-lib)
+TARGET_LINK_LIBRARIES(smashtest gc-lib ${LIBS})
ADD_TEST(NAME smashtest COMMAND smashtest)

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <ali.mpfard@gmail.com> From: Ali Mohammad Pur <ali.mpfard@gmail.com>
Date: Fri, 25 Feb 2022 04:53:53 +0330 Date: Mon, 27 Mar 2023 20:14:33 +1100
Subject: [PATCH] Make the collector build with threads Subject: [PATCH] Make the collector build with threads
In an extremely limited way for now: In an extremely limited way for now:
@ -18,32 +18,32 @@ In an extremely limited way for now:
2 files changed, 6 insertions(+), 2 deletions(-) 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9c52f1..7c9daad 100644 index 50dba74..6fcb550 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -56,7 +56,11 @@ IF(enable_threads) @@ -77,7 +77,11 @@ option(enable_register_main_static_data "Perform the initial guess of data root
MESSAGE("Libs: ${LIBS}" ) option(enable_checksums "Report erroneously cleared dirty bits" OFF)
ENDIF(enable_threads) option(enable_werror "Pass -Werror to the C compiler (treat warnings as errors)" OFF)
option(enable_single_obj_compilation "Compile all libgc source files into single .o" OFF)
-OPTION(enable_handle_fork "Attempt to ensure a usable collector after fork()" ON) -option(enable_handle_fork "Attempt to ensure a usable collector after fork()" ON)
+IF(DEBUG_THREADS) +IF(DEBUG_THREADS)
+ ADD_DEFINITIONS("-DDEBUG_THREADS") + ADD_DEFINITIONS("-DDEBUG_THREADS")
+ENDIF() +ENDIF()
+ +
+OPTION(enable_handle_fork "Attempt to ensure a usable collector after fork()" OFF) +OPTION(enable_handle_fork "Attempt to ensure a usable collector after fork()" OFF)
option(disable_handle_fork "Prohibit installation of pthread_atfork() handlers" OFF)
OPTION(enable_thread_local_alloc "Turn on thread-local allocation optimization" ON) option(install_headers "Install header and pkg-config metadata files" ON)
option(without_libatomic_ops "Use atomic_ops.h in libatomic_ops/src" OFF)
diff --git a/tests/test.c b/tests/test.c diff --git a/tests/test.c b/tests/test.c
index 8e2e3a6..f38fb22 100644 index b41a300..0ad4ea5 100644
--- a/tests/test.c --- a/tests/test.c
+++ b/tests/test.c +++ b/tests/test.c
@@ -40,7 +40,7 @@ @@ -43,7 +43,7 @@
#include "gc.h" #include "gc.h"
#ifndef NTHREADS /* Number of additional threads to fork. */ #ifndef NTHREADS /* Number of additional threads to fork. */
-# define NTHREADS 5 /* excludes main thread, which also runs a test. */ -# define NTHREADS 5 /* Excludes main thread, which also runs a test. */
+# define NTHREADS 0 /* excludes main thread, which also runs a test. */ +# define NTHREADS 0 /* Excludes main thread, which also runs a test. */
/* In the single-threaded case, the number of times to rerun it. */
/* Not respected by PCR test. */ /* Not respected by PCR test. */
#endif #endif

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Elliott <pelliott@ualberta.ca> From: Peter Elliott <pelliott@ualberta.ca>
Date: Mon, 16 May 2022 23:55:41 -0600 Date: Mon, 27 Mar 2023 20:18:18 +1100
Subject: [PATCH] Add serenity to the conigure list of pthread unixes Subject: [PATCH] Add serenity to the conigure list of pthread unixes
--- ---
@ -8,10 +8,10 @@ Subject: [PATCH] Add serenity to the conigure list of pthread unixes
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 3b38e6f..5b6daa4 100644 index 7113d07..e51906c 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -201,7 +201,7 @@ case "$THREADS" in @@ -208,7 +208,7 @@ case "$THREADS" in
*-*-aix* | *-*-android* | *-*-cygwin* | *-*-darwin* | *-*-dragonfly* | \ *-*-aix* | *-*-android* | *-*-cygwin* | *-*-darwin* | *-*-dragonfly* | \
*-*-freebsd* | *-*-haiku* | *-*-hpux11* | *-*-irix* | \ *-*-freebsd* | *-*-haiku* | *-*-hpux11* | *-*-irix* | \
*-*-kfreebsd*-gnu | *-*-gnu* | *-*-*linux* | *-*-msys* | *-*-nacl* | \ *-*-kfreebsd*-gnu | *-*-gnu* | *-*-*linux* | *-*-msys* | *-*-nacl* | \

View file

@ -22,13 +22,7 @@ Teach bdwgc about serenity signals
Serenity doesn't have the realtime POSIX signals, so use SIGXCPU and Serenity doesn't have the realtime POSIX signals, so use SIGXCPU and
SIGXFSZ instead. SIGXFSZ instead.
## `0005-Explicitly-link-with-pthread.patch` ## `0005-Make-the-collector-build-with-threads.patch`
Explicitly link with pthread
The cmakelists was using the wrong variable to link against pthread.
## `0006-Make-the-collector-build-with-threads.patch`
Make the collector build with threads Make the collector build with threads
@ -42,8 +36,6 @@ In an extremely limited way for now:
- No fork handling - No fork handling
Seems borked for unknown reasons. Seems borked for unknown reasons.
## `0007-Add-serenity-to-the-conigure-list-of-pthread-unixes.patch` ## `0006-Add-serenity-to-the-conigure-list-of-pthread-unixes.patch`
Add serenity to the conigure list of pthread unixes Add serenity to the conigure list of pthread unixes