mirror of
https://github.com/RGBCube/serenity
synced 2025-07-30 21:57:44 +00:00
Ports: Add a bdwgc (aka libgc) port
For all your ports' garbage collection needs :^)
This commit is contained in:
parent
5d51e26caf
commit
ce9f355b12
9 changed files with 568 additions and 0 deletions
|
@ -0,0 +1,67 @@
|
|||
From a7fd9227e9111502a6134666d6636a8695c36f4e Mon Sep 17 00:00:00 2001
|
||||
From: Ali Mohammad Pur <ali.mpfard@gmail.com>
|
||||
Date: Thu, 24 Feb 2022 01:54:50 +0330
|
||||
Subject: [PATCH 3/6] Teach dyn_load.c about serenity
|
||||
|
||||
---
|
||||
dyn_load.c | 23 ++++++++++++++++++++---
|
||||
1 file changed, 20 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dyn_load.c b/dyn_load.c
|
||||
index d857246..734643d 100644
|
||||
--- a/dyn_load.c
|
||||
+++ b/dyn_load.c
|
||||
@@ -60,7 +60,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(HAIKU) && !defined(HURD) \
|
||||
+ && !defined(HAIKU) && !defined(HURD) && !defined(SERENITY) \
|
||||
&& !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) \
|
||||
&& !defined(CPPCHECK)
|
||||
# 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;
|
||||
# endif
|
||||
#endif /* OPENBSD */
|
||||
|
||||
-#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \
|
||||
+#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) || defined(SERENITY) \
|
||||
|| (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
|
||||
|| defined(NACL) || defined(NETBSD) \
|
||||
|| defined(OPENBSD)))
|
||||
@@ -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. */
|
||||
# include <elf.h>
|
||||
# endif
|
||||
+# ifdef SERENITY
|
||||
+# include <link.h>
|
||||
+ struct link_map {
|
||||
+ uintptr_t l_addr;
|
||||
+ char* l_name;
|
||||
+ uintptr_t l_ld;
|
||||
+ struct link_map* l_next;
|
||||
+ struct link_map* l_prev;
|
||||
+ };
|
||||
+ struct r_debug {
|
||||
+ int32_t r_version;
|
||||
+ struct link_map* r_map;
|
||||
+ void (*r_brk)(void);
|
||||
+ int32_t r_state;
|
||||
+ uintptr_t r_ldbase;
|
||||
+ };
|
||||
+# endif
|
||||
# ifdef HOST_ANDROID
|
||||
/* If you don't need the "dynamic loading" feature, you may build */
|
||||
/* the collector with -D IGNORE_DYNAMIC_LOADING. */
|
||||
@@ -259,7 +276,7 @@ GC_INNER void GC_register_dynamic_libraries(void)
|
||||
# endif /* !USE_PROC ... */
|
||||
# endif /* SOLARISDL */
|
||||
|
||||
-#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \
|
||||
+#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) || defined(SERENITY) \
|
||||
|| (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
|
||||
|| defined(NACL) || defined(NETBSD) \
|
||||
|| defined(OPENBSD)))
|
||||
--
|
||||
2.35.1
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue