Skip to content

Haiku: Fix native component build#126701

Open
trungnt2910 wants to merge 1 commit intodotnet:mainfrom
trungnt2910:dev/trungnt2910/haiku-native-libs-build
Open

Haiku: Fix native component build#126701
trungnt2910 wants to merge 1 commit intodotnet:mainfrom
trungnt2910:dev/trungnt2910/haiku-native-libs-build

Conversation

@trungnt2910
Copy link
Copy Markdown
Contributor

This contains the missing configuration updates required to build the native component for Haiku with the latest .NET source.

Part of #55803.

This contains the missing configuration updates required to build the
native component for Haiku with the latest .NET source.
Copilot AI review requested due to automatic review settings April 9, 2026 11:50
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 9, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates native build configuration to improve compatibility with Haiku when building dotnet/runtime native components, primarily by feature-detecting pthread robust-mutex APIs and adjusting Haiku linker behavior in CMake.

Changes:

  • Add CMake feature checks for pthread_mutex_consistent and pthread_mutexattr_setrobust, and expose them via pal_config.h.
  • Conditionally compile robust-mutex initialization and recovery paths in pal_crossprocessmutex.c based on those feature macros.
  • Adjust Haiku CMake linker-group settings as a workaround for missing upstream CMake support.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/native/libs/System.Native/pal_crossprocessmutex.c Guard robust mutex attr usage and EOWNERDEAD recovery logic behind feature macros.
src/native/libs/configure.cmake Add configure-time detection for robust-mutex related pthread APIs.
src/native/libs/Common/pal_config.h.in Export new HAVE_PTHREAD_MUTEX_* feature macros to native builds.
eng/native/configurecompiler.cmake Set Haiku linker-group rescan settings and adjust Haiku linker flags.

error = pthread_mutexattr_settype(&mutexAttributes, PTHREAD_MUTEX_RECURSIVE);
assert(error == 0);

#if HAVE_PTHREAD_MUTEXATTR_SETROBUST
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkoritzinsky Is the cross-process mutex going to work without these APIs? Should Haiku use the fallback path instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Infrastructure community-contribution Indicates that the PR has been added by a community member os-haiku

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants