diff options
| author | Kamil Rytarowski <n54@gmx.com> | 2018-12-09 16:40:33 +0000 |
|---|---|---|
| committer | Kamil Rytarowski <n54@gmx.com> | 2018-12-09 16:40:33 +0000 |
| commit | a56ac949ec7302a116591f1e07443d9e739c6a9d (patch) | |
| tree | 56bcba91e51752f60bad5e2ab1b5cf664b70d46b /openmp/runtime/cmake | |
| parent | b961661977f83e23e8fe385ad0b3222f5dc3d165 (diff) | |
| download | bcm5719-llvm-a56ac949ec7302a116591f1e07443d9e739c6a9d.tar.gz bcm5719-llvm-a56ac949ec7302a116591f1e07443d9e739c6a9d.zip | |
Add DragonFlyBSD support to OpenMP
Summary:
Additions mostly follow FreeBSD and NetBSD and are not intrusive.
There is similar patch for OpenBSD: https://reviews.llvm.org/D34280
The -lm was being omitted due to -Wl,--as-needed in cmake rule, similar patch is in freebsd-ports/devel/llvm-devel port.
Simple OpenMP programs compile and work as expected:
$ clang-devel ~/omp_hello.c -fopenmp -I/usr/local/llvm-devel/include
$ LD_LIBRARY_PATH=/usr/local/llvm-devel/lib OMP_NUM_THREADS=100 ./a.out
The assertion in LLVMgold.so when -fopenmp was used together with -flto in 20170524 snapshot is no longer triggered on current svn-trunk and works fine as in llvm-4.0 with our local patches.
Reviewers: #openmp, krytarowski
Reviewed By: krytarowski
Subscribers: dexonsmith, jfb, krytarowski, guansong, gregrodgers, emaste, mgorny, mehdi_amini
Differential Revision: https://reviews.llvm.org/D35129
llvm-svn: 348725
Diffstat (limited to 'openmp/runtime/cmake')
| -rw-r--r-- | openmp/runtime/cmake/LibompHandleFlags.cmake | 5 | ||||
| -rw-r--r-- | openmp/runtime/cmake/LibompMicroTests.cmake | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/openmp/runtime/cmake/LibompHandleFlags.cmake b/openmp/runtime/cmake/LibompHandleFlags.cmake index efe2099ed56..cf90ae12ee9 100644 --- a/openmp/runtime/cmake/LibompHandleFlags.cmake +++ b/openmp/runtime/cmake/LibompHandleFlags.cmake @@ -158,6 +158,11 @@ function(libomp_get_libflags libflags) if(${IA32}) libomp_append(libflags_local -lirc_pic LIBOMP_HAVE_IRC_PIC_LIBRARY) endif() + IF(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") + libomp_append(libflags_local "-Wl,--no-as-needed" LIBOMP_HAVE_AS_NEEDED_FLAG) + libomp_append(libflags_local "-lm") + libomp_append(libflags_local "-Wl,--as-needed" LIBOMP_HAVE_AS_NEEDED_FLAG) + ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") IF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") libomp_append(libflags_local -lm) ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") diff --git a/openmp/runtime/cmake/LibompMicroTests.cmake b/openmp/runtime/cmake/LibompMicroTests.cmake index 0918fdd1e5f..bdecf7f9275 100644 --- a/openmp/runtime/cmake/LibompMicroTests.cmake +++ b/openmp/runtime/cmake/LibompMicroTests.cmake @@ -176,6 +176,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD") set(libomp_expected_library_deps libc.so.12 libpthread.so.1 libm.so.0) libomp_append(libomp_expected_library_deps libhwloc.so.5 LIBOMP_USE_HWLOC) +elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly") + set(libomp_expected_library_deps libc.so.8 libpthread.so.0 libm.so.4) + libomp_append(libomp_expected_library_deps libhwloc.so.5 LIBOMP_USE_HWLOC) elseif(APPLE) set(libomp_expected_library_deps /usr/lib/libSystem.B.dylib) elseif(WIN32) |

