This is an archive of the discontinued LLVM Phabricator instance.

Add OpenBSD support to OpenMP
ClosedPublic

Authored by bcallah on Jun 16 2017, 8:34 AM.

Details

Summary

This patch permits OpenMP to build and work (with both gcc and clang) on OpenBSD. It mostly follows what was done for FreeBSD and NetBSD, except OpenBSD does not have pthread_getattr_np support, so it follows OS X in that one instance.

Diff Detail

Event Timeline

bcallah created this revision.Jun 16 2017, 8:34 AM
krytarowski added inline comments.Jun 16 2017, 8:39 AM
runtime/src/kmp_platform.h
102

How about switching this check to __x86_64__ or defined(__x86_64) || defined(__x86_64__)?

bcallah updated this revision to Diff 102831.Jun 16 2017, 8:49 AM

Removed amd64 check, changed x86_64 check to x86_64__

runtime/src/kmp_platform.h
102

No objections to the former (or the latter, but I did the former).

krytarowski added inline comments.Jun 17 2017, 10:41 AM
runtime/src/z_Linux_util.cpp
448

If we are going to alter this comment, perhaps it's worth to make it more generic.

"Supported not by all systems"

bcallah updated this revision to Diff 102947.Jun 17 2017, 2:03 PM

Update a comment, at the request of krytarowski.

runtime/src/z_Linux_util.cpp
448

Sure. The comment also says it's for Linux only, which isn't true either. So I made the whole thing generic.

Is there anything else I can do to help get this committed?

I'm sorry to keep poking, but I would really appreciate this getting committed to the tree.
I am willing to work to ensure that OpenMP continues to build on OpenBSD and is not a hindrance to other platforms.

Patch looks fine from NetBSD point of view. The rest (to accept and commit) I leave to OpenMP developers. I have not worked on it so far.

krytarowski added inline comments.Jun 24 2017, 7:31 PM
CMakeLists.txt
7 ↗(On Diff #102947)

This comment would be updated to a some more generic one.

krytarowski added inline comments.Jun 24 2017, 7:35 PM
runtime/src/kmp_wrapper_malloc.h
100

This is beyond the scope of this patch but all platforms (Windows, Linux, BSDs, MacOSX) as far as I can tell ship alloca(3) from <stdlib.h>. The only exception of a modern system that I'm aware of, where <stdlib.h> does not work for this task is Solaris, it requires <alloca.h>.

bcallah updated this revision to Diff 123947.Nov 22 2017, 7:49 AM

Hello.
I would still very much like to add OpenBSD support to OpenMP. I have been using it for the past several months.

I have uploaded a new patch that rebases the OpenBSD additions to HEAD.

Thanks.

krytarowski accepted this revision.Dec 8 2018, 9:28 PM
This revision is now accepted and ready to land.Dec 8 2018, 9:28 PM
This revision was automatically updated to reflect the committed changes.