1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-08 06:48:28 +00:00

devel/openmp: link libomp.so against -lm for clang 3.6+

PR:		214258
Submitted by:	Yuta Satoh <nigoro.dev@gmail.com>
Approved by:	portmgr blanket
This commit is contained in:
Jan Beich 2017-03-29 14:43:28 +00:00
parent 6d78b5bcdb
commit c9efc1449c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=437204
12 changed files with 181 additions and 3 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= llvm
PORTVERSION= ${LLVM_MAJOR}.d${SNAPDATE}
PORTREVISION= 1
CATEGORIES= devel lang
PKGNAMESUFFIX= -devel
@ -93,6 +94,7 @@ OPENMP_GH_PROJECT= openmp:openmp
OPENMP_GH_SUBDIR= tools/openmp:openmp
OPENMP_GH_TAGNAME= ${OPENMP_COMMIT}:openmp
OPENMP_EXTRA_PATCHES= \
${PATCHDIR}/openmp-patch-bug32279 \
${PATCHDIR}/openmp-patch-tools_openmp_libomptarget_CMakeLists.txt
GOLD_DESC= Build the LLVM Gold plugin for LTO
GOLD_CMAKE_ON= -DLLVM_BINUTILS_INCDIR=${LOCALBASE}/include

View File

@ -0,0 +1,29 @@
--- tools/openmp/runtime/cmake/LibompHandleFlags.cmake.orig 2017-03-16 15:50:48 UTC
+++ tools/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(-)
--- tools/openmp/runtime/cmake/LibompMicroTests.cmake.orig 2017-03-16 15:50:48 UTC
+++ tools/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)

View File

@ -2,7 +2,7 @@
PORTNAME= llvm
DISTVERSION= 3.7.1
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= devel lang
MASTER_SITES= http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR}
DISTNAME= ${PORTNAME}-${DISTVERSION}.src
@ -74,6 +74,7 @@ LLDB_DISTFILES= lldb-${DISTVERSION}.src${EXTRACT_SUFX}
OPENMP_DESC= Install libomp, the LLVM OpenMP runtime library
OPENMP_DISTFILES= openmp-${DISTVERSION}.src${EXTRACT_SUFX}
OPENMP_EXTRA_PATCHES= \
${PATCHDIR}/openmp-patch-bug32279 \
${PATCHDIR}/openmp-patch-tools_openmp_runtime_tools_expand-vars.pl
GOLD_DESC= Build the LLVM Gold plugin for LTO
GOLD_CMAKE_ON= -DLLVM_BINUTILS_INCDIR=${LOCALBASE}/include

View File

@ -0,0 +1,25 @@
--- tools/openmp/runtime/cmake/LibompHandleFlags.cmake.orig 2017-03-16 15:57:00 UTC
+++ tools/openmp/runtime/cmake/LibompHandleFlags.cmake
@@ -165,6 +165,11 @@ function(libomp_get_fflags fflags)
if(${IA32})
libomp_append(fflags_local -m32 LIBOMP_HAVE_M32_FORTRAN_FLAG)
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")
set(fflags_local ${fflags_local} ${LIBOMP_FFLAGS})
libomp_setup_flags(fflags_local)
set(${fflags} ${fflags_local} PARENT_SCOPE)
--- tools/openmp/runtime/cmake/LibompMicroTests.cmake.orig 2017-03-16 15:57:29 UTC
+++ tools/openmp/runtime/cmake/LibompMicroTests.cmake
@@ -168,7 +168,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)
elseif(APPLE)
set(libomp_expected_library_deps /usr/lib/libSystem.B.dylib)
elseif(WIN32)

View File

@ -2,7 +2,7 @@
PORTNAME= llvm
DISTVERSION= 3.8.1
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= devel lang
MASTER_SITES= http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR}
DISTNAME= ${PORTNAME}-${DISTVERSION}.src
@ -76,6 +76,7 @@ LLDB_BUILD_DEPENDS= swig:devel/swig13
LLDB_DISTFILES= lldb-${DISTVERSION}.src${EXTRACT_SUFX}
OPENMP_DESC= Install libomp, the LLVM OpenMP runtime library
OPENMP_DISTFILES= openmp-${DISTVERSION}.src${EXTRACT_SUFX}
OPENMP_EXTRA_PATCHES= ${PATCHDIR}/openmp-patch-bug32279
GOLD_DESC= Build the LLVM Gold plugin for LTO
GOLD_CMAKE_ON= -DLLVM_BINUTILS_INCDIR=${LOCALBASE}/include
GOLD_BUILD_DEPENDS= ${LOCALBASE}/bin/ld.gold:devel/binutils

View File

@ -0,0 +1,29 @@
--- tools/openmp/runtime/cmake/LibompHandleFlags.cmake.orig 2017-03-16 15:50:48 UTC
+++ tools/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(-)
--- tools/openmp/runtime/cmake/LibompMicroTests.cmake.orig 2017-03-16 15:50:48 UTC
+++ tools/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)

View File

@ -2,7 +2,7 @@
PORTNAME= llvm
DISTVERSION= 3.9.1
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= devel lang
MASTER_SITES= http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR}
PKGNAMESUFFIX= ${LLVM_SUFFIX}
@ -92,6 +92,7 @@ LLDB_USES= execinfo
LLDB_VARS= _USES_PYTHON=python
OPENMP_DESC= Install libomp, the LLVM OpenMP runtime library
OPENMP_DISTFILES= openmp-${DISTVERSION}.src${EXTRACT_SUFX}
OPENMP_EXTRA_PATCHES= ${PATCHDIR}/openmp-patch-bug32279
# Emulate USE_GITHUB's ${WRKSRC_tag} to reduce diffs to ../llvm-devel
.for option in CLANG COMPILER_RT EXTRAS LLD LLDB OPENMP

View File

@ -0,0 +1,29 @@
--- tools/openmp/runtime/cmake/LibompHandleFlags.cmake.orig 2017-03-16 15:50:48 UTC
+++ tools/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(-)
--- tools/openmp/runtime/cmake/LibompMicroTests.cmake.orig 2017-03-16 15:50:48 UTC
+++ tools/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)

View File

@ -2,6 +2,7 @@
PORTNAME= llvm
DISTVERSION= 4.0.0
PORTREVISION= 1
CATEGORIES= devel lang
MASTER_SITES= http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR}
PKGNAMESUFFIX= ${LLVM_SUFFIX}
@ -88,6 +89,7 @@ LLDB_USES= execinfo
LLDB_VARS= _USES_PYTHON=python
OPENMP_DESC= Install libomp, the LLVM OpenMP runtime library
OPENMP_DISTFILES= openmp-${DISTVERSION}.src${EXTRACT_SUFX}
OPENMP_EXTRA_PATCHES= ${PATCHDIR}/openmp-patch-bug32279
# Emulate USE_GITHUB's ${WRKSRC_tag} to reduce diffs to ../llvm-devel
.for option in CLANG COMPILER_RT EXTRAS LLD LLDB OPENMP

View File

@ -0,0 +1,29 @@
--- tools/openmp/runtime/cmake/LibompHandleFlags.cmake.orig 2017-03-16 15:50:48 UTC
+++ tools/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(-)
--- tools/openmp/runtime/cmake/LibompMicroTests.cmake.orig 2017-03-16 15:50:48 UTC
+++ tools/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)

View File

@ -3,6 +3,7 @@
PORTNAME= openmp
DISTVERSION= 4.0.0
DISTVERSIONSUFFIX= .src
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://llvm.org/releases/${DISTVERSION}/

View File

@ -0,0 +1,29 @@
--- runtime/cmake/LibompHandleFlags.cmake.orig 2017-03-16 15:50:48 UTC
+++ 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(-)
--- runtime/cmake/LibompMicroTests.cmake.orig 2017-03-16 15:50:48 UTC
+++ 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)