Initial support of Haiku/amd64
(back-port of commits
847927f,
2396ce1 from 'master')
* configure.ac (GC_HAIKU_THREADS): New AH_TEMPLATE.
* configure.ac [THREADS=posix && host=*-*-haiku*] (GC_THREADS,
_REENTRANT): Define macro.
* include/gc_config_macros.h [!GC_THREADS && GC_HAIKU_THREADS]
(GC_THREADS): Likewise.
* include/gc_config_macros.h [GC_THREADS && __HAIKU__]
(GC_HAIKU_THREADS): Likewise.
* include/gc_config_macros.h [__HAIKU__ && !GC_CAN_SAVE_CALL_STACKS]
(GC_ADD_CALLER): Define macro.
* include/private/gcconfig.h [__HAIKU__ && _X86_] (I386, HAIKU,
mach_type_known): Likewise.
* include/private/gcconfig.h [__HAIKU__ && (__amd64__ || __x86_64__)]
(X86_64, HAIKU, mach_type_known): Likewise.
* include/private/gcconfig.h [I386 && HAIKU] (DYNAMIC_LOADING,
MPROTECT_VDB): Likewise.
* include/private/gcconfig.h [X86_64 && HAIKU] (OS_TYPE, GETPAGESIZE,
DYNAMIC_LOADING, MPROTECT_VDB, HEURISTIC2, SEARCH_FOR_DATA_START):
Likewise.
* include/private/gcconfig.h [HAIKU] (UNIX_LIKE, GET_MEM): Likewise.
* os_dep.c [MPROTECT_VDB && !DARWIN && !MSWIN32 && !MSWINCE
&& HAIKU] (CODE_OK): Likewise.
* include/private/gcconfig.h [UNIX_LIKE && HAIKU] (NO_GETCONTEXT):
Likewise.
* dyn_load.c [HAIKU] (GC_register_dynamic_libraries): Implement.
* os_dep.c [HAIKU] (GC_haiku_get_mem): Likewise.
* include/private/gcconfig.h (BEOS): Rename to HAIKU.
* os_dep.c (BEOS): Likewise.
* include/private/gcconfig.h [I386 && HAIKU] (OS_TYPE): Change value
to "HAIKU".
* include/private/gcconfig.h [X86_64 && HAIKU]: Include OS.h.
* include/private/gcconfig.h [HAIKU] (GC_haiku_get_mem): Declare
prototype.
* include/private/thread_local_alloc.h [GC_HAIKU_THREADS]
(USE_PTHREAD_SPECIFIC): Likewise.
* os_dep.c [(NEED_FIND_LIMIT || UNIX_LIKE) && HAIKU] (old_segv_act):
Define static variable.
* os_dep.c [(NEED_FIND_LIMIT || UNIX_LIKE) && HAIKU]
(GC_set_and_save_fault_handler): Use old_segv_act; call
sigaction(SIGSEGV).
* os_dep.c [NEED_FIND_LIMIT || (USE_PROC_FOR_LIBRARIES && THREADS)]
(GC_reset_fault_handler): Likewise.
* os_dep.c [MPROTECT_VDB && !DARWIN && !USE_WINALLOC && HAIKU]: Do not
include sys/syscall.h.
* pthread_support.c [GC_HAIKU_THREADS] (GC_get_nprocs): Define function.