HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • Back to Ticket #318

Ticket #318: gc-7.2alpha6.patch

File gc-7.2alpha6.patch, 10.1 KB (added by hamish, 3 years ago)
  • configure

    diff -ru gc-7.2alpha6-orig/configure gc-7.2alpha6/configure
    old new  
    49694969 
    49704970 
    49714971 
     4972 
    49724973{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 
    49734974$as_echo_n "checking for inline... " >&6; } 
    49744975if ${ac_cv_c_inline+:} false; then : 
    … …  
    50885089        $as_echo "#define _REENTRANT 1" >>confdefs.h 
    50895090 
    50905091        ;; 
     5092     *-*-haiku*) 
     5093        $as_echo "#define GC_HAIKU_THREADS 1" >>confdefs.h 
     5094 
     5095        $as_echo "#define _REENTRANT 1" >>confdefs.h 
     5096 
     5097        ;; 
    50915098     *-*-hpux11*) 
    50925099        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only HP/UX 11 POSIX threads are supported.\"" >&5 
    50935100$as_echo "$as_me: WARNING: \"Only HP/UX 11 POSIX threads are supported.\"" >&2;} 
  • configure.ac

    diff -ru gc-7.2alpha6-orig/configure.ac gc-7.2alpha6/configure.ac
    old new  
    8383AH_TEMPLATE([GC_DARWIN_THREADS],    [Define to support Darwin pthreads.]) 
    8484AH_TEMPLATE([GC_FREEBSD_THREADS],   [Define to support FreeBSD pthreads.]) 
    8585AH_TEMPLATE([GC_GNU_THREADS],       [Define to support GNU pthreads.]) 
     86AH_TEMPLATE([GC_HAIKU_THREADS],     [Define to support Haiku pthreads.]) 
    8687AH_TEMPLATE([GC_HPUX_THREADS],      [Define to support HP/UX 11 pthreads.]) 
    8788AH_TEMPLATE([GC_IRIX_THREADS],      [Define to support Irix pthreads.]) 
    8889AH_TEMPLATE([GC_LINUX_THREADS],     [Define to support pthreads on Linux.]) 
    … …  
    127128        AC_DEFINE(GC_AIX_THREADS) 
    128129        AC_DEFINE(_REENTRANT) 
    129130        ;; 
     131     *-*-haiku*) 
     132        AC_DEFINE(GC_HAIKU_THREADS) 
     133        AC_DEFINE(_REENTRANT) 
     134        ;; 
    130135     *-*-hpux11*) 
    131136        AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.") 
    132137        AC_DEFINE(GC_HPUX_THREADS) 
  • dyn_load.c

    diff -ru gc-7.2alpha6-orig/dyn_load.c gc-7.2alpha6/dyn_load.c
    old new  
    6363    !(defined(FREEBSD) && defined(__ELF__)) && \ 
    6464    !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \ 
    6565    !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \ 
    66     !defined(DARWIN) && !defined(CYGWIN32) 
     66    !defined(DARWIN) && !defined(CYGWIN32) && !defined(HAIKU) 
    6767 --> We only know how to find data segments of dynamic libraries for the 
    6868 --> above.  Additional SVR4 variants might not be too 
    6969 --> hard to add. 
    … …  
    14191419 
    14201420#endif /* DARWIN */ 
    14211421 
     1422#ifdef HAIKU 
     1423#include <kernel/image.h> 
     1424 
     1425GC_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 
    14221438#elif defined(PCR) 
    14231439 
    14241440# include "il/PCR_IL.h" 
  • include/gc_config_macros.h

    diff -ru gc-7.2alpha6-orig/include/gc_config_macros.h gc-7.2alpha6/include/gc_config_macros.h
    old new  
    6565    || defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \ 
    6666    || defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \ 
    6767    || defined(GC_OSF1_THREADS) || defined(GC_SOLARIS_THREADS) \ 
    68     || defined(GC_WIN32_THREADS) 
     68    || defined(GC_WIN32_THREADS) || defined(GC_HAIKU_THREADS) 
    6969# ifndef GC_THREADS 
    7070#   define GC_THREADS 
    7171# endif 
  • include/private/config.h.in

    diff -ru gc-7.2alpha6-orig/include/private/config.h.in gc-7.2alpha6/include/private/config.h.in
    old new  
    4545/* Define to support GNU pthreads. */ 
    4646#undef GC_GNU_THREADS 
    4747 
     48/* Define to support Haiku pthreads. */ 
     49#undef GC_HAIKU_THREADS 
     50 
    4851/* Define if backtrace information is supported. */ 
    4952#undef GC_HAVE_BUILTIN_BACKTRACE 
    5053 
  • include/private/gcconfig.h

    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  
    234234#    define BEOS 
    235235#    define mach_type_known 
    236236# endif 
     237# if defined(__HAIKU__) && defined(_X86_) 
     238#    define I386 
     239#    define HAIKU 
     240#    define mach_type_known 
     241# endif 
    237242# if defined(OPENBSD) && defined(__amd64__) 
    238243#    define X86_64 
    239244#    define mach_type_known 
    … …  
    11101115      extern int etext[]; 
    11111116#     define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) 
    11121117#   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 
    11131127#   ifdef SOLARIS 
    11141128#       define OS_TYPE "SOLARIS" 
    11151129        extern int _etext[], _end[]; 
    … …  
    23452359#if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \ 
    23462360    || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \ 
    23472361    || defined(DGUX) || defined(BSD) || defined(HURD) \ 
    2348     || defined(AIX) || defined(DARWIN) || defined(OSF1) 
     2362    || defined(AIX) || defined(DARWIN) || defined(OSF1) || defined(HAIKU) 
    23492363# define UNIX_LIKE      /* Basic Unix-like system calls work.   */ 
    23502364#endif 
    23512365 
    … …  
    24232437 
    24242438#if ((defined(UNIX_LIKE) && (defined(DARWIN) || defined(HURD) \ 
    24252439                             || defined(OPENBSD) || defined(ARM32) \ 
    2426                              || defined(MIPS) || defined(AVR32))) \ 
     2440                             || defined(MIPS) || defined(AVR32) \ 
     2441                             || defined(HAIKU))) \ 
    24272442     || (defined(LINUX) && (defined(SPARC) || defined(M68K))) \ 
    24282443     || (defined(RTEMS) && defined(I386))) && !defined(NO_GETCONTEXT) 
    24292444# define NO_GETCONTEXT 
    … …  
    27212736# elif defined(SN_TARGET_PS3) 
    27222737    void *ps3_get_mem(size_t size); 
    27232738#   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) 
    27242742# else 
    27252743    ptr_t GC_unix_get_mem(GC_word bytes); 
    27262744#   define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes) 
  • include/private/thread_local_alloc.h

    diff -ru gc-7.2alpha6-orig/include/private/thread_local_alloc.h gc-7.2alpha6/include/private/thread_local_alloc.h
    old new  
    4747#   define USE_COMPILER_TLS 
    4848# elif defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) \ 
    4949       || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \ 
    50        || defined(GC_NETBSD_THREADS) 
     50       || defined(GC_NETBSD_THREADS) || defined(GC_HAIKU_THREADS) 
    5151#   define USE_PTHREAD_SPECIFIC 
    5252# elif defined(GC_HPUX_THREADS) 
    5353#   ifdef __GNUC__ 
  • os_dep.c

    diff -ru gc-7.2alpha6-orig/os_dep.c gc-7.2alpha6/os_dep.c
    old new  
    790790  } 
    791791#endif /* !MSWIN32 */ 
    792792 
    793 #ifdef BEOS 
     793#if defined(BEOS) || defined(HAIKU) 
    794794# include <kernel/OS.h> 
    795795 
    796796  GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb) 
    … …  
    801801    return GC_SUCCESS; 
    802802  } 
    803803# define HAVE_GET_STACK_BASE 
    804 #endif /* BEOS */ 
     804#endif /* BEOS || HAIKU */ 
    805805 
    806806#ifdef OS2 
    807807  GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb) 
    … …  
    11271127# define GET_MAIN_STACKBASE_SPECIAL 
    11281128#elif !defined(BEOS) && !defined(AMIGA) && !defined(OS2) \ 
    11291129      && !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32) \ 
    1130       && !defined(GC_OPENBSD_THREADS) \ 
     1130      && !defined(GC_OPENBSD_THREADS) && !defined(HAIKU) \ 
    11311131      && (!defined(GC_SOLARIS_THREADS) || defined(_STRICT_STDC)) 
    11321132 
    11331133# if defined(LINUX) && defined(USE_GET_STACKBASE_FOR_MAIN) 
    … …  
    19771977# if !defined(OS2) && !defined(PCR) && !defined(AMIGA) && !defined(MSWIN32) \ 
    19781978     && !defined(MSWINCE) && !defined(MACOS) && !defined(DOS4GW) \ 
    19791979     && !defined(NONSTOP) && !defined(SN_TARGET_PS3) && !defined(RTEMS) \ 
    1980      && !defined(__CC_ARM) 
     1980     && !defined(__CC_ARM) && !defined(HAIKU) 
    19811981 
    19821982# define SBRK_ARG_T ptrdiff_t 
    19831983 
    … …  
    23022302  } 
    23032303#endif 
    23042304 
     2305#ifdef HAIKU 
     2306#include <stdlib.h> 
     2307 
     2308ptr_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 
    23052318#ifdef USE_MUNMAP 
    23062319 
    23072320/* For now, this only works on Win32/WinCE and some Unix-like   */ 
    … …  
    29032916# elif !defined(MSWIN32) && !defined(MSWINCE) 
    29042917#   include <sys/mman.h> 
    29052918#   include <signal.h> 
    2906 #   include <sys/syscall.h> 
     2919#   if !defined(HAIKU) 
     2920#     include <sys/syscall.h> 
     2921#   endif 
    29072922 
    29082923#   define PROTECT(addr, len) \ 
    29092924        if (mprotect((caddr_t)(addr), (size_t)(len), \ 
    … …  
    30623077      /* Empirically c.trapno == 14, on IA32, but is that useful?       */ 
    30633078      /* Should probably consider alignment issues on other             */ 
    30643079      /* architectures.                                                 */ 
     3080#   elif defined(HAIKU) 
     3081#     define CODE_OK TRUE 
    30653082#   elif defined(HPUX) 
    30663083#     define CODE_OK (si -> si_code == SEGV_ACCERR \ 
    30673084                      || si -> si_code == BUS_ADRERR \ 
  • pthread_support.c

    diff -ru gc-7.2alpha6-orig/pthread_support.c gc-7.2alpha6/pthread_support.c
    old new  
    938938      GC_nprocs = pthread_num_processors_np(); 
    939939#   elif defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \ 
    940940         || 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) 
    942943      GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN); 
    943944      if (GC_nprocs <= 0) GC_nprocs = 1; 
    944945#   elif defined(GC_IRIX_THREADS) 

Download in other formats:

  • Original Format

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/