Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin <calvin@cmpct.info>2017-12-06 23:43:20 +0300
committerLudovic Henry <luhenry@microsoft.com>2017-12-06 23:43:20 +0300
commit5a581fb229331e0ebb0fd08065ff6d6164b8af85 (patch)
treee60bac229bda0644687503cabd64b308c31ce00f /libgc/dyn_load.c
parentb683e1076ab0c42dbb0effe12c0f199976e083db (diff)
Compile on amd64 Haiku (#4473)
* Compile on amd64 Haiku Use sigcontext (somewhat like win32, or x86) on Haiku amd64. On amd64, Haiku doesn't have issues with marshalling 64-bit values, but it currently does have issues with SGen either causing a stall or a core dump. As such, while it can compile the stdlib (further than x86 got), it's still a work in progress. * Use set_real_time_clock for sys-time.c on Haiku * Get mono-boehm compiling on Haiku again It still doesn't work. Initialization will call GC_mark_from, which will cause a segmentation fault as it decrements pointers. (Mono will enter an infinite loop in mono_get_hazardous_pointer as a result.) For now, mono-sgen will continue to be used by default.
Diffstat (limited to 'libgc/dyn_load.c')
-rw-r--r--libgc/dyn_load.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libgc/dyn_load.c b/libgc/dyn_load.c
index 5db3503aacb..963f6e95427 100644
--- a/libgc/dyn_load.c
+++ b/libgc/dyn_load.c
@@ -59,7 +59,7 @@
!(defined(FREEBSD) && defined(__ELF__)) && \
!(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
- !defined(DARWIN)
+ !defined(DARWIN) && !defined(HAIKU)
--> We only know how to find data segments of dynamic libraries for the
--> above. Additional SVR4 variants might not be too
--> hard to add.
@@ -1258,6 +1258,23 @@ GC_bool GC_register_main_static_data()
#endif /* DARWIN */
+#if defined(HAIKU)
+
+#include <kernel/image.h>
+
+void GC_register_dynamic_libraries()
+{
+ image_info info;
+ int32 cookie = 0;
+ while (get_next_image_info(0, &cookie, &info) == B_OK)
+ {
+ void *data = info.data;
+ GC_add_roots_inner(data, data + info.data_size, TRUE);
+ }
+}
+
+#endif /* HAIKU */
+
#else /* !DYNAMIC_LOADING */
#ifdef PCR