[gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/, sys-devel/clang/files/9999/

2017-01-24 Thread Michał Górny
commit: 49879b6d7ebc70f19307393db44d853407d1f2c6
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Jan 24 17:14:59 2017 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Jan 24 17:30:40 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49879b6d

sys-devel/clang: Fix matching clangrt libs to arch (on x86)

 sys-devel/clang/clang-4.0.0_rc1.ebuild |   3 +
 sys-devel/clang/clang-.ebuild  |   3 +
 ...arch-type-to-find-compiler-rt-libraries-o.patch | 136 +
 3 files changed, 142 insertions(+)

diff --git a/sys-devel/clang/clang-4.0.0_rc1.ebuild 
b/sys-devel/clang/clang-4.0.0_rc1.ebuild
index 4914a70..2dbae1f 100644
--- a/sys-devel/clang/clang-4.0.0_rc1.ebuild
+++ b/sys-devel/clang/clang-4.0.0_rc1.ebuild
@@ -127,6 +127,9 @@ src_unpack() {
 src_prepare() {
python_setup
 
+   # fix finding compiler-rt libs
+   eapply 
"${FILESDIR}"//0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
+
# fix stand-alone doc build
eapply 
"${FILESDIR}"//0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
 

diff --git a/sys-devel/clang/clang-.ebuild 
b/sys-devel/clang/clang-.ebuild
index 25e52b2..f3b9ea7 100644
--- a/sys-devel/clang/clang-.ebuild
+++ b/sys-devel/clang/clang-.ebuild
@@ -123,6 +123,9 @@ src_unpack() {
 src_prepare() {
python_setup
 
+   # fix finding compiler-rt libs
+   eapply 
"${FILESDIR}"//0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
+
# fix stand-alone doc build
eapply 
"${FILESDIR}"//0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
 

diff --git 
a/sys-devel/clang/files//0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
 
b/sys-devel/clang/files//0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
new file mode 100644
index ..7d53cbd
--- /dev/null
+++ 
b/sys-devel/clang/files//0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
@@ -0,0 +1,136 @@
+From 19e3dc0ce4949cc7f869b4552c6a7f28cd59c3b7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
+Date: Thu, 17 Nov 2016 14:19:18 +0100
+Subject: [PATCH] [Driver] Use arch type to find compiler-rt libraries (on
+ Linux)
+
+Use llvm::Triple::getArchTypeName() when looking for compiler-rt
+libraries, rather than the exact arch string from the triple. This is
+more correct as it matches the values used when building compiler-rt
+(builtin-config-ix.cmake) which are the subset of the values allowed
+in triples.
+
+For example, this fixes an issue when the compiler set for
+i686-pc-linux-gnu triple would not find an i386 compiler-rt library,
+while this is the exact arch that is detected by compiler-rt. The same
+applies to any other i?86 variant allowed by LLVM.
+
+This also makes the special case for MSVC unnecessary, since now i386
+will be used reliably for all 32-bit x86 variants.
+---
+ lib/Driver/ToolChain.cpp|  5 +
+ .../usr/i686-unknown-linux/lib/.keep|  0
+ .../usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o |  0
+ test/Driver/linux-ld.c  | 21 +
+ test/Driver/nostdlib.c  |  2 +-
+ test/Driver/print-libgcc-file-name-clangrt.c| 10 --
+ test/Driver/windows-cross.c |  2 +-
+ 7 files changed, 32 insertions(+), 8 deletions(-)
+ create mode 100644 
test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep
+ create mode 100644 
test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
+
+diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
+index 6adc0386ee..7e4222f087 100644
+--- a/lib/Driver/ToolChain.cpp
 b/lib/Driver/ToolChain.cpp
+@@ -283,15 +283,12 @@ static StringRef getArchNameForCompilerRTLib(const 
ToolChain ,
+   const llvm::Triple  = TC.getTriple();
+   bool IsWindows = Triple.isOSWindows();
+ 
+-  if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86)
+-return "i386";
+-
+   if (TC.getArch() == llvm::Triple::arm || TC.getArch() == 
llvm::Triple::armeb)
+ return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && 
!IsWindows)
+? "armhf"
+: "arm";
+ 
+-  return TC.getArchName();
++  return llvm::Triple::getArchTypeName(TC.getArch());
+ }
+ 
+ std::string ToolChain::getCompilerRT(const ArgList , StringRef Component,
+diff --git 
a/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep 
b/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep
+new file mode 100644
+index 00..e69de29bb2
+diff --git 
a/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
 
b/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
+new file mode 100644
+index 

[gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/, sys-devel/clang/files/9999/

2016-10-31 Thread Michał Górny
commit: 4022af8479305a46fe5d9e94ea78342e9a13b7d8
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Nov  1 00:35:07 2016 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Nov  1 00:41:18 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4022af84

sys-devel/clang: Replace the non-upstreamable lib/clang patch

Replace the non-upstream patch allowing us to alter path for lib/clang
with the use of upstream CLANG_RESOURCE_DIR option (to fix file search
in driver code) combined with necessary symlinking (for tests) and moves
(for install) of installed headers.

 sys-devel/clang/clang-.ebuild  | 16 +++-
 ...rting-overriding-runtime-libdir-via-CLANG.patch | 86 --
 2 files changed, 12 insertions(+), 90 deletions(-)

diff --git a/sys-devel/clang/clang-.ebuild 
b/sys-devel/clang/clang-.ebuild
index 689eaae..a962a81 100644
--- a/sys-devel/clang/clang-.ebuild
+++ b/sys-devel/clang/clang-.ebuild
@@ -115,8 +115,6 @@ src_unpack() {
 src_prepare() {
python_setup
 
-   # support overriding clang runtime install directory
-   eapply 
"${FILESDIR}"//0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch
# fix stand-alone doc build
eapply 
"${FILESDIR}"//0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
 
@@ -125,11 +123,13 @@ src_prepare() {
 }
 
 multilib_src_configure() {
+   # TODO: read it?
+   local clang_version=4.0.0
local libdir=$(get_libdir)
local mycmakeargs=(
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
-   # install clang runtime straight into /usr/lib
-   -DCLANG_LIBDIR_SUFFIX=""
+   # relative to bindir
+   -DCLANG_RESOURCE_DIR="../lib/clang/${clang_version}"
 
-DBUILD_SHARED_LIBS=ON
-DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
@@ -189,6 +189,9 @@ multilib_src_configure() {
 
 multilib_src_compile() {
cmake-utils_src_compile
+
+   # provide a symlink for tests
+   ln -s "../$(get_libdir)/clang" lib/clang || die
 }
 
 multilib_src_test() {
@@ -243,6 +246,11 @@ src_install() {
 
 multilib_src_install() {
cmake-utils_src_install
+
+   # move headers to the correct directory
+   dodir /usr/lib/clang
+   cp -pR "${ED}usr/$(get_libdir)/clang"/* "${ED}usr/lib/clang/" || die
+   rm -r "${ED}usr/$(get_libdir)/clang" || die
 }
 
 multilib_src_install_all() {

diff --git 
a/sys-devel/clang/files//0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch
 
b/sys-devel/clang/files//0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch
deleted file mode 100644
index da737c1..
--- 
a/sys-devel/clang/files//0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 8864d8f9da1b30c9539e9dc0388c5d0dccca3a34 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
-Date: Sun, 21 Aug 2016 23:31:06 +0200
-Subject: [PATCH 5/7] cmake: Supporting overriding runtime libdir via
- CLANG_LIBDIR_SUFFIX
-
-Make it possible to override the value of CLANG_LIBDIR_SUFFIX, and use
-it uniformly to control install location of runtimes (i.e. lib/clang),
-therefore supporting sharing a common runtime between multiple multilib
-variants.
-
-Previously, CLANG_LIBDIR_SUFFIX was pinned to LLVM_LIBDIR_SUFFIX
-and used only to define runtime path in driver code. This patch extends
-its use to building and installing the runtime (the former is needed for
-tests to work correctly).
-
-The goal is to support install layout alike "LLVM_LIBDIR_SUFFIX=64
-CLANG_LIBDIR_SUFFIX=''" -- where all shared libraries would be installed
-into ABI-specific /usr/lib64, while runtime (that is common between
-multilib ABIs) would be installed into /usr/lib.
-
-Bug: https://llvm.org/bugs/show_bug.cgi?id=23792
-Patch: https://reviews.llvm.org/D23752

- CMakeLists.txt | 5 +++--
- lib/Headers/CMakeLists.txt | 4 ++--
- runtime/CMakeLists.txt | 4 ++--
- 3 files changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index e95ab52..67b85b5 100644
 a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -235,8 +235,9 @@ endif()
- set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING
-   "Vendor-specific uti.")
- 
--# The libdir suffix must exactly match whatever LLVM's configuration used.
--set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}")
-+set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE
-+  STRING "Define suffix of library directory name for clang runtime (32/64)")
-+set(CLANG_LIBRARY_OUTPUT_INTDIR 
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${CLANG_LIBDIR_SUFFIX})
- 
- set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
- set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
-index 600fece..86a70c5 100644
 a/lib/Headers/CMakeLists.txt
-+++ 

[gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/, sys-devel/clang/files/9999/

2016-10-25 Thread Michał Górny
commit: 28b21272899b99cdf5784fd85c7857afe719ff02
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Oct 25 15:41:05 2016 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Oct 25 16:42:12 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28b21272

sys-devel/clang: gcc-config patch went upstream

 sys-devel/clang/clang-.ebuild  |  2 -
 ...ort-obtaining-active-toolchain-from-gcc-c.patch | 52 --
 2 files changed, 54 deletions(-)

diff --git a/sys-devel/clang/clang-.ebuild 
b/sys-devel/clang/clang-.ebuild
index a4bbcfa..6a09eb1 100644
--- a/sys-devel/clang/clang-.ebuild
+++ b/sys-devel/clang/clang-.ebuild
@@ -115,8 +115,6 @@ src_unpack() {
 src_prepare() {
python_setup
 
-   # automatically select active system GCC's libraries, bugs #406163 and 
#417913
-   eapply 
"${FILESDIR}"//0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch
# support overriding clang runtime install directory
eapply 
"${FILESDIR}"//0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch
# support overriding LLVMgold.so plugin directory

diff --git 
a/sys-devel/clang/files//0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch
 
b/sys-devel/clang/files//0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch
deleted file mode 100644
index 00bf280..
--- 
a/sys-devel/clang/files//0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 0384060d2de35ee56aa252cc18eccf773d674d56 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
-Date: Fri, 5 Sep 2014 16:49:35 +0200
-Subject: [PATCH] driver: Support obtaining active toolchain from gcc-config on
- Gentoo
-
-Author: Richard Yao 
-Bug: https://bugs.gentoo.org/406163
-Bug: https://bugs.gentoo.org/417913

- lib/Driver/ToolChains.cpp | 25 +
- 1 file changed, 25 insertions(+)
-
-diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index 67f165c..0f0d786 100644
 a/lib/Driver/ToolChains.cpp
-+++ b/lib/Driver/ToolChains.cpp
-@@ -1430,6 +1430,31 @@ void Generic_GCC::GCCInstallationDetector::init(
- }
-   }
- 
-+  // Try to respect gcc-config on Gentoo. However, do that only
-+  // if --gcc-toolchain is not provided or equal to the Gentoo default.
-+  // This avoids accidentally enforcing system GCC version when using
-+  // a custom toolchain.
-+  if (GCCToolchainDir == "" || GCCToolchainDir == D.SysRoot + "/usr") {
-+for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) {
-+  llvm::ErrorOr File =
-+  llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + 
CandidateTripleAliases[k].str());
-+  if (File)
-+  {
-+const std::string VersionText = 
File.get()->getBuffer().rsplit('-').second.substr(0,5).str();
-+const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + 
CandidateTripleAliases[k].str() + "/" + VersionText;
-+if (llvm::sys::fs::exists(GentooPath + "/crtbegin.o"))
-+{
-+  Version = GCCVersion::Parse(VersionText);
-+  GCCInstallPath = GentooPath;
-+  GCCParentLibPath = GCCInstallPath + "/../../..";
-+  GCCTriple.setTriple(CandidateTripleAliases[k]);
-+  IsValid = true;
-+  return;
-+}
-+  }
-+}
-+  }
-+
-   // Loop over the various components which exist and select the best GCC
-   // installation available. GCC installs are ranked by version number.
-   Version = GCCVersion::Parse("0.0.0");
--- 
-2.10.0
-



[gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/, sys-devel/clang/files/9999/

2016-09-02 Thread Michał Górny
commit: d236c73285432b874fea74b1e4f6afc7b606e751
Author: Michał Górny  gentoo  org>
AuthorDate: Fri Sep  2 20:32:48 2016 +
Commit: Michał Górny  gentoo  org>
CommitDate: Fri Sep  2 21:40:00 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d236c732

sys-devel/clang: Remove unnecessary llvm-lit search patch

Remove the llvm-lit search patch since it is no longer necessary and its
correctness is doubtful. Per https://reviews.llvm.org/D23743 the name
llvm-lit is not intended for system-wide install of lit. However, this
does not matter since the internal copy of lit is used when LLVM source
checkout is available, and unittests require this checkout to be
available when running tests.

 sys-devel/clang/clang-.ebuild  |  2 --
 ...t-llvm-lit-search-to-match-the-one-in-LLV.patch | 29 --
 2 files changed, 31 deletions(-)

diff --git a/sys-devel/clang/clang-.ebuild 
b/sys-devel/clang/clang-.ebuild
index 862afbd..1c89ad5 100644
--- a/sys-devel/clang/clang-.ebuild
+++ b/sys-devel/clang/clang-.ebuild
@@ -99,8 +99,6 @@ src_prepare() {
# automatically select active system GCC's libraries, bugs #406163 and 
#417913
# TODO: cross-linux tests broken by this one
eapply 
"${FILESDIR}"//0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch
-   # adjust llvm-lit search to match LLVM cmake macros
-   eapply 
"${FILESDIR}"//0004-cmake-Adjust-llvm-lit-search-to-match-the-one-in-LLV.patch
# support overriding clang runtime install directory
eapply 
"${FILESDIR}"//0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch
# support overriding LLVMgold.so plugin directory

diff --git 
a/sys-devel/clang/files//0004-cmake-Adjust-llvm-lit-search-to-match-the-one-in-LLV.patch
 
b/sys-devel/clang/files//0004-cmake-Adjust-llvm-lit-search-to-match-the-one-in-LLV.patch
deleted file mode 100644
index bcf409c..
--- 
a/sys-devel/clang/files//0004-cmake-Adjust-llvm-lit-search-to-match-the-one-in-LLV.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From d7bc0e05e8064e0c939db6c2fb6d215fd0340708 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
-Date: Sun, 21 Aug 2016 23:30:39 +0200
-Subject: [PATCH 4/7] cmake: Adjust llvm-lit search to match the one in LLVM
-
-Adjust the system lit executable search to look for llvm-lit as that is
-the name used in AddLLVM.cmake installed by LLVM.
-
-Patch: https://reviews.llvm.org/D23745

- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index aee0d0a..e95ab52 100644
 a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -140,7 +140,7 @@ Please install Python or specify the PYTHON_EXECUTABLE 
CMake variable.")
-   endif()
- else()
-   # Seek installed Lit.
--  find_program(LLVM_LIT "lit.py" ${LLVM_MAIN_SRC_DIR}/utils/lit
-+  find_program(LLVM_LIT "llvm-lit" ${LLVM_MAIN_SRC_DIR}/utils/lit
- DOC "Path to lit.py")
- endif()
- 
--- 
-2.9.3
-



[gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/, sys-devel/clang/files/9999/

2016-08-23 Thread Michał Górny
commit: 7ac0203c113cd880e7a6bc249206e9b006860f95
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Aug 23 20:31:19 2016 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Aug 23 20:32:17 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ac0203c

sys-devel/clang: rlimits check patch has been applied upstream

 sys-devel/clang/clang-.ebuild  |  2 -
 ...ort-checking-for-rlimits-via-cmake-when-b.patch | 84 --
 2 files changed, 86 deletions(-)

diff --git a/sys-devel/clang/clang-.ebuild 
b/sys-devel/clang/clang-.ebuild
index ad0fcf3..5d96509 100644
--- a/sys-devel/clang/clang-.ebuild
+++ b/sys-devel/clang/clang-.ebuild
@@ -90,8 +90,6 @@ src_prepare() {
# automatically select active system GCC's libraries, bugs #406163 and 
#417913
# TODO: cross-linux tests broken by this one
eapply 
"${FILESDIR}"//0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch
-   # use cmake checks for rlimits, rather than __has_include_next()
-   eapply 
"${FILESDIR}"//0003-driver-Support-checking-for-rlimits-via-cmake-when-b.patch
# adjust llvm-lit search to match LLVM cmake macros
eapply 
"${FILESDIR}"//0004-cmake-Adjust-llvm-lit-search-to-match-the-one-in-LLV.patch
# support overriding clang runtime install directory

diff --git 
a/sys-devel/clang/files//0003-driver-Support-checking-for-rlimits-via-cmake-when-b.patch
 
b/sys-devel/clang/files//0003-driver-Support-checking-for-rlimits-via-cmake-when-b.patch
deleted file mode 100644
index 16d63ec..
--- 
a/sys-devel/clang/files//0003-driver-Support-checking-for-rlimits-via-cmake-when-b.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 27b65490c9764d18fa02274bbb4f75dd5a688506 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
-Date: Sun, 21 Aug 2016 23:30:17 +0200
-Subject: [PATCH 3/7] driver: Support checking for rlimits via cmake (when
- bootstrapping)
-
-Add a cmake check for sys/resource.h and replace the __has_include()
-check with its result, in order to make it possible to use rlimits when
-building with compilers not supporting __has_include() -- i.e. when
-bootstrapping.
-
-Patch: https://reviews.llvm.org/D23744

- CMakeLists.txt  | 3 +++
- include/clang/Config/config.h.cmake | 3 +++
- tools/driver/cc1_main.cpp   | 8 +++-
- 3 files changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index e6dde85..aee0d0a 100644
 a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -177,6 +177,9 @@ if (LIBXML2_FOUND)
-   set(CLANG_HAVE_LIBXML 1)
- endif()
- 
-+include(CheckIncludeFile)
-+check_include_file(sys/resource.h CLANG_HAVE_RLIMITS)
-+
- set(CLANG_RESOURCE_DIR "" CACHE STRING
-   "Relative directory from the Clang binary to its resource files.")
- 
-diff --git a/include/clang/Config/config.h.cmake 
b/include/clang/Config/config.h.cmake
-index 9200ed9..9bf9ea5 100644
 a/include/clang/Config/config.h.cmake
-+++ b/include/clang/Config/config.h.cmake
-@@ -35,6 +35,9 @@
- /* Define if we have libxml2 */
- #cmakedefine CLANG_HAVE_LIBXML ${CLANG_HAVE_LIBXML}
- 
-+/* Define if we have sys/resource.h (rlimits) */
-+#cmakedefine CLANG_HAVE_RLIMITS ${CLANG_HAVE_RLIMITS}
-+
- /* The LLVM product name and version */
- #define BACKEND_PACKAGE_STRING "${BACKEND_PACKAGE_STRING}"
- 
-diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp
-index b8cea41..45d44a0 100644
 a/tools/driver/cc1_main.cpp
-+++ b/tools/driver/cc1_main.cpp
-@@ -15,6 +15,7 @@
- 
- #include "llvm/Option/Arg.h"
- #include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
-+#include "clang/Config/config.h"
- #include "clang/Driver/DriverDiagnostic.h"
- #include "clang/Driver/Options.h"
- #include "clang/Frontend/CompilerInstance.h"
-@@ -37,12 +38,9 @@
- #include "llvm/Support/raw_ostream.h"
- #include 
- 
--#ifdef __has_include
--#if __has_include()
--#define HAVE_RLIMITS
-+#ifdef CLANG_HAVE_RLIMITS
- #include 
- #endif
--#endif
- 
- using namespace clang;
- using namespace llvm::opt;
-@@ -73,7 +71,7 @@ void initializePollyPasses(llvm::PassRegistry );
- }
- #endif
- 
--#ifdef HAVE_RLIMITS
-+#ifdef CLANG_HAVE_RLIMITS
- // The amount of stack we think is "sufficient". If less than this much is
- // available, we may be unable to reach our template instantiation depth
- // limit and other similar limits.
--- 
-2.9.3
-



[gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/, sys-devel/clang/files/9999/

2016-08-22 Thread Michał Górny
commit: 4ab9c2e321dbe726cbf8083adc157d1bc63e36de
Author: Michał Górny  gentoo  org>
AuthorDate: Sat Aug 20 21:38:24 2016 +
Commit: Michał Górny  gentoo  org>
CommitDate: Mon Aug 22 15:11:49 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ab9c2e3

sys-devel/clang: Enable stand-alone builds against sys-devel/llvm

 sys-devel/clang/clang--r100.ebuild |  36 ---
 sys-devel/clang/clang-.ebuild  | 265 +
 ...rdering-dep-between-HTML-Sphinx-docs-and-.patch |  27 +++
 ...ort-obtaining-active-toolchain-from-gcc-c.patch |  46 
 ...ort-checking-for-rlimits-via-cmake-when-b.patch |  84 +++
 ...t-llvm-lit-search-to-match-the-one-in-LLV.patch |  29 +++
 ...rting-overriding-runtime-libdir-via-CLANG.patch |  86 +++
 ...LANG_GOLD_LIBDIR_SUFFIX-to-specify-loc-of.patch |  64 +
 ...port-stand-alone-Sphinx-doxygen-doc-build.patch |  64 +
 sys-devel/clang/metadata.xml   |   2 +
 10 files changed, 667 insertions(+), 36 deletions(-)

diff --git a/sys-devel/clang/clang--r100.ebuild 
b/sys-devel/clang/clang--r100.ebuild
deleted file mode 100644
index eb10ee5..000
--- a/sys-devel/clang/clang--r100.ebuild
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit multilib-build
-
-DESCRIPTION="C language family frontend for LLVM (meta-ebuild)"
-HOMEPAGE="http://clang.llvm.org/;
-SRC_URI=""
-
-LICENSE="UoI-NCSA"
-SLOT="0/${PV}"
-KEYWORDS=""
-IUSE="debug multitarget python +static-analyzer"
-
-RDEPEND="~sys-devel/llvm-${PV}[clang(-),debug=,multitarget?,python?,static-analyzer?,${MULTILIB_USEDEP}]"
-
-# Please keep this package around since it's quite likely that we'll
-# return to separate LLVM & clang ebuilds when the cmake build system
-# is complete.
-
-pkg_postinst() {
-   if has_version ">=dev-util/ccache-3.1.9-r2" ; then
-   #add ccache links as clang might get installed after ccache
-   "${EROOT}"/usr/bin/ccache-config --install-links
-   fi
-}
-
-pkg_postrm() {
-   if has_version ">=dev-util/ccache-3.1.9-r2" && [[ -z 
${REPLACED_BY_VERSION} ]]; then
-   # --remove-links would remove all links, --install-links 
updates them
-   "${EROOT}"/usr/bin/ccache-config --install-links
-   fi
-}

diff --git a/sys-devel/clang/clang-.ebuild 
b/sys-devel/clang/clang-.ebuild
new file mode 100644
index 000..ad0fcf3
--- /dev/null
+++ b/sys-devel/clang/clang-.ebuild
@@ -0,0 +1,265 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+CMAKE_MIN_VERSION=3.4.3
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils flag-o-matic git-r3 multilib-minimal \
+   python-single-r1 toolchain-funcs pax-utils
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="http://llvm.org/;
+SRC_URI=""
+EGIT_REPO_URI="http://llvm.org/git/clang.git
+   https://github.com/llvm-mirror/clang.git;
+
+LICENSE="UoI-NCSA"
+SLOT="0/${PV%.*}"
+KEYWORDS=""
+IUSE="debug default-compiler-rt default-libcxx +doc multitarget python
+   +static-analyzer test xml video_cards_radeon elibc_musl kernel_FreeBSD"
+
+RDEPEND="
+   
~sys-devel/llvm-${PV}:=[debug=,multitarget?,video_cards_radeon?,${MULTILIB_USEDEP}]
+   static-analyzer? ( dev-lang/perl:* )
+   xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+   !http://llvm.org/git/clang-tools-extra.git
+   https://github.com/llvm-mirror/clang-tools-extra.git;
+   git-r3_fetch
+
+   git-r3_checkout http://llvm.org/git/clang-tools-extra.git \
+   "${S}"/tools/clang/tools/extra
+   git-r3_checkout
+}
+
+src_prepare() {
+   python_setup
+
+   # fix race condition between sphinx targets
+   eapply 
"${FILESDIR}"//0001-cmake-Add-ordering-dep-between-HTML-Sphinx-docs-and-.patch
+   # automatically select active system GCC's libraries, bugs #406163 and 
#417913
+   # TODO: cross-linux tests broken by this one
+   eapply 
"${FILESDIR}"//0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch
+   # use cmake checks for rlimits, rather than __has_include_next()
+   eapply 
"${FILESDIR}"//0003-driver-Support-checking-for-rlimits-via-cmake-when-b.patch
+   # adjust llvm-lit search to match LLVM cmake macros
+   eapply 
"${FILESDIR}"//0004-cmake-Adjust-llvm-lit-search-to-match-the-one-in-LLV.patch
+   # support overriding clang runtime install directory
+   eapply 
"${FILESDIR}"//0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch
+   # support overriding LLVMgold.so plugin directory
+   eapply 
"${FILESDIR}"//0006-cmake-Add-CLANG_GOLD_LIBDIR_SUFFIX-to-specify-loc-of.patch
+   # fix stand-alone doc build
+   eapply