This is an archive of the discontinued LLVM Phabricator instance.

[Support] Fix build for Haiku
ClosedPublic

Authored by nielx on Sep 18 2020, 11:04 AM.

Details

Summary

This change fixes two issues with building LLVM on Haiku. The first issue is
that LLVM requires wait4(), which on Haiku is hidden behind the _BSD_SOURCE
feature flag when using the --std=c++14 flag. Additionally, the wait4()
function is only available in libbsd.so, so this is now a dependency.

The other fix is that Haiku does not have the (non-standard) rusage.maxrss
member, so by default the used memory info will be set to 0 on this platform.

Diff Detail

Event Timeline

nielx created this revision.Sep 18 2020, 11:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2020, 11:04 AM
nielx requested review of this revision.Sep 18 2020, 11:04 AM

Gentle reminder for the review request.

Adding reviewers from D82282 (another platform fix on this file)

sepavloff accepted this revision.Jan 24 2021, 6:19 PM

This change looks good to me.

This revision is now accepted and ready to land.Jan 24 2021, 6:19 PM

Thank you for the review. I cannot commit the change myself, so it would be much appreciated if somebody could land it for me.

Thanks!

This revision was automatically updated to reflect the committed changes.
dexonsmith added inline comments.Jan 28 2021, 12:31 PM
llvm/lib/Support/Unix/Program.inc
451–456

It's nice to minimize the #ifndef block when possible; I was able to simplify this slightly in 39ecfe614350fa5db7b8f13f81212f8e3831a390.

sepavloff added inline comments.Jan 28 2021, 8:27 PM
llvm/lib/Support/Unix/Program.inc
451–456

It's nice to minimize the #ifndef block when possible; I was able to simplify this slightly in 39ecfe614350fa5db7b8f13f81212f8e3831a390.

@dexonsmith Thank you!