diff -ru gc-7.2alpha6-orig/configure gc-7.2alpha6/configure
|
old
|
new
|
|
| 4969 | 4969 | |
| 4970 | 4970 | |
| 4971 | 4971 | |
| | 4972 | |
| 4972 | 4973 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 |
| 4973 | 4974 | $as_echo_n "checking for inline... " >&6; } |
| 4974 | 4975 | if ${ac_cv_c_inline+:} false; then : |
| … |
… |
|
| 5088 | 5089 | $as_echo "#define _REENTRANT 1" >>confdefs.h |
| 5089 | 5090 | |
| 5090 | 5091 | ;; |
| | 5092 | *-*-haiku*) |
| | 5093 | $as_echo "#define GC_HAIKU_THREADS 1" >>confdefs.h |
| | 5094 | |
| | 5095 | $as_echo "#define _REENTRANT 1" >>confdefs.h |
| | 5096 | |
| | 5097 | ;; |
| 5091 | 5098 | *-*-hpux11*) |
| 5092 | 5099 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only HP/UX 11 POSIX threads are supported.\"" >&5 |
| 5093 | 5100 | $as_echo "$as_me: WARNING: \"Only HP/UX 11 POSIX threads are supported.\"" >&2;} |
diff -ru gc-7.2alpha6-orig/configure.ac gc-7.2alpha6/configure.ac
|
old
|
new
|
|
| 83 | 83 | AH_TEMPLATE([GC_DARWIN_THREADS], [Define to support Darwin pthreads.]) |
| 84 | 84 | AH_TEMPLATE([GC_FREEBSD_THREADS], [Define to support FreeBSD pthreads.]) |
| 85 | 85 | AH_TEMPLATE([GC_GNU_THREADS], [Define to support GNU pthreads.]) |
| | 86 | AH_TEMPLATE([GC_HAIKU_THREADS], [Define to support Haiku pthreads.]) |
| 86 | 87 | AH_TEMPLATE([GC_HPUX_THREADS], [Define to support HP/UX 11 pthreads.]) |
| 87 | 88 | AH_TEMPLATE([GC_IRIX_THREADS], [Define to support Irix pthreads.]) |
| 88 | 89 | AH_TEMPLATE([GC_LINUX_THREADS], [Define to support pthreads on Linux.]) |
| … |
… |
|
| 127 | 128 | AC_DEFINE(GC_AIX_THREADS) |
| 128 | 129 | AC_DEFINE(_REENTRANT) |
| 129 | 130 | ;; |
| | 131 | *-*-haiku*) |
| | 132 | AC_DEFINE(GC_HAIKU_THREADS) |
| | 133 | AC_DEFINE(_REENTRANT) |
| | 134 | ;; |
| 130 | 135 | *-*-hpux11*) |
| 131 | 136 | AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.") |
| 132 | 137 | AC_DEFINE(GC_HPUX_THREADS) |
diff -ru gc-7.2alpha6-orig/dyn_load.c gc-7.2alpha6/dyn_load.c
|
old
|
new
|
|
| 63 | 63 | !(defined(FREEBSD) && defined(__ELF__)) && \ |
| 64 | 64 | !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \ |
| 65 | 65 | !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \ |
| 66 | | !defined(DARWIN) && !defined(CYGWIN32) |
| | 66 | !defined(DARWIN) && !defined(CYGWIN32) && !defined(HAIKU) |
| 67 | 67 | --> We only know how to find data segments of dynamic libraries for the |
| 68 | 68 | --> above. Additional SVR4 variants might not be too |
| 69 | 69 | --> hard to add. |
| … |
… |
|
| 1419 | 1419 | |
| 1420 | 1420 | #endif /* DARWIN */ |
| 1421 | 1421 | |
| | 1422 | #ifdef HAIKU |
| | 1423 | #include <kernel/image.h> |
| | 1424 | |
| | 1425 | GC_INNER void GC_register_dynamic_libraries() |
| | 1426 | { |
| | 1427 | image_info info; |
| | 1428 | int32 cookie = 0; |
| | 1429 | while (get_next_image_info(0, &cookie, &info) == B_OK) |
| | 1430 | { |
| | 1431 | void *data = info.data; |
| | 1432 | GC_add_roots_inner(data, data + info.data_size, TRUE); |
| | 1433 | } |
| | 1434 | } |
| | 1435 | |
| | 1436 | #endif /* HAIKU */ |
| | 1437 | |
| 1422 | 1438 | #elif defined(PCR) |
| 1423 | 1439 | |
| 1424 | 1440 | # include "il/PCR_IL.h" |
diff -ru gc-7.2alpha6-orig/include/gc_config_macros.h gc-7.2alpha6/include/gc_config_macros.h
|
old
|
new
|
|
| 65 | 65 | || defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \ |
| 66 | 66 | || defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \ |
| 67 | 67 | || defined(GC_OSF1_THREADS) || defined(GC_SOLARIS_THREADS) \ |
| 68 | | || defined(GC_WIN32_THREADS) |
| | 68 | || defined(GC_WIN32_THREADS) || defined(GC_HAIKU_THREADS) |
| 69 | 69 | # ifndef GC_THREADS |
| 70 | 70 | # define GC_THREADS |
| 71 | 71 | # endif |
diff -ru gc-7.2alpha6-orig/include/private/config.h.in gc-7.2alpha6/include/private/config.h.in
|
old
|
new
|
|
| 45 | 45 | /* Define to support GNU pthreads. */ |
| 46 | 46 | #undef GC_GNU_THREADS |
| 47 | 47 | |
| | 48 | /* Define to support Haiku pthreads. */ |
| | 49 | #undef GC_HAIKU_THREADS |
| | 50 | |
| 48 | 51 | /* Define if backtrace information is supported. */ |
| 49 | 52 | #undef GC_HAVE_BUILTIN_BACKTRACE |
| 50 | 53 | |
Only in gc-7.2alpha6/include/private: config.h.in~
diff -ru gc-7.2alpha6-orig/include/private/gcconfig.h gc-7.2alpha6/include/private/gcconfig.h
|
old
|
new
|
|
| 234 | 234 | # define BEOS |
| 235 | 235 | # define mach_type_known |
| 236 | 236 | # endif |
| | 237 | # if defined(__HAIKU__) && defined(_X86_) |
| | 238 | # define I386 |
| | 239 | # define HAIKU |
| | 240 | # define mach_type_known |
| | 241 | # endif |
| 237 | 242 | # if defined(OPENBSD) && defined(__amd64__) |
| 238 | 243 | # define X86_64 |
| 239 | 244 | # define mach_type_known |
| … |
… |
|
| 1110 | 1115 | extern int etext[]; |
| 1111 | 1116 | # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) |
| 1112 | 1117 | # endif |
| | 1118 | # ifdef HAIKU |
| | 1119 | # define OS_TYPE "HAIKU" |
| | 1120 | # include <OS.h> |
| | 1121 | # define GETPAGESIZE() B_PAGE_SIZE |
| | 1122 | extern int etext[]; |
| | 1123 | # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) |
| | 1124 | # define DYNAMIC_LOADING |
| | 1125 | # define MPROTECT_VDB |
| | 1126 | # endif |
| 1113 | 1127 | # ifdef SOLARIS |
| 1114 | 1128 | # define OS_TYPE "SOLARIS" |
| 1115 | 1129 | extern int _etext[], _end[]; |
| … |
… |
|
| 2345 | 2359 | #if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \ |
| 2346 | 2360 | || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \ |
| 2347 | 2361 | || defined(DGUX) || defined(BSD) || defined(HURD) \ |
| 2348 | | || defined(AIX) || defined(DARWIN) || defined(OSF1) |
| | 2362 | || defined(AIX) || defined(DARWIN) || defined(OSF1) || defined(HAIKU) |
| 2349 | 2363 | # define UNIX_LIKE /* Basic Unix-like system calls work. */ |
| 2350 | 2364 | #endif |
| 2351 | 2365 | |
| … |
… |
|
| 2423 | 2437 | |
| 2424 | 2438 | #if ((defined(UNIX_LIKE) && (defined(DARWIN) || defined(HURD) \ |
| 2425 | 2439 | || defined(OPENBSD) || defined(ARM32) \ |
| 2426 | | || defined(MIPS) || defined(AVR32))) \ |
| | 2440 | || defined(MIPS) || defined(AVR32) \ |
| | 2441 | || defined(HAIKU))) \ |
| 2427 | 2442 | || (defined(LINUX) && (defined(SPARC) || defined(M68K))) \ |
| 2428 | 2443 | || (defined(RTEMS) && defined(I386))) && !defined(NO_GETCONTEXT) |
| 2429 | 2444 | # define NO_GETCONTEXT |
| … |
… |
|
| 2721 | 2736 | # elif defined(SN_TARGET_PS3) |
| 2722 | 2737 | void *ps3_get_mem(size_t size); |
| 2723 | 2738 | # define GET_MEM(bytes) (struct hblk*)ps3_get_mem(bytes) |
| | 2739 | # elif defined(HAIKU) |
| | 2740 | ptr_t GC_haiku_get_mem(GC_word bytes); |
| | 2741 | # define GET_MEM(bytes) (struct hblk*)GC_haiku_get_mem(bytes) |
| 2724 | 2742 | # else |
| 2725 | 2743 | ptr_t GC_unix_get_mem(GC_word bytes); |
| 2726 | 2744 | # define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes) |
diff -ru gc-7.2alpha6-orig/include/private/thread_local_alloc.h gc-7.2alpha6/include/private/thread_local_alloc.h
|
old
|
new
|
|
| 47 | 47 | # define USE_COMPILER_TLS |
| 48 | 48 | # elif defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) \ |
| 49 | 49 | || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \ |
| 50 | | || defined(GC_NETBSD_THREADS) |
| | 50 | || defined(GC_NETBSD_THREADS) || defined(GC_HAIKU_THREADS) |
| 51 | 51 | # define USE_PTHREAD_SPECIFIC |
| 52 | 52 | # elif defined(GC_HPUX_THREADS) |
| 53 | 53 | # ifdef __GNUC__ |
diff -ru gc-7.2alpha6-orig/os_dep.c gc-7.2alpha6/os_dep.c
|
old
|
new
|
|
| 790 | 790 | } |
| 791 | 791 | #endif /* !MSWIN32 */ |
| 792 | 792 | |
| 793 | | #ifdef BEOS |
| | 793 | #if defined(BEOS) || defined(HAIKU) |
| 794 | 794 | # include <kernel/OS.h> |
| 795 | 795 | |
| 796 | 796 | GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb) |
| … |
… |
|
| 801 | 801 | return GC_SUCCESS; |
| 802 | 802 | } |
| 803 | 803 | # define HAVE_GET_STACK_BASE |
| 804 | | #endif /* BEOS */ |
| | 804 | #endif /* BEOS || HAIKU */ |
| 805 | 805 | |
| 806 | 806 | #ifdef OS2 |
| 807 | 807 | GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb) |
| … |
… |
|
| 1127 | 1127 | # define GET_MAIN_STACKBASE_SPECIAL |
| 1128 | 1128 | #elif !defined(BEOS) && !defined(AMIGA) && !defined(OS2) \ |
| 1129 | 1129 | && !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32) \ |
| 1130 | | && !defined(GC_OPENBSD_THREADS) \ |
| | 1130 | && !defined(GC_OPENBSD_THREADS) && !defined(HAIKU) \ |
| 1131 | 1131 | && (!defined(GC_SOLARIS_THREADS) || defined(_STRICT_STDC)) |
| 1132 | 1132 | |
| 1133 | 1133 | # if defined(LINUX) && defined(USE_GET_STACKBASE_FOR_MAIN) |
| … |
… |
|
| 1977 | 1977 | # if !defined(OS2) && !defined(PCR) && !defined(AMIGA) && !defined(MSWIN32) \ |
| 1978 | 1978 | && !defined(MSWINCE) && !defined(MACOS) && !defined(DOS4GW) \ |
| 1979 | 1979 | && !defined(NONSTOP) && !defined(SN_TARGET_PS3) && !defined(RTEMS) \ |
| 1980 | | && !defined(__CC_ARM) |
| | 1980 | && !defined(__CC_ARM) && !defined(HAIKU) |
| 1981 | 1981 | |
| 1982 | 1982 | # define SBRK_ARG_T ptrdiff_t |
| 1983 | 1983 | |
| … |
… |
|
| 2302 | 2302 | } |
| 2303 | 2303 | #endif |
| 2304 | 2304 | |
| | 2305 | #ifdef HAIKU |
| | 2306 | #include <stdlib.h> |
| | 2307 | |
| | 2308 | ptr_t GC_haiku_get_mem(word bytes) |
| | 2309 | { |
| | 2310 | void* mem; |
| | 2311 | if (posix_memalign(&mem, GC_page_size, bytes) == 0) |
| | 2312 | return mem; |
| | 2313 | else |
| | 2314 | return NULL; |
| | 2315 | } |
| | 2316 | #endif |
| | 2317 | |
| 2305 | 2318 | #ifdef USE_MUNMAP |
| 2306 | 2319 | |
| 2307 | 2320 | /* For now, this only works on Win32/WinCE and some Unix-like */ |
| … |
… |
|
| 2903 | 2916 | # elif !defined(MSWIN32) && !defined(MSWINCE) |
| 2904 | 2917 | # include <sys/mman.h> |
| 2905 | 2918 | # include <signal.h> |
| 2906 | | # include <sys/syscall.h> |
| | 2919 | # if !defined(HAIKU) |
| | 2920 | # include <sys/syscall.h> |
| | 2921 | # endif |
| 2907 | 2922 | |
| 2908 | 2923 | # define PROTECT(addr, len) \ |
| 2909 | 2924 | if (mprotect((caddr_t)(addr), (size_t)(len), \ |
| … |
… |
|
| 3062 | 3077 | /* Empirically c.trapno == 14, on IA32, but is that useful? */ |
| 3063 | 3078 | /* Should probably consider alignment issues on other */ |
| 3064 | 3079 | /* architectures. */ |
| | 3080 | # elif defined(HAIKU) |
| | 3081 | # define CODE_OK TRUE |
| 3065 | 3082 | # elif defined(HPUX) |
| 3066 | 3083 | # define CODE_OK (si -> si_code == SEGV_ACCERR \ |
| 3067 | 3084 | || si -> si_code == BUS_ADRERR \ |
diff -ru gc-7.2alpha6-orig/pthread_support.c gc-7.2alpha6/pthread_support.c
|
old
|
new
|
|
| 938 | 938 | GC_nprocs = pthread_num_processors_np(); |
| 939 | 939 | # elif defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \ |
| 940 | 940 | || defined(GC_SOLARIS_THREADS) || defined(GC_GNU_THREADS) \ |
| 941 | | || defined(PLATFORM_ANDROID) || defined(NACL) |
| | 941 | || defined(PLATFORM_ANDROID) || defined(NACL) \ |
| | 942 | || defined(GC_HAIKU_THREADS) |
| 942 | 943 | GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN); |
| 943 | 944 | if (GC_nprocs <= 0) GC_nprocs = 1; |
| 944 | 945 | # elif defined(GC_IRIX_THREADS) |