diff options
Diffstat (limited to 'sys-devel/llvm/files/cmake')
6 files changed, 201 insertions, 0 deletions
diff --git a/sys-devel/llvm/files/cmake/0002-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch b/sys-devel/llvm/files/cmake/0002-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch new file mode 100644 index 000000000000..3e57f0dcaa68 --- /dev/null +++ b/sys-devel/llvm/files/cmake/0002-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch @@ -0,0 +1,36 @@ +From 2ec240a76253839cd1c5dc2e964f55698ae468fc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Mon, 8 Jun 2015 06:43:00 +0200 +Subject: [PATCH 2/4] cmake: Support overriding Sphinx HTML doc install + directory + +Provide ${PROJECT}_INSTALL_HTML variables (e.g. LLVM_INSTALL_HTML) to +override Sphinx HTML doc install directory. + +Fixes: https://llvm.org/bugs/show_bug.cgi?id=23780 +--- + cmake/modules/AddSphinxTarget.cmake | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake +index 045dc23..9c9c444 100644 +--- a/cmake/modules/AddSphinxTarget.cmake ++++ b/cmake/modules/AddSphinxTarget.cmake +@@ -53,8 +53,12 @@ function (add_sphinx_target builder project) + DESTINATION share/man/man1) + + elseif (builder STREQUAL html) +- install(DIRECTORY "${SPHINX_BUILD_DIR}" +- DESTINATION "share/doc/${project}") ++ string(TOUPPER "${project}" project_upper) ++ set(${project_upper}_INSTALL_HTML "share/doc/${project}/html" ++ CACHE STRING "HTML documentation install directory for ${project}") ++ ++ install(DIRECTORY "${SPHINX_BUILD_DIR}/" ++ DESTINATION "${${project_upper}_INSTALL_HTML}") + else() + message(WARNING Installation of ${builder} not supported) + endif() +-- +2.4.3 + diff --git a/sys-devel/llvm/files/cmake/0003-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch b/sys-devel/llvm/files/cmake/0003-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch new file mode 100644 index 000000000000..b1c74c69443f --- /dev/null +++ b/sys-devel/llvm/files/cmake/0003-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch @@ -0,0 +1,32 @@ +From 4f7092ba05cccfeea7d26177d93f3d7a57d9bce2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Mon, 8 Jun 2015 14:29:03 +0200 +Subject: [PATCH 3/4] cmake: Add an ordering dep between HTML & man Sphinx + targets + +Add a dependency between HTML & manpage Sphinx targets to prevent two +instances of Sphinx from running in parallel, and therefore solves race +conditions reusing the same doctree directory. + +Fixes: https://llvm.org/bugs/show_bug.cgi?id=23781 +--- + docs/CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt +index da27627..63309a6 100644 +--- a/docs/CMakeLists.txt ++++ b/docs/CMakeLists.txt +@@ -100,6 +100,9 @@ if (LLVM_ENABLE_SPHINX) + + if (${SPHINX_OUTPUT_MAN}) + add_sphinx_target(man llvm) ++ if (${SPHINX_OUTPUT_HTML}) ++ add_dependencies(docs-llvm-html docs-llvm-man) ++ endif() + endif() + + endif() +-- +2.4.3 + diff --git a/sys-devel/llvm/files/cmake/0004-cmake-Do-not-install-libgtest.patch b/sys-devel/llvm/files/cmake/0004-cmake-Do-not-install-libgtest.patch new file mode 100644 index 000000000000..92ca2e47e81b --- /dev/null +++ b/sys-devel/llvm/files/cmake/0004-cmake-Do-not-install-libgtest.patch @@ -0,0 +1,28 @@ +From d9f80393cfd4e586242ac3efd4e6ba6b49ce39ae Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Tue, 9 Jun 2015 11:58:52 +0200 +Subject: [PATCH 4/4] cmake: Do not install libgtest + +libgtest is an internal test dependency, and should not be installed to +the live system as a part of LLVM. +--- + utils/unittest/CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/utils/unittest/CMakeLists.txt b/utils/unittest/CMakeLists.txt +index b34e22a..3fe5884 100644 +--- a/utils/unittest/CMakeLists.txt ++++ b/utils/unittest/CMakeLists.txt +@@ -41,6 +41,9 @@ if (PTHREAD_LIBRARY_PATH) + list(APPEND LIBS pthread) + endif() + ++# Delay building until the tests pull it in, and avoid installing it ++set(EXCLUDE_FROM_ALL ON) ++ + add_llvm_library(gtest + googletest/src/gtest-all.cc + +-- +2.4.3 + diff --git a/sys-devel/llvm/files/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch b/sys-devel/llvm/files/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch new file mode 100644 index 000000000000..904a72a358a9 --- /dev/null +++ b/sys-devel/llvm/files/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch @@ -0,0 +1,52 @@ +From b28503def986bcbc388a04be0d51cbe80bc59506 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Tue, 9 Jun 2015 12:11:50 +0200 +Subject: [PATCH] Install clang runtime into /usr/lib (without suffix) + +--- + lib/Driver/Driver.cpp | 3 +-- + lib/Frontend/CompilerInvocation.cpp | 3 +-- + lib/Headers/CMakeLists.txt | 2 +- + 3 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp +index a04a1f8..418d46a 100644 +--- a/tools/clang/lib/Driver/Driver.cpp ++++ b/tools/clang//lib/Driver/Driver.cpp +@@ -66,8 +66,7 @@ Driver::Driver(StringRef ClangExecutable, StringRef DefaultTargetTriple, + if (ClangResourceDir != "") { + llvm::sys::path::append(P, ClangResourceDir); + } else { +- StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX); +- llvm::sys::path::append(P, "..", Twine("lib") + ClangLibdirSuffix, "clang", ++ llvm::sys::path::append(P, "..", "lib", "clang", + CLANG_VERSION_STRING); + } + ResourceDir = P.str(); +diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp +index 9485767..0b9ecbd 100644 +--- a/tools/clang/lib/Frontend/CompilerInvocation.cpp ++++ b/tools/clang/lib/Frontend/CompilerInvocation.cpp +@@ -1053,8 +1053,7 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0, + if (ClangResourceDir != "") { + llvm::sys::path::append(P, ClangResourceDir); + } else { +- StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX); +- llvm::sys::path::append(P, "..", Twine("lib") + ClangLibdirSuffix, "clang", ++ llvm::sys::path::append(P, "..", "lib", "clang", + CLANG_VERSION_STRING); + } + +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index 29a738e..3769d23 100644 +--- a/tools/clang/lib/Headers/CMakeLists.txt ++++ b/tools/clang/lib/Headers/CMakeLists.txt +@@ -93,4 +93,4 @@ set_target_properties(clang-headers PROPERTIES FOLDER "Misc") + install( + FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++ DESTINATION lib/clang/${CLANG_VERSION}/include) +-- +2.4.3 + diff --git a/sys-devel/llvm/files/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch b/sys-devel/llvm/files/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch new file mode 100644 index 000000000000..0b93deba0b58 --- /dev/null +++ b/sys-devel/llvm/files/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch @@ -0,0 +1,28 @@ +From d07632abe23d55eec2aae303a142a97765a77d32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Tue, 9 Jun 2015 12:20:06 +0200 +Subject: [PATCH 2/2] cmake: Make CLANG_LIBDIR_SUFFIX overridable + +Make CLANG_LIBDIR_SUFFIX a cache variable so that it can be explicitly +overriden. It is used purely to find the LLVMgold.so plugin, so we want +to set it to native suffix. +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 357286b..647f976 100644 +--- a/tools/clang/CMakeLists.txt ++++ b/tools/clang/CMakeLists.txt +@@ -203,7 +203,7 @@ 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 "") + + set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) +-- +2.4.3 + diff --git a/sys-devel/llvm/files/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch b/sys-devel/llvm/files/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch new file mode 100644 index 000000000000..93538009d291 --- /dev/null +++ b/sys-devel/llvm/files/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch @@ -0,0 +1,25 @@ +From 8bd62a681744d3c31a0837c0f84f99ea4987e017 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Tue, 9 Jun 2015 12:17:57 +0200 +Subject: [PATCH] cmake: Install compiler-rt into /usr/lib (without suffix) + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0d8a880..5ae98a9 100644 +--- a/projects/compiler-rt/CMakeLists.txt ++++ b/projects/compiler-rt/CMakeLists.txt +@@ -52,7 +52,7 @@ if (NOT COMPILER_RT_STANDALONE_BUILD) + # Setup the paths where compiler-rt runtimes and headers should be stored. + set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}) + set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) +- set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) ++ set(COMPILER_RT_INSTALL_PATH lib/clang/${CLANG_VERSION}) + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." + ${LLVM_INCLUDE_TESTS}) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" +-- +2.4.3 + |