commit: 1a394b9bfd69838dfe13c043f004375a7927b629 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com> AuthorDate: Mon Nov 21 21:22:03 2016 +0000 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com> CommitDate: Mon Nov 21 21:22:03 2016 +0000 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=1a394b9b
sys-libs/libomp: Add 3.9.0 __va_copy is used insted of va_copy. This should probably be moved upstream. sys-libs/libomp/Manifest | 6 +++ .../files/libomp-3.9.0-musl-strerror_r.patch | 35 ++++++++++++ .../files/libomp-3.9.0-optional-aliases.patch | 63 ++++++++++++++++++++++ .../files/libomp-3.9.0-use-va_copy-macro.patch | 12 +++++ sys-libs/libomp/libomp-3.9.0.ebuild | 51 ++++++++++++++++++ sys-libs/libomp/metadata.xml | 16 ++++++ 6 files changed, 183 insertions(+) diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest new file mode 100644 index 0000000..bae2ca2 --- /dev/null +++ b/sys-libs/libomp/Manifest @@ -0,0 +1,6 @@ +AUX libomp-3.9.0-musl-strerror_r.patch 1159 SHA256 b1aa6d44d4d613cb1383975831ad49ccf433de5e6ff80fec1686ec161edf3ee7 SHA512 f35c5b9b1acf3cc636b505b8935a974796080fa71d96aee46e4edb559a5c5c03bf95457b27e1f026b4330a052654de539d556c4098f1b4a02cd2f95740bc3a4f WHIRLPOOL debde3f0265408f1a5c1376fcf4b84d6c210b9a8824343e22f86fdd8e1485ac20c2d8668e04ee692f14c8d8a7a13b1eaf0b117fde4565f21cc80aada9f498bb0 +AUX libomp-3.9.0-optional-aliases.patch 2536 SHA256 31c143bdb761a969888348ced721f22be7af7413da0b5238642a75efd8c2fcd7 SHA512 0cf501decca0997ee84754bc6c5b3401dbf408571dc169bbfd3fe892f6d0c730785a1bb4293e55eb47f8e808707810e22fac15702853a06cd7531d7a37c54265 WHIRLPOOL fa722bd91c74307217d7c419a27d6d6a55730bcd144a5e2630c0ab48a974b9ce4686e1a2dc82da735dec525f8ad5c96885a5c27b900cc5ce0057a32c146ef414 +AUX libomp-3.9.0-use-va_copy-macro.patch 665 SHA256 1f6df759676fb048c9e46da328f0068dd6ad448fbbb22ecf0f5a9a8873a411ed SHA512 b02c23725a9f45320f2978f180cb815b92a0b64be4fc3b5ea019fae76c789d572f01cc79399383504b6c4fed3d2b8be059311013b23e26dc63640fa8e3408430 WHIRLPOOL 45b13ca42cf92d1b5ae38e2846247817e8751eaa1fe093c50f4c8b9477c3a57bb51ef6ea1e8869c2f56b836ffd6274c75b10f1dada91a6548d93de05ad1c5458 +DIST openmp-3.9.0.src.tar.xz 2257596 SHA256 df88f90d7e5b5e9525a35fa2e2b93cbbb83c4882f91df494e87ee3ceddacac91 SHA512 030432bb10d86016f0f1c4f4d8b25f78acdb4aed33c604baf07c825bbcc6198306f2f71a3e56030f20864a92ab0187357aff94d34e47f7166991faf539c0104d WHIRLPOOL 7bfb362c0f087d3867c8cab04ebba23c8e6337d34ddcdfeda1cbe960611eacf1e4356e99bf4d6316b60c9f4b9f9fb23eecdb346feaae72b9cd168ee0aa3cca2a +EBUILD libomp-3.9.0.ebuild 1320 SHA256 8f1a0a85cd4ba2dedf819307f40dbf872864e701cb27e9ee4ea080ac94a92d9d SHA512 0a5c56afe794ddcb7ba77c972a131ee80a95f204ae36720e93a0d669a06306cfc3bef7f275f27d7ba41e986ac55105b6fc8949b8e22e71a4b9d325b6cc61b800 WHIRLPOOL 8404678d31684a6abcc564907e73d76771f6a9a0ab02e7e28524e217b722bbec06c7ba46966f4d9c1833b24c794dabb2161bb7f8d406ce5ccdc1eec6ce177caf +MISC metadata.xml 670 SHA256 c32e97e9d85d756302a38aac03d55a14d3e5b43cc910f1dff35b9f0c8bea03b1 SHA512 d4269bb7192e00feed26327bb2ac36db3b1c4f5d55417c22efb9a64fa5a006c17dd39459ecc305e8a9a3a954271ad10013fe5c9159a30ea609513aabddebf485 WHIRLPOOL d0022a64d2cad055eab1c6921cdfd4372fcf9cabd40c5ba7bf74d49eaff5f3498545fe29bbfc20bbee2cc3fed596e6a4d9f408d912f39900bbfb1c6c4aabb61a diff --git a/sys-libs/libomp/files/libomp-3.9.0-musl-strerror_r.patch b/sys-libs/libomp/files/libomp-3.9.0-musl-strerror_r.patch new file mode 100644 index 0000000..4fbf9f6 --- /dev/null +++ b/sys-libs/libomp/files/libomp-3.9.0-musl-strerror_r.patch @@ -0,0 +1,35 @@ +From 4fa7d5e207a4f7ef79b423b7d9658b7625795f5c Mon Sep 17 00:00:00 2001 +From: Michal Gorny <[email protected]> +Date: Tue, 18 Oct 2016 16:38:44 +0000 +Subject: [PATCH] Fix a compile error on musl-libc due to strerror_r() + prototype + +Function strerror_r() has different signatures in different +implementations of libc: glibc's version returns a char*, while BSDs +and musl return a int. libomp unconditionally assumes glibc on Linux +and thus fails to compile against musl-libc. This patch addresses this +issue. + +Differential Revision: https://reviews.llvm.org/D25071 + +git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@284492 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + runtime/src/kmp_i18n.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/runtime/src/kmp_i18n.c b/runtime/src/kmp_i18n.c +index 546e693..e008d1f 100644 +--- a/runtime/src/kmp_i18n.c ++++ b/runtime/src/kmp_i18n.c +@@ -809,7 +809,7 @@ sys_error( + int strerror_r( int, char *, size_t ); // XSI version + */ + +- #if KMP_OS_LINUX ++ #if defined(__GLIBC__) && defined(_GNU_SOURCE) + + // GNU version of strerror_r. + +-- +2.10.1 + diff --git a/sys-libs/libomp/files/libomp-3.9.0-optional-aliases.patch b/sys-libs/libomp/files/libomp-3.9.0-optional-aliases.patch new file mode 100644 index 0000000..faf5bb5 --- /dev/null +++ b/sys-libs/libomp/files/libomp-3.9.0-optional-aliases.patch @@ -0,0 +1,63 @@ +From 89ab78e360b7b20ebe1bc89736880a8e4aaa9e6e Mon Sep 17 00:00:00 2001 +From: Michal Gorny <[email protected]> +Date: Wed, 14 Sep 2016 17:46:27 +0000 +Subject: [PATCH] [cmake] Make libgomp & libiomp5 alias install optional + +Introduce a new LIBOMP_INSTALL_VARIABLES cache variable that can be used +to disable creating libgomp and libiomp5 aliases on 'make install'. +Those aliases are undesired e.g. on Gentoo systems where libomp is used +purely by clang. + +Differential Revision: https://reviews.llvm.org/D24563 + +git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@281512 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + runtime/CMakeLists.txt | 4 ++++ + runtime/src/CMakeLists.txt | 16 +++++++++------- + 2 files changed, 13 insertions(+), 7 deletions(-) + +diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt +index 9db058b..e8e9a74 100644 +--- a/runtime/CMakeLists.txt ++++ b/runtime/CMakeLists.txt +@@ -340,6 +340,10 @@ endif() + + set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${LIBOMP_LIBRARY_SUFFIX}) + ++# Optional backwards compatibility aliases. ++set(LIBOMP_INSTALL_ALIASES TRUE CACHE BOOL ++ "Install libgomp and libiomp5 library aliases for backwards compatibility") ++ + # Print configuration after all variables are set. + if(${LIBOMP_STANDALONE_BUILD}) + libomp_say("Operating System -- ${CMAKE_SYSTEM_NAME}") +diff --git a/runtime/src/CMakeLists.txt b/runtime/src/CMakeLists.txt +index 777434d..c80f88d 100644 +--- a/runtime/src/CMakeLists.txt ++++ b/runtime/src/CMakeLists.txt +@@ -305,13 +305,15 @@ else() + + install(TARGETS omp ${LIBOMP_INSTALL_KIND} DESTINATION lib${LIBOMP_LIBDIR_SUFFIX}) + +- # Create aliases (symlinks) of the library for backwards compatibility +- set(LIBOMP_ALIASES "libgomp;libiomp5") +- foreach(alias IN LISTS LIBOMP_ALIASES) +- install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\" +- \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY +- \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib${LIBOMP_LIBDIR_SUFFIX})") +- endforeach() ++ if(${LIBOMP_INSTALL_ALIASES}) ++ # Create aliases (symlinks) of the library for backwards compatibility ++ set(LIBOMP_ALIASES "libgomp;libiomp5") ++ foreach(alias IN LISTS LIBOMP_ALIASES) ++ install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\" ++ \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY ++ \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib${LIBOMP_LIBDIR_SUFFIX})") ++ endforeach() ++ endif() + endif() + install( + FILES +-- +2.4.10 + diff --git a/sys-libs/libomp/files/libomp-3.9.0-use-va_copy-macro.patch b/sys-libs/libomp/files/libomp-3.9.0-use-va_copy-macro.patch new file mode 100644 index 0000000..ae7cf6a --- /dev/null +++ b/sys-libs/libomp/files/libomp-3.9.0-use-va_copy-macro.patch @@ -0,0 +1,12 @@ +diff -Naur openmp-3.9.0.orig/runtime/src/kmp_str.c openmp-3.9.0/runtime/src/kmp_str.c +--- openmp-3.9.0.orig/runtime/src/kmp_str.c 2016-11-01 12:48:23.089878111 -0700 ++++ openmp-3.9.0/runtime/src/kmp_str.c 2016-11-01 12:49:43.043419074 -0700 +@@ -208,7 +208,7 @@ + + #if ! KMP_OS_WINDOWS + va_list _args; +- __va_copy( _args, args ); // Make copy of args. ++ va_copy( _args, args ); // Make copy of args. + #define args _args // Substitute args with its copy, _args. + #endif // KMP_OS_WINDOWS + rc = KMP_VSNPRINTF( buffer->str + buffer->used, free, format, args ); diff --git a/sys-libs/libomp/libomp-3.9.0.ebuild b/sys-libs/libomp/libomp-3.9.0.ebuild new file mode 100644 index 0000000..db4d623 --- /dev/null +++ b/sys-libs/libomp/libomp-3.9.0.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +: ${CMAKE_MAKEFILE_GENERATOR:=ninja} + +inherit cmake-multilib + +MY_P=openmp-${PV} +DESCRIPTION="OpenMP runtime library for LLVM/clang compiler" +HOMEPAGE="http://openmp.llvm.org" +SRC_URI="http://llvm.org/releases/${PV}/${MY_P}.src.tar.xz" + +# Additional licenses: +# - MIT-licensed Intel code, +# - LLVM Software Grant from Intel. + +LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant" +SLOT="0/3.9" +KEYWORDS="~amd64 ~x86" +IUSE="hwloc ompt" + +RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )" +DEPEND="${RDEPEND} + dev-lang/perl" + +S="${WORKDIR}/${MY_P}.src" + +PATCHES=( + # backport of https://reviews.llvm.org/D24563 + "${FILESDIR}"/${PN}-3.9.0-optional-aliases.patch + # backport of https://reviews.llvm.org/D25071 + "${FILESDIR}"/${PN}-3.9.0-musl-strerror_r.patch + "${FILESDIR}"/${PN}-3.9.0-use-va_copy-macro.patch +) + +multilib_src_configure() { + local libdir="$(get_libdir)" + local mycmakeargs=( + -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}" + -DLIBOMP_USE_HWLOC=$(usex hwloc) + -DLIBOMP_OMPT_SUPPORT=$(usex ompt) + # do not install libgomp.so & libiomp5.so aliases + -DLIBOMP_INSTALL_ALIASES=OFF + # disable unnecessary hack copying stuff back to srcdir + -DLIBOMP_COPY_EXPORTS=OFF + ) + cmake-utils_src_configure +} diff --git a/sys-libs/libomp/metadata.xml b/sys-libs/libomp/metadata.xml new file mode 100644 index 0000000..ca91e84 --- /dev/null +++ b/sys-libs/libomp/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>[email protected]</email> + <name>Bernard Cafarelli</name> + </maintainer> + <maintainer type="project"> + <email>[email protected]</email> + </maintainer> + <use> + <flag name='hwloc'>Enable CPU affinity support via hwloc</flag> + <flag name='ompt'>Enable OpenMP Tools Interface support</flag> + </use> + <longdescription>The OpenMP subproject of LLVM is intended to contain all of the components required to build an executing OpenMP program that are outside the compiler itself.</longdescription> +</pkgmetadata>
