--- projects/openmp/runtime/cmake/LibompHandleFlags.cmake.orig 2017-03-16 15:50:48 UTC +++ projects/openmp/runtime/cmake/LibompHandleFlags.cmake @@ -156,6 +156,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 "FreeBSD") + 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 "FreeBSD") IF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") libomp_append(libflags_local -lm) ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") runtime/cmake/LibompHandleFlags.cmake | 5 +++++ runtime/cmake/LibompMicroTests.cmake | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) --- projects/openmp/runtime/cmake/LibompMicroTests.cmake.orig 2017-03-16 15:50:48 UTC +++ projects/openmp/runtime/cmake/LibompMicroTests.cmake @@ -171,7 +171,7 @@ add_custom_command( add_custom_target(libomp-test-deps DEPENDS test-deps/.success) set(libomp_expected_library_deps) if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - set(libomp_expected_library_deps libc.so.7 libthr.so.3) + set(libomp_expected_library_deps libc.so.7 libthr.so.3 libm.so.5) libomp_append(libomp_expected_library_deps libhwloc.so.5 LIBOMP_USE_HWLOC) elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD") set(libomp_expected_library_deps libc.so.12 libpthread.so.1 libm.so.0)