Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Haiku Platform #97

Closed
CodeforEvolution opened this issue May 8, 2016 · 4 comments
Closed

Support for Haiku Platform #97

CodeforEvolution opened this issue May 8, 2016 · 4 comments

Comments

@CodeforEvolution
Copy link

Support for the operating system Haiku, the open source successor to beos.

Main Homepage:
https://www.haiku-os.org

Development Websites:
https://dev.haiku-os.org/
https://www.haiku-os.org/development

@ivmai
Copy link
Owner

ivmai commented May 11, 2016

BeOS/x86 should be supported. Probably not tested for a long time.
Anyway, the patch is welcomed.

@ivmai
Copy link
Owner

ivmai commented Feb 19, 2018

Initial support of Haiku/amd64: 847927f

Would be good to test it.

Related topic: haikuports/haikuports#2215

ivmai added a commit that referenced this issue Feb 22, 2018
Issue #97 (bdwgc).

* pthread_support.c (WRAP_FUNC(pthread_create)): Change ABORT() for
"sem_wait failed" case to ABORT_ARG1() to report errno as well.
ivmai added a commit that referenced this issue Feb 26, 2018
(fix of commit 847927f)

Issue #97 (bdwgc).

* include/gc_config_macros.h [__HAIKU__ && !GC_CAN_SAVE_CALL_STACKS]
(GC_ADD_CALLER): Define macro.
* include/private/gcconfig.h [__HAIKU__ && __x86_64__] (X86_64, HAIKU,
mach_type_known): Likewise.
* include/private/gcconfig.h [HAIKU && X86_64] (HEURISTIC2,
SEARCH_FOR_DATA_START): Likewise.
* include/private/gcconfig.h [UNIX_LIKE && HAIKU] (NO_GETCONTEXT):
Likewise.
* include/private/thread_local_alloc.h [GC_HAIKU_THREADS]
(USE_PTHREAD_SPECIFIC): Likewise.
* include/private/gcconfig.h [HAIKU && X86_64] (etext, DATASTART): Do
not define.
@ivmai
Copy link
Owner

ivmai commented Mar 6, 2018

Fork handling (--enable-handle-fork) is not supported because of some bug in Haiku (as of hrev51798): pthread_mutex_unlock (called from GC_release_mark_lock called from fork_parent_proc) returns ESIGPARM.

@ivmai
Copy link
Owner

ivmai commented Mar 6, 2018

Besides the above bug, there are 2 more bugs in Haiku (for which I've created workarounds in bdwgc):

  • sem_wait sometimes returns EACCES (the workaround is to retry)
  • pthread_join returns ESRCH if too many threads were created (sample: tests/subthread_create.c compiled with -D GC_NO_THREAD_REDIRECTS).

ivmai added a commit that referenced this issue Mar 6, 2018
…Haiku

(fix of commits 19c81d8, 847927f)

Issue #97 (bdwgc).

* configure.ac [$THREADS=pthreads && ($host=*-*-dragonfly*
|| $host=*-*-haiku*)]: Do not AC_MSG_ERROR (i.e. use the default
THREADDLLIBS).
ivmai added a commit that referenced this issue Mar 6, 2018
Issue #97 (bdwgc).

The underlying pthread_join fails because of some bug in Haiku OS
(as of hrev51798) when many threads are created in parallel.

* tests/subthread_create.c [__HAIKU__]: Include errno.h.
* tests/subthread_create.c [__HAIKU__] (main): If pthread_join returned
value is ESRCH then just end the test normally (i.e. ignore the failure
of pthread_join); add comment and TODO item.
ivmai added a commit that referenced this issue Mar 6, 2018
Issue #97 (bdwgc).

sem_wait() fails because of some bug in Haiku OS (as of hrev51798).

* pthread_support.c [GC_HAIKU_THREADS] (WRAP_FUNC(pthread_create)):
If errno is EACCES then just retry sem_wait instead of ABORT.
@ivmai ivmai closed this as completed Mar 6, 2018
ivmai added a commit that referenced this issue Mar 28, 2018
Issue #97 (bdwgc).

* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=*-*-haiku*]: Define
GC_THREADS and _REENTRANT macros.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=*-*-haiku*
&& enable_parallel_mark]: Define PARALLEL_MARK macro.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=*-*-haiku*
&& enable_thread_local_alloc]: Define THREAD_LOCAL_ALLOC macro.
ivmai added a commit that referenced this issue Apr 17, 2018
Issue #97 (bdwgc).

The underlying pthread_join fails because of some bug in Haiku OS
(as of hrev51798) when many threads are created in parallel.

* tests/subthread_create.c [__HAIKU__]: Include errno.h.
* tests/subthread_create.c [__HAIKU__] (main): If pthread_join returned
value is ESRCH then just end the test normally (i.e. ignore the failure
of pthread_join); add comment and TODO item.
ivmai added a commit that referenced this issue Apr 17, 2018
Issue #97 (bdwgc).

sem_wait() fails because of some bug in Haiku OS (as of hrev51798).

* pthread_support.c [GC_HAIKU_THREADS] (WRAP_FUNC(pthread_create)):
If errno is EACCES then just retry sem_wait instead of ABORT.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants