From 1df08f31ba52089b64f26235bc0ac3de57a3deb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 21 Dec 2016 17:02:26 +0100 Subject: sys-devel/llvm: Move patches around for 3.9.1 --- ...ll-OCaml-modules-into-correct-package-loc.patch | 71 --- ...e-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch | 28 - ...rt-overriding-Sphinx-HTML-doc-install-dir.patch | 37 -- ...n-ordering-dep-between-HTML-man-Sphinx-ta.patch | 33 - ...roduce-ldconfig-compatible-SOVERSIONs-on-.patch | 62 -- ...clang-runtime-into-usr-lib-without-suffix.patch | 35 - ...make-Make-CLANG_LIBDIR_SUFFIX-overridable.patch | 28 - .../3.9.0/clang/darwin_prefix-include-paths.patch | 18 - .../llvm/files/3.9.0/clang/default-libs.patch | 703 --------------------- ...ll-compiler-rt-into-usr-lib-without-suffi.patch | 25 - sys-devel/llvm/files/3.9.0/lldb/six.patch | 13 - sys-devel/llvm/files/3.9.0/llvm-config-r1.patch | 73 --- ...ll-OCaml-modules-into-correct-package-loc.patch | 71 +++ ...e-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch | 28 + ...rt-overriding-Sphinx-HTML-doc-install-dir.patch | 37 ++ ...n-ordering-dep-between-HTML-man-Sphinx-ta.patch | 33 + ...roduce-ldconfig-compatible-SOVERSIONs-on-.patch | 62 ++ ...clang-runtime-into-usr-lib-without-suffix.patch | 35 + ...make-Make-CLANG_LIBDIR_SUFFIX-overridable.patch | 28 + .../3.9.1/clang/darwin_prefix-include-paths.patch | 18 + .../llvm/files/3.9.1/clang/default-libs.patch | 703 +++++++++++++++++++++ ...ll-compiler-rt-into-usr-lib-without-suffi.patch | 25 + sys-devel/llvm/files/3.9.1/lldb/six.patch | 13 + sys-devel/llvm/files/3.9.1/llvm-config-r1.patch | 73 +++ sys-devel/llvm/llvm-3.4.2-r100.ebuild | 2 +- sys-devel/llvm/llvm-3.5.2.ebuild | 2 +- sys-devel/llvm/llvm-3.6.2.ebuild | 2 +- sys-devel/llvm/llvm-3.7.1-r3.ebuild | 12 +- sys-devel/llvm/llvm-3.8.1-r2.ebuild | 18 +- sys-devel/llvm/llvm-3.8.1.ebuild | 16 +- sys-devel/llvm/llvm-3.9.0-r1.ebuild | 24 +- 31 files changed, 1164 insertions(+), 1164 deletions(-) delete mode 100644 sys-devel/llvm/files/3.9.0/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch delete mode 100644 sys-devel/llvm/files/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch delete mode 100644 sys-devel/llvm/files/3.9.0/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch delete mode 100644 sys-devel/llvm/files/3.9.0/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch delete mode 100644 sys-devel/llvm/files/3.9.0/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch delete mode 100644 sys-devel/llvm/files/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch delete mode 100644 sys-devel/llvm/files/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch delete mode 100644 sys-devel/llvm/files/3.9.0/clang/darwin_prefix-include-paths.patch delete mode 100644 sys-devel/llvm/files/3.9.0/clang/default-libs.patch delete mode 100644 sys-devel/llvm/files/3.9.0/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch delete mode 100644 sys-devel/llvm/files/3.9.0/lldb/six.patch delete mode 100644 sys-devel/llvm/files/3.9.0/llvm-config-r1.patch create mode 100644 sys-devel/llvm/files/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch create mode 100644 sys-devel/llvm/files/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch create mode 100644 sys-devel/llvm/files/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch create mode 100644 sys-devel/llvm/files/3.9.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch create mode 100644 sys-devel/llvm/files/3.9.1/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch create mode 100644 sys-devel/llvm/files/3.9.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch create mode 100644 sys-devel/llvm/files/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch create mode 100644 sys-devel/llvm/files/3.9.1/clang/darwin_prefix-include-paths.patch create mode 100644 sys-devel/llvm/files/3.9.1/clang/default-libs.patch create mode 100644 sys-devel/llvm/files/3.9.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch create mode 100644 sys-devel/llvm/files/3.9.1/lldb/six.patch create mode 100644 sys-devel/llvm/files/3.9.1/llvm-config-r1.patch (limited to 'sys-devel/llvm') diff --git a/sys-devel/llvm/files/3.9.0/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch b/sys-devel/llvm/files/3.9.0/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch deleted file mode 100644 index 367a8a7794f..00000000000 --- a/sys-devel/llvm/files/3.9.0/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 2907883b3c504a08b98cf735ceaa8e438d20f37e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= -Date: Sun, 21 Aug 2016 22:46:48 +0200 -Subject: [PATCH 01/10] cmake: Install OCaml modules into correct package - location - -Ensure that correct libdir is used for OCaml modules, and install them -into dedicated llvm subdirectory rather than the top directory which is -supposedly reserved for the standard library. - -Author: Mark Wright -Bug: https://bugs.gentoo.org/559134 -Bug: https://bugs.gentoo.org/559624 ---- - bindings/ocaml/backends/CMakeLists.txt | 2 +- - bindings/ocaml/llvm/CMakeLists.txt | 2 +- - cmake/modules/AddOCaml.cmake | 6 +++--- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/bindings/ocaml/backends/CMakeLists.txt b/bindings/ocaml/backends/CMakeLists.txt -index a980638..9e5dc50 100644 ---- a/bindings/ocaml/backends/CMakeLists.txt -+++ b/bindings/ocaml/backends/CMakeLists.txt -@@ -23,5 +23,5 @@ foreach(TARGET ${LLVM_TARGETS_TO_BUILD}) - "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}") - - install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}" -- DESTINATION lib/ocaml) -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm) - endforeach() -diff --git a/bindings/ocaml/llvm/CMakeLists.txt b/bindings/ocaml/llvm/CMakeLists.txt -index 4956fa4..c612f73 100644 ---- a/bindings/ocaml/llvm/CMakeLists.txt -+++ b/bindings/ocaml/llvm/CMakeLists.txt -@@ -8,4 +8,4 @@ configure_file( - "${LLVM_LIBRARY_DIR}/ocaml/META.llvm") - - install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm" -- DESTINATION lib/ocaml) -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm) -diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake -index e3dd1d8..a16238e 100644 ---- a/cmake/modules/AddOCaml.cmake -+++ b/cmake/modules/AddOCaml.cmake -@@ -137,7 +137,7 @@ function(add_ocaml_library name) - if( APPLE ) - set(ocaml_rpath "@executable_path/../../lib") - elseif( UNIX ) -- set(ocaml_rpath "\\$ORIGIN/../../lib") -+ set(ocaml_rpath "\\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}") - endif() - list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") - -@@ -189,12 +189,12 @@ function(add_ocaml_library name) - endforeach() - - install(FILES ${install_files} -- DESTINATION lib/ocaml) -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm) - install(FILES ${install_shlibs} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE -- DESTINATION lib/ocaml) -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm) - - foreach( install_file ${install_files} ${install_shlibs} ) - get_filename_component(filename "${install_file}" NAME) --- -2.9.3 - diff --git a/sys-devel/llvm/files/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch b/sys-devel/llvm/files/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch deleted file mode 100644 index b90527a0e44..00000000000 --- a/sys-devel/llvm/files/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 726806d9b4932287d67f9b6b112099648ea008b4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= -Date: Sun, 21 Aug 2016 23:01:47 +0200 -Subject: [PATCH 02/10] cmake: Make OCaml docs dependent on LLVM_BUILD_DOCS - -Author: Bernard Cafarelli -Bug: https://bugs.gentoo.org/562008 -Patch: https://reviews.llvm.org/D23763 ---- - docs/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt -index eaa1750..f2cd7e9 100644 ---- a/docs/CMakeLists.txt -+++ b/docs/CMakeLists.txt -@@ -115,7 +115,7 @@ if (LLVM_ENABLE_SPHINX) - endif() - - list(FIND LLVM_BINDINGS_LIST ocaml uses_ocaml) --if( NOT uses_ocaml LESS 0 ) -+if( NOT uses_ocaml LESS 0 AND LLVM_BUILD_DOCS ) - set(doc_targets - ocaml_llvm - ocaml_llvm_all_backends --- -2.9.3 - diff --git a/sys-devel/llvm/files/3.9.0/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch b/sys-devel/llvm/files/3.9.0/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch deleted file mode 100644 index 76adf52fb94..00000000000 --- a/sys-devel/llvm/files/3.9.0/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 1251ac2021b768d3a56b4dc03212ea2fd12a34dd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= -Date: Mon, 8 Jun 2015 06:43:00 +0200 -Subject: [PATCH 03/10] 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. - -Bug: https://llvm.org/bugs/show_bug.cgi?id=23780 -Patch: https://reviews.llvm.org/D23757 ---- - 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..fac143f 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.9.3 - diff --git a/sys-devel/llvm/files/3.9.0/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch b/sys-devel/llvm/files/3.9.0/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch deleted file mode 100644 index 94a81574d6e..00000000000 --- a/sys-devel/llvm/files/3.9.0/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 2f798e87c10a93235a00e95c38e736f9ff7e991b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= -Date: Mon, 8 Jun 2015 14:29:03 +0200 -Subject: [PATCH 04/10] 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. - -Bug: https://llvm.org/bugs/show_bug.cgi?id=23781 -Patch: https://reviews.llvm.org/D23755 ---- - docs/CMakeLists.txt | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt -index f2cd7e9..179a65b 100644 ---- a/docs/CMakeLists.txt -+++ b/docs/CMakeLists.txt -@@ -109,6 +109,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.9.3 - diff --git a/sys-devel/llvm/files/3.9.0/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch b/sys-devel/llvm/files/3.9.0/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch deleted file mode 100644 index 6634cdebe35..00000000000 --- a/sys-devel/llvm/files/3.9.0/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch +++ /dev/null @@ -1,62 +0,0 @@ -From aeddc35a35c55f487977d7609060225e03e2028b Mon Sep 17 00:00:00 2001 -From: Michal Gorny -Date: Tue, 4 Oct 2016 06:09:18 +0000 -Subject: [PATCH] [cmake] Reintroduce (ldconfig-compatible) SOVERSIONs on - shared libraries - -Reintroduce versioning of shared libraries via SOVERSION, addressing -the issues with the previous design, since Gentoo is relying -on shared-split install of LLVM. The SOVERSIONs were originally -introduced in r229720 for all libraries, and removed in r252093 in favor -of custom SONAME. As far as I understand, the major concern with the old -versioning was that the used versions were incompatible with ldconfig. - -Having considered that, this commit introduce SOVERSIONS with the -following considerations: - -1. SOVERSIONs are formed of major & minor version concatenated -- i.e. -for 4.0 its .so.40. This matches the common practice where the first -version number indicates ABI breakage, and therefore fixes the issues -with ldconfig. Additionally, VERSION with the remaining verion -components appended is used, however this is not strictly necessary. - -2. The versioning is only applied to libraries with no explicit SONAME -specified -- i.e. it won't apply to libLLVM but only to the split -libraries. It will also apply to libraries installed by the subprojects. - -3. The versioning is only done on *nix systems, Darwin excluded. This -matches the current use of SONAME. - -Differential Revision: https://reviews.llvm.org/D24757 - -git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283189 91177308-0d34-0410-b5e6-96231b3b80d8 ---- - cmake/modules/AddLLVM.cmake | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake -index 37b3b80..7cb1b0c 100644 ---- a/cmake/modules/AddLLVM.cmake -+++ b/cmake/modules/AddLLVM.cmake -@@ -450,6 +450,18 @@ function(llvm_add_library name) - PREFIX "" - ) - endif() -+ -+ # Set SOVERSION on shared libraries that lack explicit SONAME -+ # specifier, on *nix systems that are not Darwin. -+ if(UNIX AND NOT APPLE AND NOT ARG_SONAME) -+ set_target_properties(${name} -+ PROPERTIES -+ # Concatenate the version numbers since ldconfig expects exactly -+ # one component indicating the ABI version, while LLVM uses -+ # major+minor for that. -+ SOVERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR} -+ VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}) -+ endif() - endif() - - if(ARG_MODULE OR ARG_SHARED) --- -2.10.0 - diff --git a/sys-devel/llvm/files/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch b/sys-devel/llvm/files/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch deleted file mode 100644 index 931eb56e5a9..00000000000 --- a/sys-devel/llvm/files/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp -index fa7780f..e3a6c8f 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 f078b37..0c514fc 100644 ---- a/tools/clang/lib/Frontend/CompilerInvocation.cpp -+++ b/tools/clang/lib/Frontend/CompilerInvocation.cpp -@@ -1097,7 +1097,7 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0, - if (ClangResourceDir != "") - llvm::sys::path::append(P, ClangResourceDir); - else -- llvm::sys::path::append(P, "..", Twine("lib") + CLANG_LIBDIR_SUFFIX, -+ llvm::sys::path::append(P, "..", "lib", - "clang", CLANG_VERSION_STRING); - - return P.str(); -diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt -index 7de5fbe..49f439b 100644 ---- a/tools/clang/lib/Headers/CMakeLists.txt -+++ b/tools/clang/lib/Headers/CMakeLists.txt -@@ -100,4 +100,4 @@ set_target_properties(clang-headers PROPERTIES FOLDER "Misc") - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ -- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) -+ DESTINATION lib/clang/${CLANG_VERSION}/include) diff --git a/sys-devel/llvm/files/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch b/sys-devel/llvm/files/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch deleted file mode 100644 index 0b93deba0b5..00000000000 --- a/sys-devel/llvm/files/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d07632abe23d55eec2aae303a142a97765a77d32 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= -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/3.9.0/clang/darwin_prefix-include-paths.patch b/sys-devel/llvm/files/3.9.0/clang/darwin_prefix-include-paths.patch deleted file mode 100644 index ed332f3f68a..00000000000 --- a/sys-devel/llvm/files/3.9.0/clang/darwin_prefix-include-paths.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/tools/clang/lib/Frontend/InitHeaderSearch.cpp -+++ b/tools/clang/lib/Frontend/InitHeaderSearch.cpp -@@ -233,6 +233,7 @@ - case llvm::Triple::Bitrig: - break; - default: -+ AddPath("@GENTOO_PORTAGE_EPREFIX@/usr/include", System, false); - // FIXME: temporary hack: hard-coded paths. - AddPath("/usr/local/include", System, false); - break; -@@ -505,6 +506,7 @@ - // Add the default framework include paths on Darwin. - if (HSOpts.UseStandardSystemIncludes) { - if (triple.isOSDarwin()) { -+ AddPath("@GENTOO_PORTAGE_EPREFIX@/Frameworks", System, true); - AddPath("/System/Library/Frameworks", System, true); - AddPath("/Library/Frameworks", System, true); - } diff --git a/sys-devel/llvm/files/3.9.0/clang/default-libs.patch b/sys-devel/llvm/files/3.9.0/clang/default-libs.patch deleted file mode 100644 index 12ef52d5b68..00000000000 --- a/sys-devel/llvm/files/3.9.0/clang/default-libs.patch +++ /dev/null @@ -1,703 +0,0 @@ -From 2d354bfbb2f5efdf3f6b2405078f9ccb65c21536 Mon Sep 17 00:00:00 2001 -From: Jonas Hahnfeld -Date: Wed, 27 Jul 2016 08:15:54 +0000 -Subject: [PATCH] Support setting default value for -rtlib at build time - -This patch introduces a new cmake variable: CLANG_DEFAULT_RTLIB, thru -which we can specify a default value for -rtlib (libgcc or -compiler-rt) at build time, just like how we set the default C++ -stdlib thru CLANG_DEFAULT_CXX_STDLIB. - -With these two options, we can configure clang to build binaries on -Linux that have no runtime dependence on any gcc libs (libstdc++ or -libgcc_s). - -Patch by Lei Zhang! - -Differential Revision: https://reviews.llvm.org/D22663 - -git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276848 91177308-0d34-0410-b5e6-96231b3b80d8 ---- - CMakeLists.txt | 10 +++++ - include/clang/Config/config.h.cmake | 3 ++ - lib/Driver/ToolChain.cpp | 22 ++++++----- - lib/Driver/ToolChains.cpp | 23 ++++++----- - lib/Driver/ToolChains.h | 2 + - test/Driver/linux-ld.c | 76 ++++++++++++++++++------------------- - test/Driver/miamcu-opt.c | 14 +++---- - test/Driver/miamcu-opt.cpp | 2 +- - test/Driver/mingw-libgcc.c | 24 ++++++------ - test/Driver/mingw.cpp | 14 +++---- - test/Driver/mips-mti-linux.c | 4 +- - test/Driver/sanitizer-ld.c | 2 +- - test/Driver/windows-cross.c | 2 +- - test/OpenMP/linking.c | 18 +++++---- - 14 files changed, 121 insertions(+), 95 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cfcd221..aec4579 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -201,6 +201,16 @@ if (NOT(CLANG_DEFAULT_CXX_STDLIB STREQUAL "" OR - set(CLANG_DEFAULT_CXX_STDLIB "") - endif() - -+set(CLANG_DEFAULT_RTLIB "" CACHE STRING -+ "Default runtime library to use (\"libgcc\" or \"compiler-rt\", empty for platform default)") -+if (NOT(CLANG_DEFAULT_RTLIB STREQUAL "" OR -+ CLANG_DEFAULT_RTLIB STREQUAL "libgcc" OR -+ CLANG_DEFAULT_RTLIB STREQUAL "compiler-rt")) -+ message(WARNING "Resetting default rtlib to use platform default") -+ set(CLANG_DEFAULT_RTLIB "" CACHE STRING -+ "Default runtime library to use (\"libgcc\" or \"compiler-rt\", empty for platform default)" FORCE) -+endif() -+ - set(CLANG_DEFAULT_OPENMP_RUNTIME "libomp" CACHE STRING - "Default OpenMP runtime used by -fopenmp.") - -diff --git a/include/clang/Config/config.h.cmake b/include/clang/Config/config.h.cmake -index e5a1d0d..9200ed9 100644 ---- a/include/clang/Config/config.h.cmake -+++ b/include/clang/Config/config.h.cmake -@@ -11,6 +11,9 @@ - /* Default C++ stdlib to use. */ - #define CLANG_DEFAULT_CXX_STDLIB "${CLANG_DEFAULT_CXX_STDLIB}" - -+/* Default runtime library to use. */ -+#define CLANG_DEFAULT_RTLIB "${CLANG_DEFAULT_RTLIB}" -+ - /* Default OpenMP runtime used by -fopenmp. */ - #define CLANG_DEFAULT_OPENMP_RUNTIME "${CLANG_DEFAULT_OPENMP_RUNTIME}" - -diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp -index e96688c..b825d63 100644 ---- a/lib/Driver/ToolChain.cpp -+++ b/lib/Driver/ToolChain.cpp -@@ -526,15 +526,19 @@ void ToolChain::addProfileRTLibs(const llvm::opt::ArgList &Args, - - ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType( - const ArgList &Args) const { -- if (Arg *A = Args.getLastArg(options::OPT_rtlib_EQ)) { -- StringRef Value = A->getValue(); -- if (Value == "compiler-rt") -- return ToolChain::RLT_CompilerRT; -- if (Value == "libgcc") -- return ToolChain::RLT_Libgcc; -- getDriver().Diag(diag::err_drv_invalid_rtlib_name) -- << A->getAsString(Args); -- } -+ const Arg* A = Args.getLastArg(options::OPT_rtlib_EQ); -+ StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_RTLIB; -+ -+ // "platform" is only used in tests to override CLANG_DEFAULT_RTLIB -+ if (LibName == "compiler-rt") -+ return ToolChain::RLT_CompilerRT; -+ else if (LibName == "libgcc") -+ return ToolChain::RLT_Libgcc; -+ else if (LibName == "platform") -+ return GetDefaultRuntimeLibType(); -+ -+ if (A) -+ getDriver().Diag(diag::err_drv_invalid_rtlib_name) << A->getAsString(Args); - - return GetDefaultRuntimeLibType(); - } -diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp -index 347aa29..6027bbf 100644 ---- a/lib/Driver/ToolChains.cpp -+++ b/lib/Driver/ToolChains.cpp -@@ -400,17 +400,22 @@ void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args, - /*AddRPath*/ true); - } - -+ToolChain::RuntimeLibType DarwinClang::GetRuntimeLibType( -+ const ArgList &Args) const { -+ if (Arg* A = Args.getLastArg(options::OPT_rtlib_EQ)) { -+ StringRef Value = A->getValue(); -+ if (Value != "compiler-rt") -+ getDriver().Diag(diag::err_drv_unsupported_rtlib_for_platform) -+ << Value << "darwin"; -+ } -+ -+ return ToolChain::RLT_CompilerRT; -+} -+ - void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, - ArgStringList &CmdArgs) const { -- // Darwin only supports the compiler-rt based runtime libraries. -- switch (GetRuntimeLibType(Args)) { -- case ToolChain::RLT_CompilerRT: -- break; -- default: -- getDriver().Diag(diag::err_drv_unsupported_rtlib_for_platform) -- << Args.getLastArg(options::OPT_rtlib_EQ)->getValue() << "darwin"; -- return; -- } -+ // Call once to ensure diagnostic is printed if wrong value was specified -+ GetRuntimeLibType(Args); - - // Darwin doesn't support real static executables, don't link any runtime - // libraries with -static. -diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h -index 369712f..fe570fd 100644 ---- a/lib/Driver/ToolChains.h -+++ b/lib/Driver/ToolChains.h -@@ -573,6 +573,8 @@ public: - /// @name Apple ToolChain Implementation - /// { - -+ RuntimeLibType GetRuntimeLibType(const llvm::opt::ArgList &Args) const override; -+ - void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args, - llvm::opt::ArgStringList &CmdArgs) const override; - -diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c -index f9f4b48..87bd55f 100644 ---- a/test/Driver/linux-ld.c -+++ b/test/Driver/linux-ld.c -@@ -16,7 +16,7 @@ - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-unknown-linux \ -+// RUN: --target=x86_64-unknown-linux -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ - // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s -@@ -36,7 +36,7 @@ - // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-unknown-linux-gnux32 \ -+// RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ - // RUN: | FileCheck --check-prefix=CHECK-LD-X32 %s -@@ -86,7 +86,7 @@ - // CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-unknown-linux \ -+// RUN: --target=x86_64-unknown-linux -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ - // RUN: --rtlib=libgcc \ -@@ -107,7 +107,7 @@ - // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-unknown-linux \ -+// RUN: --target=x86_64-unknown-linux -rtlib=platform \ - // RUN: -static-libgcc \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ -@@ -128,7 +128,7 @@ - // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-unknown-linux \ -+// RUN: --target=x86_64-unknown-linux -rtlib=platform \ - // RUN: -static \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ -@@ -149,7 +149,7 @@ - // - // Check that flags can be combined. The -static dominates. - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-unknown-linux \ -+// RUN: --target=x86_64-unknown-linux -rtlib=platform \ - // RUN: -static-libgcc -static \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ -@@ -1004,42 +1004,42 @@ - // - // Test linker invocation on Android. - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm-linux-androideabi \ -+// RUN: --target=arm-linux-androideabi -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm-linux-android \ -+// RUN: --target=arm-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=aarch64-linux-android \ -+// RUN: --target=aarch64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm64-linux-android \ -+// RUN: --target=arm64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mipsel-linux-android \ -+// RUN: --target=mipsel-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mips64el-linux-android \ -+// RUN: --target=mips64el-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=i686-linux-android \ -+// RUN: --target=i686-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-linux-android \ -+// RUN: --target=x86_64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s -@@ -1052,48 +1052,48 @@ - // CHECK-ANDROID-NOT: "gcc_s" - // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o" - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm-linux-androideabi \ -+// RUN: --target=arm-linux-androideabi -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -shared \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm-linux-android \ -+// RUN: --target=arm-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -shared \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=aarch64-linux-android \ -+// RUN: --target=aarch64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -shared \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm64-linux-android \ -+// RUN: --target=arm64-linux-android -rtlib=platform \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -shared \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mipsel-linux-android \ -+// RUN: --target=mipsel-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -shared \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mips64el-linux-android \ -+// RUN: --target=mips64el-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -shared \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=i686-linux-android \ -+// RUN: --target=i686-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -shared \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-linux-android \ -+// RUN: --target=x86_64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -shared \ -@@ -1108,47 +1108,47 @@ - // CHECK-ANDROID-SO-NOT: "gcc_s" - // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o" - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm-linux-androideabi \ -+// RUN: --target=arm-linux-androideabi -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -static \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm-linux-android \ -+// RUN: --target=arm-linux-android -rtlib=platform \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -static \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=aarch64-linux-android \ -+// RUN: --target=aarch64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -static \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm64-linux-android \ -+// RUN: --target=arm64-linux-android -rtlib=platform \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -static \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mipsel-linux-android \ -+// RUN: --target=mipsel-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -static \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mips64el-linux-android \ -+// RUN: --target=mips64el-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -static \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=i686-linux-android \ -+// RUN: --target=i686-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -static \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-linux-android \ -+// RUN: --target=x86_64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -static \ -@@ -1162,49 +1162,49 @@ - // CHECK-ANDROID-STATIC-NOT: "gcc_s" - // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o" - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm-linux-androideabi \ -+// RUN: --target=arm-linux-androideabi -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -pie \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm-linux-android \ -+// RUN: --target=arm-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -pie \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=aarch64-linux-android \ -+// RUN: --target=aarch64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -pie \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=arm64-linux-android \ -+// RUN: --target=arm64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -pie \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mipsel-linux-android \ -+// RUN: --target=mipsel-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -pie \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mips64el-linux-android \ -+// RUN: --target=mips64el-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -pie \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=i686-linux-android \ -+// RUN: --target=i686-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -pie \ - // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=x86_64-linux-android \ -+// RUN: --target=x86_64-linux-android -rtlib=platform \ - // RUN: --gcc-toolchain="" \ - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ - // RUN: -pie \ -diff --git a/test/Driver/miamcu-opt.c b/test/Driver/miamcu-opt.c -index 7f96998..577bd37 100644 ---- a/test/Driver/miamcu-opt.c -+++ b/test/Driver/miamcu-opt.c -@@ -1,13 +1,13 @@ - // REQUIRES: clang-driver - // REQUIRES: x86-registered-target - // --// RUN: %clang -miamcu -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s --// RUN: %clang -miamcu -no-canonical-prefixes -m32 %s -### -o %t.o 2>&1 | FileCheck %s --// RUN: %clang -miamcu -no-canonical-prefixes -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s --// RUN: %clang -mno-iamcu -miamcu -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s --// RUN: %clang -miamcu -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=M64 --// RUN: %clang -miamcu -no-canonical-prefixes -dynamic %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=DYNAMIC --// RUN: %clang -miamcu -no-canonical-prefixes -target armv8-eabi %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=NOT-X86 -+// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s -+// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -m32 %s -### -o %t.o 2>&1 | FileCheck %s -+// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s -+// RUN: %clang -mno-iamcu -miamcu -rtlib=platform -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s -+// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=M64 -+// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -dynamic %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=DYNAMIC -+// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -target armv8-eabi %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=NOT-X86 - // RUN: %clang -miamcu -mno-iamcu -no-canonical-prefixes -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=MNOIAMCU - - // M64: error: invalid argument '-miamcu' not allowed with '-m64' -diff --git a/test/Driver/miamcu-opt.cpp b/test/Driver/miamcu-opt.cpp -index 6c8d755..b63c455 100644 ---- a/test/Driver/miamcu-opt.cpp -+++ b/test/Driver/miamcu-opt.cpp -@@ -1,3 +1,3 @@ --// RUN: %clang -miamcu %s -### -o %t.o 2>&1 | FileCheck %s -+// RUN: %clang -miamcu -rtlib=platform %s -### -o %t.o 2>&1 | FileCheck %s - - // CHECK: error: the clang compiler does not support 'C++ for IAMCU' -diff --git a/test/Driver/mingw-libgcc.c b/test/Driver/mingw-libgcc.c -index 75a5696..1d45c91 100644 ---- a/test/Driver/mingw-libgcc.c -+++ b/test/Driver/mingw-libgcc.c -@@ -2,24 +2,24 @@ - // Verified with gcc version 5.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project). - - // gcc, static --// RUN: %clang -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s --// RUN: %clang -static -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s --// RUN: %clang -static-libgcc -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s --// RUN: %clang -static -shared -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s --// RUN: %clang -static-libgcc -shared -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s -+// RUN: %clang -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s -+// RUN: %clang -static -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s -+// RUN: %clang -static-libgcc -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s -+// RUN: %clang -static -shared -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s -+// RUN: %clang -static-libgcc -shared -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s - - // gcc, dynamic --// RUN: %clang -shared -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s -+// RUN: %clang -shared -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s - - // g++, static --// RUN: %clang -static --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s --// RUN: %clang -static-libgcc --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s --// RUN: %clang -static -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s --// RUN: %clang -static-libgcc -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s -+// RUN: %clang -static --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s -+// RUN: %clang -static-libgcc --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s -+// RUN: %clang -static -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s -+// RUN: %clang -static-libgcc -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s - - // g++, dynamic --// RUN: %clang --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s --// RUN: %clang -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s -+// RUN: %clang --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s -+// RUN: %clang -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s - - // CHECK_STATIC: "-lgcc" "-lgcc_eh" - // CHECK_DYNAMIC: "-lgcc_s" "-lgcc" -diff --git a/test/Driver/mingw.cpp b/test/Driver/mingw.cpp -index 8dc5b96..c939c7a 100644 ---- a/test/Driver/mingw.cpp -+++ b/test/Driver/mingw.cpp -@@ -1,9 +1,9 @@ --// RUN: %clang -target i686-windows-gnu -c -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_CLANG_TREE %s -+// RUN: %clang -target i686-windows-gnu -rtlib=platform -c -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_CLANG_TREE %s - // CHECK_MINGW_CLANG_TREE: "{{.*}}/Inputs/mingw_clang_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include" - // CHECK_MINGW_CLANG_TREE: "{{.*}}/Inputs/mingw_clang_tree/mingw32{{/|\\\\}}include" - - --// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_org_tree/mingw %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ORG_TREE %s -+// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_org_tree/mingw %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ORG_TREE %s - // CHECK_MINGW_ORG_TREE: "{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}mingw32{{/|\\\\}}4.8.1{{/|\\\\}}include{{/|\\\\}}c++" - // CHECK_MINGW_ORG_TREE: "{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}mingw32{{/|\\\\}}4.8.1{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}mingw32" - // CHECK_MINGW_ORG_TREE: "{{.*}}{{/|\\\\}}Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}mingw32{{/|\\\\}}4.8.1{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" -@@ -13,7 +13,7 @@ - // CHECK_MINGW_ORG_TREE: {{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}include - - --// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_builds_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_BUILDS_TREE %s -+// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_builds_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_BUILDS_TREE %s - // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++" - // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}i686-w64-mingw32" - // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" -@@ -22,7 +22,7 @@ - // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include" - - --// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_msys2_tree/msys64/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_MSYS_TREE %s -+// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_msys2_tree/msys64/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_MSYS_TREE %s - // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64{{/|\\\\}}mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.9.2" - // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64/mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.9.2{{/|\\\\}}i686-w64-mingw32" - // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64/mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.9.2{{/|\\\\}}backward" -@@ -32,7 +32,7 @@ - // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64/mingw32{{/|\\\\}}include" - - --// RUN: %clang -target x86_64-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_opensuse_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_OPENSUSE_TREE %s -+// RUN: %clang -target x86_64-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_opensuse_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_OPENSUSE_TREE %s - // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include{{/|\\\\}}c++" - // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}x86_64-w64-mingw32" - // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" -@@ -41,7 +41,7 @@ - // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include-fixed" - - --// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_arch_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ARCH_TREE %s -+// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_arch_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ARCH_TREE %s - // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0" - // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0{{/|\\\\}}i686-w64-mingw32" - // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0{{/|\\\\}}backward" -@@ -50,7 +50,7 @@ - // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include" - - --// RUN: %clang -target x86_64-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_ubuntu_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_UBUNTU_TREE %s -+// RUN: %clang -target x86_64-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_ubuntu_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_UBUNTU_TREE %s - // CHECK_MINGW_UBUNTU_TREE: "{{.*}}/Inputs/mingw_ubuntu_tree/usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.8" - // CHECK_MINGW_UBUNTU_TREE: "{{.*}}/Inputs/mingw_ubuntu_tree/usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.8{{/|\\\\}}x86_64-w64-mingw32" - // CHECK_MINGW_UBUNTU_TREE: "{{.*}}/Inputs/mingw_ubuntu_tree/usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.8{{/|\\\\}}backward" -diff --git a/test/Driver/mips-mti-linux.c b/test/Driver/mips-mti-linux.c -index e3560e2..4835d79 100644 ---- a/test/Driver/mips-mti-linux.c -+++ b/test/Driver/mips-mti-linux.c -@@ -8,7 +8,7 @@ - - // = Big-endian, mips32r2, hard float - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mips-mti-linux -mips32r2 -mhard-float \ -+// RUN: --target=mips-mti-linux -mips32r2 -mhard-float -rtlib=platform \ - // RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s - // -@@ -26,7 +26,7 @@ - - // = Little-endian, mips32r2, hard float - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float \ -+// RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float -rtlib=platform \ - // RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \ - // RUN: | FileCheck --check-prefix=CHECK-LE-HF-32R2 %s - // -diff --git a/test/Driver/sanitizer-ld.c b/test/Driver/sanitizer-ld.c -index 4d4ea29..9f6fae3 100644 ---- a/test/Driver/sanitizer-ld.c -+++ b/test/Driver/sanitizer-ld.c -@@ -343,7 +343,7 @@ - - // CFI by itself does not link runtime libraries. - // RUN: %clang -fsanitize=cfi %s -### -o %t.o 2>&1 \ --// RUN: -target x86_64-unknown-linux \ -+// RUN: -target x86_64-unknown-linux -rtlib=platform \ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ - // RUN: | FileCheck --check-prefix=CHECK-CFI-LINUX %s - // CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}" -diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c -index 3812287..84ef2df 100644 ---- a/test/Driver/windows-cross.c -+++ b/test/Driver/windows-cross.c -@@ -1,4 +1,4 @@ --// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -stdlib=libstdc++ -o /dev/null %s 2>&1 \ -+// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -stdlib=libstdc++ -rtlib=platform -o /dev/null %s 2>&1 \ - // RUN: | FileCheck %s --check-prefix CHECK-BASIC - - // CHECK-BASIC: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definition" "-o" "{{[^"]*}}" "{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/crtbegin.obj" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/gcc" "{{.*}}.o" "-lmsvcrt" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" -diff --git a/test/OpenMP/linking.c b/test/OpenMP/linking.c -index 81706d4..7b30592 100644 ---- a/test/OpenMP/linking.c -+++ b/test/OpenMP/linking.c -@@ -4,42 +4,42 @@ - // FIXME: Replace DEFAULT_OPENMP_LIB below with the value chosen at configure time. - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: -fopenmp -target i386-unknown-linux \ -+// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s - // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" - // CHECK-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" - // CHECK-LD-32: "-lpthread" "-lc" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: -fopenmp -target x86_64-unknown-linux \ -+// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s - // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" - // CHECK-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" - // CHECK-LD-64: "-lpthread" "-lc" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: -fopenmp=libgomp -target i386-unknown-linux \ -+// RUN: -fopenmp=libgomp -target i386-unknown-linux -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-32 %s - // CHECK-GOMP-LD-32: "{{.*}}ld{{(.exe)?}}" - // CHECK-GOMP-LD-32: "-lgomp" "-lrt" "-lgcc" - // CHECK-GOMP-LD-32: "-lpthread" "-lc" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: -fopenmp=libgomp -target x86_64-unknown-linux \ -+// RUN: -fopenmp=libgomp -target x86_64-unknown-linux -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-64 %s - // CHECK-GOMP-LD-64: "{{.*}}ld{{(.exe)?}}" - // CHECK-GOMP-LD-64: "-lgomp" "-lrt" "-lgcc" - // CHECK-GOMP-LD-64: "-lpthread" "-lc" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: -fopenmp -target i386-unknown-linux \ -+// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s - // CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}" - // CHECK-IOMP5-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" - // CHECK-IOMP5-LD-32: "-lpthread" "-lc" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: -fopenmp -target x86_64-unknown-linux \ -+// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s - // CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}" - // CHECK-IOMP5-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" -@@ -57,6 +57,7 @@ - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ - // RUN: -fopenmp -fopenmp=libgomp -target i386-unknown-linux \ -+// RUN: -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-32 %s - // CHECK-LD-OVERRIDE-32: "{{.*}}ld{{(.exe)?}}" - // CHECK-LD-OVERRIDE-32: "-lgomp" "-lrt" "-lgcc" -@@ -64,13 +65,14 @@ - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ - // RUN: -fopenmp -fopenmp=libgomp -target x86_64-unknown-linux \ -+// RUN: -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-64 %s - // CHECK-LD-OVERRIDE-64: "{{.*}}ld{{(.exe)?}}" - // CHECK-LD-OVERRIDE-64: "-lgomp" "-lrt" "-lgcc" - // CHECK-LD-OVERRIDE-64: "-lpthread" "-lc" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: -fopenmp=libomp -target x86_64-msvc-win32 \ -+// RUN: -fopenmp=libomp -target x86_64-msvc-win32 -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-MSVC-LINK-64 %s - // CHECK-MSVC-LINK-64: link.exe - // CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcomp.lib -@@ -79,7 +81,7 @@ - // CHECK-MSVC-LINK-64-SAME: -defaultlib:libomp.lib - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ --// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 \ -+// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 -rtlib=platform \ - // RUN: | FileCheck --check-prefix=CHECK-MSVC-ILINK-64 %s - // CHECK-MSVC-ILINK-64: link.exe - // CHECK-MSVC-ILINK-64-SAME: -nodefaultlib:vcomp.lib --- -2.9.3 - diff --git a/sys-devel/llvm/files/3.9.0/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch b/sys-devel/llvm/files/3.9.0/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch deleted file mode 100644 index 269a9a17ad1..00000000000 --- a/sys-devel/llvm/files/3.9.0/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8bd62a681744d3c31a0837c0f84f99ea4987e017 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= -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/cmake/base-config-ix.cmake -+++ b/projects/compiler-rt/cmake/base-config-ix.cmake -@@ -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 - diff --git a/sys-devel/llvm/files/3.9.0/lldb/six.patch b/sys-devel/llvm/files/3.9.0/lldb/six.patch deleted file mode 100644 index 324f2b8935b..00000000000 --- a/sys-devel/llvm/files/3.9.0/lldb/six.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Naur llvm-3.8.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py llvm-3.8.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py ---- llvm-3.8.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2015-12-11 16:43:36.000000000 +0100 -+++ llvm-3.8.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2016-03-09 14:12:15.614483414 +0100 -@@ -720,9 +720,6 @@ - bOk, strMsg = create_symlinks(vDictArgs, strFrameworkPythonDir) - - if bOk: -- bOk, strMsg = copy_six(vDictArgs, strFrameworkPythonDir) -- -- if bOk: - bOk, strMsg = copy_lldbpy_file_to_lldb_pkg_dir(vDictArgs, - strFrameworkPythonDir, - strCfgBldDir) diff --git a/sys-devel/llvm/files/3.9.0/llvm-config-r1.patch b/sys-devel/llvm/files/3.9.0/llvm-config-r1.patch deleted file mode 100644 index 38505f15b09..00000000000 --- a/sys-devel/llvm/files/3.9.0/llvm-config-r1.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 7422ff662be0daeb3931fde397f1fed8ff86c50d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= -Date: Sat, 20 Aug 2016 23:47:41 +0200 -Subject: [PATCH] llvm-config: Clean up exported values, update for shared - linking - -Gentoo-specific fixup for llvm-config, including: -- wiping build-specific CFLAGS, CXXFLAGS, -- updating library suffixes for shared libs, -- wiping --system-libs for shared linking, -- making --src-root return invalid path (/dev/null), -- making --build-mode return "Release" rather than "Gentoo". - -Thanks to Steven Newbury for the initial patch. - -Bug: https://bugs.gentoo.org/565358 -Bug: https://bugs.gentoo.org/501684 ---- - tools/llvm-config/CMakeLists.txt | 11 ++++++++--- - tools/llvm-config/llvm-config.cpp | 9 +++++++-- - 2 files changed, 15 insertions(+), 5 deletions(-) - -diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt -index 83794bb..eba6f45 100644 ---- a/tools/llvm-config/CMakeLists.txt -+++ b/tools/llvm-config/CMakeLists.txt -@@ -23,6 +23,10 @@ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR}) - set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR}) - set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") --set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") --set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}") -+# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler -+# specific flags will be set when we don't know what compiler will be used -+# with external project utilising llvm-config. C++ Standard is required. -+# TODO: figure out if we can remove -std=c++11 and move it to revdeps. -+set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") -+set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") - set(LLVM_BUILD_SYSTEM cmake) - set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI}) -@@ -31,5 +35,6 @@ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI}) - set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}") - set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE}) --set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS}) -+# We don't do static libs, so we don't need to supply any system-libs -+set(LLVM_SYSTEM_LIBS "") - if(BUILD_SHARED_LIBS) - set(LLVM_ENABLE_SHARED ON) -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp -index 80f6279..309c5dc 100644 ---- a/tools/llvm-config/llvm-config.cpp -+++ b/tools/llvm-config/llvm-config.cpp -@@ -485,5 +485,6 @@ int main(int argc, char **argv) { - OS << Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE) << '\n'; - } else if (Arg == "--build-mode") { -- OS << build_mode << '\n'; -+ // force Release since we force non-standard Gentoo build mode -+ OS << "Release" << '\n'; - } else if (Arg == "--assertion-mode") { - #if defined(NDEBUG) -@@ -501,5 +502,9 @@ int main(int argc, char **argv) { - OS << ActivePrefix << '\n'; - } else if (Arg == "--src-root") { -- OS << LLVM_SRC_ROOT << '\n'; -+ if (IsInDevelopmentTree) { -+ OS << LLVM_SRC_ROOT << '\n'; -+ } else { -+ OS << "/dev/null\n"; -+ } - } else { - usage(); --- -2.9.3 - diff --git a/sys-devel/llvm/files/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch b/sys-devel/llvm/files/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch new file mode 100644 index 00000000000..367a8a7794f --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch @@ -0,0 +1,71 @@ +From 2907883b3c504a08b98cf735ceaa8e438d20f37e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sun, 21 Aug 2016 22:46:48 +0200 +Subject: [PATCH 01/10] cmake: Install OCaml modules into correct package + location + +Ensure that correct libdir is used for OCaml modules, and install them +into dedicated llvm subdirectory rather than the top directory which is +supposedly reserved for the standard library. + +Author: Mark Wright +Bug: https://bugs.gentoo.org/559134 +Bug: https://bugs.gentoo.org/559624 +--- + bindings/ocaml/backends/CMakeLists.txt | 2 +- + bindings/ocaml/llvm/CMakeLists.txt | 2 +- + cmake/modules/AddOCaml.cmake | 6 +++--- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/bindings/ocaml/backends/CMakeLists.txt b/bindings/ocaml/backends/CMakeLists.txt +index a980638..9e5dc50 100644 +--- a/bindings/ocaml/backends/CMakeLists.txt ++++ b/bindings/ocaml/backends/CMakeLists.txt +@@ -23,5 +23,5 @@ foreach(TARGET ${LLVM_TARGETS_TO_BUILD}) + "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}") + + install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}" +- DESTINATION lib/ocaml) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm) + endforeach() +diff --git a/bindings/ocaml/llvm/CMakeLists.txt b/bindings/ocaml/llvm/CMakeLists.txt +index 4956fa4..c612f73 100644 +--- a/bindings/ocaml/llvm/CMakeLists.txt ++++ b/bindings/ocaml/llvm/CMakeLists.txt +@@ -8,4 +8,4 @@ configure_file( + "${LLVM_LIBRARY_DIR}/ocaml/META.llvm") + + install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm" +- DESTINATION lib/ocaml) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm) +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index e3dd1d8..a16238e 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -137,7 +137,7 @@ function(add_ocaml_library name) + if( APPLE ) + set(ocaml_rpath "@executable_path/../../lib") + elseif( UNIX ) +- set(ocaml_rpath "\\$ORIGIN/../../lib") ++ set(ocaml_rpath "\\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}") + endif() + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") + +@@ -189,12 +189,12 @@ function(add_ocaml_library name) + endforeach() + + install(FILES ${install_files} +- DESTINATION lib/ocaml) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm) + install(FILES ${install_shlibs} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE +- DESTINATION lib/ocaml) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm) + + foreach( install_file ${install_files} ${install_shlibs} ) + get_filename_component(filename "${install_file}" NAME) +-- +2.9.3 + diff --git a/sys-devel/llvm/files/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch b/sys-devel/llvm/files/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch new file mode 100644 index 00000000000..b90527a0e44 --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch @@ -0,0 +1,28 @@ +From 726806d9b4932287d67f9b6b112099648ea008b4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sun, 21 Aug 2016 23:01:47 +0200 +Subject: [PATCH 02/10] cmake: Make OCaml docs dependent on LLVM_BUILD_DOCS + +Author: Bernard Cafarelli +Bug: https://bugs.gentoo.org/562008 +Patch: https://reviews.llvm.org/D23763 +--- + docs/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt +index eaa1750..f2cd7e9 100644 +--- a/docs/CMakeLists.txt ++++ b/docs/CMakeLists.txt +@@ -115,7 +115,7 @@ if (LLVM_ENABLE_SPHINX) + endif() + + list(FIND LLVM_BINDINGS_LIST ocaml uses_ocaml) +-if( NOT uses_ocaml LESS 0 ) ++if( NOT uses_ocaml LESS 0 AND LLVM_BUILD_DOCS ) + set(doc_targets + ocaml_llvm + ocaml_llvm_all_backends +-- +2.9.3 + diff --git a/sys-devel/llvm/files/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch b/sys-devel/llvm/files/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch new file mode 100644 index 00000000000..76adf52fb94 --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch @@ -0,0 +1,37 @@ +From 1251ac2021b768d3a56b4dc03212ea2fd12a34dd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Mon, 8 Jun 2015 06:43:00 +0200 +Subject: [PATCH 03/10] 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. + +Bug: https://llvm.org/bugs/show_bug.cgi?id=23780 +Patch: https://reviews.llvm.org/D23757 +--- + 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..fac143f 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.9.3 + diff --git a/sys-devel/llvm/files/3.9.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch b/sys-devel/llvm/files/3.9.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch new file mode 100644 index 00000000000..94a81574d6e --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch @@ -0,0 +1,33 @@ +From 2f798e87c10a93235a00e95c38e736f9ff7e991b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Mon, 8 Jun 2015 14:29:03 +0200 +Subject: [PATCH 04/10] 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. + +Bug: https://llvm.org/bugs/show_bug.cgi?id=23781 +Patch: https://reviews.llvm.org/D23755 +--- + docs/CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt +index f2cd7e9..179a65b 100644 +--- a/docs/CMakeLists.txt ++++ b/docs/CMakeLists.txt +@@ -109,6 +109,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.9.3 + diff --git a/sys-devel/llvm/files/3.9.1/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch b/sys-devel/llvm/files/3.9.1/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch new file mode 100644 index 00000000000..6634cdebe35 --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch @@ -0,0 +1,62 @@ +From aeddc35a35c55f487977d7609060225e03e2028b Mon Sep 17 00:00:00 2001 +From: Michal Gorny +Date: Tue, 4 Oct 2016 06:09:18 +0000 +Subject: [PATCH] [cmake] Reintroduce (ldconfig-compatible) SOVERSIONs on + shared libraries + +Reintroduce versioning of shared libraries via SOVERSION, addressing +the issues with the previous design, since Gentoo is relying +on shared-split install of LLVM. The SOVERSIONs were originally +introduced in r229720 for all libraries, and removed in r252093 in favor +of custom SONAME. As far as I understand, the major concern with the old +versioning was that the used versions were incompatible with ldconfig. + +Having considered that, this commit introduce SOVERSIONS with the +following considerations: + +1. SOVERSIONs are formed of major & minor version concatenated -- i.e. +for 4.0 its .so.40. This matches the common practice where the first +version number indicates ABI breakage, and therefore fixes the issues +with ldconfig. Additionally, VERSION with the remaining verion +components appended is used, however this is not strictly necessary. + +2. The versioning is only applied to libraries with no explicit SONAME +specified -- i.e. it won't apply to libLLVM but only to the split +libraries. It will also apply to libraries installed by the subprojects. + +3. The versioning is only done on *nix systems, Darwin excluded. This +matches the current use of SONAME. + +Differential Revision: https://reviews.llvm.org/D24757 + +git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283189 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + cmake/modules/AddLLVM.cmake | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index 37b3b80..7cb1b0c 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -450,6 +450,18 @@ function(llvm_add_library name) + PREFIX "" + ) + endif() ++ ++ # Set SOVERSION on shared libraries that lack explicit SONAME ++ # specifier, on *nix systems that are not Darwin. ++ if(UNIX AND NOT APPLE AND NOT ARG_SONAME) ++ set_target_properties(${name} ++ PROPERTIES ++ # Concatenate the version numbers since ldconfig expects exactly ++ # one component indicating the ABI version, while LLVM uses ++ # major+minor for that. ++ SOVERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR} ++ VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}) ++ endif() + endif() + + if(ARG_MODULE OR ARG_SHARED) +-- +2.10.0 + diff --git a/sys-devel/llvm/files/3.9.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch b/sys-devel/llvm/files/3.9.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch new file mode 100644 index 00000000000..931eb56e5a9 --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch @@ -0,0 +1,35 @@ +diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp +index fa7780f..e3a6c8f 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 f078b37..0c514fc 100644 +--- a/tools/clang/lib/Frontend/CompilerInvocation.cpp ++++ b/tools/clang/lib/Frontend/CompilerInvocation.cpp +@@ -1097,7 +1097,7 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0, + if (ClangResourceDir != "") + llvm::sys::path::append(P, ClangResourceDir); + else +- llvm::sys::path::append(P, "..", Twine("lib") + CLANG_LIBDIR_SUFFIX, ++ llvm::sys::path::append(P, "..", "lib", + "clang", CLANG_VERSION_STRING); + + return P.str(); +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index 7de5fbe..49f439b 100644 +--- a/tools/clang/lib/Headers/CMakeLists.txt ++++ b/tools/clang/lib/Headers/CMakeLists.txt +@@ -100,4 +100,4 @@ set_target_properties(clang-headers PROPERTIES FOLDER "Misc") + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++ DESTINATION lib/clang/${CLANG_VERSION}/include) diff --git a/sys-devel/llvm/files/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch b/sys-devel/llvm/files/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch new file mode 100644 index 00000000000..0b93deba0b5 --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/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?= +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/3.9.1/clang/darwin_prefix-include-paths.patch b/sys-devel/llvm/files/3.9.1/clang/darwin_prefix-include-paths.patch new file mode 100644 index 00000000000..ed332f3f68a --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/clang/darwin_prefix-include-paths.patch @@ -0,0 +1,18 @@ +--- a/tools/clang/lib/Frontend/InitHeaderSearch.cpp ++++ b/tools/clang/lib/Frontend/InitHeaderSearch.cpp +@@ -233,6 +233,7 @@ + case llvm::Triple::Bitrig: + break; + default: ++ AddPath("@GENTOO_PORTAGE_EPREFIX@/usr/include", System, false); + // FIXME: temporary hack: hard-coded paths. + AddPath("/usr/local/include", System, false); + break; +@@ -505,6 +506,7 @@ + // Add the default framework include paths on Darwin. + if (HSOpts.UseStandardSystemIncludes) { + if (triple.isOSDarwin()) { ++ AddPath("@GENTOO_PORTAGE_EPREFIX@/Frameworks", System, true); + AddPath("/System/Library/Frameworks", System, true); + AddPath("/Library/Frameworks", System, true); + } diff --git a/sys-devel/llvm/files/3.9.1/clang/default-libs.patch b/sys-devel/llvm/files/3.9.1/clang/default-libs.patch new file mode 100644 index 00000000000..12ef52d5b68 --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/clang/default-libs.patch @@ -0,0 +1,703 @@ +From 2d354bfbb2f5efdf3f6b2405078f9ccb65c21536 Mon Sep 17 00:00:00 2001 +From: Jonas Hahnfeld +Date: Wed, 27 Jul 2016 08:15:54 +0000 +Subject: [PATCH] Support setting default value for -rtlib at build time + +This patch introduces a new cmake variable: CLANG_DEFAULT_RTLIB, thru +which we can specify a default value for -rtlib (libgcc or +compiler-rt) at build time, just like how we set the default C++ +stdlib thru CLANG_DEFAULT_CXX_STDLIB. + +With these two options, we can configure clang to build binaries on +Linux that have no runtime dependence on any gcc libs (libstdc++ or +libgcc_s). + +Patch by Lei Zhang! + +Differential Revision: https://reviews.llvm.org/D22663 + +git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276848 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + CMakeLists.txt | 10 +++++ + include/clang/Config/config.h.cmake | 3 ++ + lib/Driver/ToolChain.cpp | 22 ++++++----- + lib/Driver/ToolChains.cpp | 23 ++++++----- + lib/Driver/ToolChains.h | 2 + + test/Driver/linux-ld.c | 76 ++++++++++++++++++------------------- + test/Driver/miamcu-opt.c | 14 +++---- + test/Driver/miamcu-opt.cpp | 2 +- + test/Driver/mingw-libgcc.c | 24 ++++++------ + test/Driver/mingw.cpp | 14 +++---- + test/Driver/mips-mti-linux.c | 4 +- + test/Driver/sanitizer-ld.c | 2 +- + test/Driver/windows-cross.c | 2 +- + test/OpenMP/linking.c | 18 +++++---- + 14 files changed, 121 insertions(+), 95 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cfcd221..aec4579 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -201,6 +201,16 @@ if (NOT(CLANG_DEFAULT_CXX_STDLIB STREQUAL "" OR + set(CLANG_DEFAULT_CXX_STDLIB "") + endif() + ++set(CLANG_DEFAULT_RTLIB "" CACHE STRING ++ "Default runtime library to use (\"libgcc\" or \"compiler-rt\", empty for platform default)") ++if (NOT(CLANG_DEFAULT_RTLIB STREQUAL "" OR ++ CLANG_DEFAULT_RTLIB STREQUAL "libgcc" OR ++ CLANG_DEFAULT_RTLIB STREQUAL "compiler-rt")) ++ message(WARNING "Resetting default rtlib to use platform default") ++ set(CLANG_DEFAULT_RTLIB "" CACHE STRING ++ "Default runtime library to use (\"libgcc\" or \"compiler-rt\", empty for platform default)" FORCE) ++endif() ++ + set(CLANG_DEFAULT_OPENMP_RUNTIME "libomp" CACHE STRING + "Default OpenMP runtime used by -fopenmp.") + +diff --git a/include/clang/Config/config.h.cmake b/include/clang/Config/config.h.cmake +index e5a1d0d..9200ed9 100644 +--- a/include/clang/Config/config.h.cmake ++++ b/include/clang/Config/config.h.cmake +@@ -11,6 +11,9 @@ + /* Default C++ stdlib to use. */ + #define CLANG_DEFAULT_CXX_STDLIB "${CLANG_DEFAULT_CXX_STDLIB}" + ++/* Default runtime library to use. */ ++#define CLANG_DEFAULT_RTLIB "${CLANG_DEFAULT_RTLIB}" ++ + /* Default OpenMP runtime used by -fopenmp. */ + #define CLANG_DEFAULT_OPENMP_RUNTIME "${CLANG_DEFAULT_OPENMP_RUNTIME}" + +diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp +index e96688c..b825d63 100644 +--- a/lib/Driver/ToolChain.cpp ++++ b/lib/Driver/ToolChain.cpp +@@ -526,15 +526,19 @@ void ToolChain::addProfileRTLibs(const llvm::opt::ArgList &Args, + + ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType( + const ArgList &Args) const { +- if (Arg *A = Args.getLastArg(options::OPT_rtlib_EQ)) { +- StringRef Value = A->getValue(); +- if (Value == "compiler-rt") +- return ToolChain::RLT_CompilerRT; +- if (Value == "libgcc") +- return ToolChain::RLT_Libgcc; +- getDriver().Diag(diag::err_drv_invalid_rtlib_name) +- << A->getAsString(Args); +- } ++ const Arg* A = Args.getLastArg(options::OPT_rtlib_EQ); ++ StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_RTLIB; ++ ++ // "platform" is only used in tests to override CLANG_DEFAULT_RTLIB ++ if (LibName == "compiler-rt") ++ return ToolChain::RLT_CompilerRT; ++ else if (LibName == "libgcc") ++ return ToolChain::RLT_Libgcc; ++ else if (LibName == "platform") ++ return GetDefaultRuntimeLibType(); ++ ++ if (A) ++ getDriver().Diag(diag::err_drv_invalid_rtlib_name) << A->getAsString(Args); + + return GetDefaultRuntimeLibType(); + } +diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp +index 347aa29..6027bbf 100644 +--- a/lib/Driver/ToolChains.cpp ++++ b/lib/Driver/ToolChains.cpp +@@ -400,17 +400,22 @@ void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args, + /*AddRPath*/ true); + } + ++ToolChain::RuntimeLibType DarwinClang::GetRuntimeLibType( ++ const ArgList &Args) const { ++ if (Arg* A = Args.getLastArg(options::OPT_rtlib_EQ)) { ++ StringRef Value = A->getValue(); ++ if (Value != "compiler-rt") ++ getDriver().Diag(diag::err_drv_unsupported_rtlib_for_platform) ++ << Value << "darwin"; ++ } ++ ++ return ToolChain::RLT_CompilerRT; ++} ++ + void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, + ArgStringList &CmdArgs) const { +- // Darwin only supports the compiler-rt based runtime libraries. +- switch (GetRuntimeLibType(Args)) { +- case ToolChain::RLT_CompilerRT: +- break; +- default: +- getDriver().Diag(diag::err_drv_unsupported_rtlib_for_platform) +- << Args.getLastArg(options::OPT_rtlib_EQ)->getValue() << "darwin"; +- return; +- } ++ // Call once to ensure diagnostic is printed if wrong value was specified ++ GetRuntimeLibType(Args); + + // Darwin doesn't support real static executables, don't link any runtime + // libraries with -static. +diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h +index 369712f..fe570fd 100644 +--- a/lib/Driver/ToolChains.h ++++ b/lib/Driver/ToolChains.h +@@ -573,6 +573,8 @@ public: + /// @name Apple ToolChain Implementation + /// { + ++ RuntimeLibType GetRuntimeLibType(const llvm::opt::ArgList &Args) const override; ++ + void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const override; + +diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c +index f9f4b48..87bd55f 100644 +--- a/test/Driver/linux-ld.c ++++ b/test/Driver/linux-ld.c +@@ -16,7 +16,7 @@ + // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ + // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s +@@ -36,7 +36,7 @@ + // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux-gnux32 \ ++// RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ + // RUN: | FileCheck --check-prefix=CHECK-LD-X32 %s +@@ -86,7 +86,7 @@ + // CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ + // RUN: --rtlib=libgcc \ +@@ -107,7 +107,7 @@ + // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: -static-libgcc \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ +@@ -128,7 +128,7 @@ + // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: -static \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ +@@ -149,7 +149,7 @@ + // + // Check that flags can be combined. The -static dominates. + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: -static-libgcc -static \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ +@@ -1004,42 +1004,42 @@ + // + // Test linker invocation on Android. + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-androideabi \ ++// RUN: --target=arm-linux-androideabi -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-android \ ++// RUN: --target=arm-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=aarch64-linux-android \ ++// RUN: --target=aarch64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm64-linux-android \ ++// RUN: --target=arm64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-android \ ++// RUN: --target=mipsel-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-android \ ++// RUN: --target=mips64el-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=i686-linux-android \ ++// RUN: --target=i686-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-linux-android \ ++// RUN: --target=x86_64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s +@@ -1052,48 +1052,48 @@ + // CHECK-ANDROID-NOT: "gcc_s" + // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o" + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-androideabi \ ++// RUN: --target=arm-linux-androideabi -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-android \ ++// RUN: --target=arm-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=aarch64-linux-android \ ++// RUN: --target=aarch64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm64-linux-android \ ++// RUN: --target=arm64-linux-android -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-android \ ++// RUN: --target=mipsel-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-android \ ++// RUN: --target=mips64el-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=i686-linux-android \ ++// RUN: --target=i686-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-linux-android \ ++// RUN: --target=x86_64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ +@@ -1108,47 +1108,47 @@ + // CHECK-ANDROID-SO-NOT: "gcc_s" + // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o" + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-androideabi \ ++// RUN: --target=arm-linux-androideabi -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-android \ ++// RUN: --target=arm-linux-android -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=aarch64-linux-android \ ++// RUN: --target=aarch64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm64-linux-android \ ++// RUN: --target=arm64-linux-android -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-android \ ++// RUN: --target=mipsel-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-android \ ++// RUN: --target=mips64el-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=i686-linux-android \ ++// RUN: --target=i686-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-linux-android \ ++// RUN: --target=x86_64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ +@@ -1162,49 +1162,49 @@ + // CHECK-ANDROID-STATIC-NOT: "gcc_s" + // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o" + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-androideabi \ ++// RUN: --target=arm-linux-androideabi -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-android \ ++// RUN: --target=arm-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=aarch64-linux-android \ ++// RUN: --target=aarch64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm64-linux-android \ ++// RUN: --target=arm64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-android \ ++// RUN: --target=mipsel-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-android \ ++// RUN: --target=mips64el-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=i686-linux-android \ ++// RUN: --target=i686-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-linux-android \ ++// RUN: --target=x86_64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ +diff --git a/test/Driver/miamcu-opt.c b/test/Driver/miamcu-opt.c +index 7f96998..577bd37 100644 +--- a/test/Driver/miamcu-opt.c ++++ b/test/Driver/miamcu-opt.c +@@ -1,13 +1,13 @@ + // REQUIRES: clang-driver + // REQUIRES: x86-registered-target + // +-// RUN: %clang -miamcu -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s +-// RUN: %clang -miamcu -no-canonical-prefixes -m32 %s -### -o %t.o 2>&1 | FileCheck %s +-// RUN: %clang -miamcu -no-canonical-prefixes -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s +-// RUN: %clang -mno-iamcu -miamcu -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s +-// RUN: %clang -miamcu -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=M64 +-// RUN: %clang -miamcu -no-canonical-prefixes -dynamic %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=DYNAMIC +-// RUN: %clang -miamcu -no-canonical-prefixes -target armv8-eabi %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=NOT-X86 ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -m32 %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -mno-iamcu -miamcu -rtlib=platform -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=M64 ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -dynamic %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=DYNAMIC ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -target armv8-eabi %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=NOT-X86 + // RUN: %clang -miamcu -mno-iamcu -no-canonical-prefixes -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=MNOIAMCU + + // M64: error: invalid argument '-miamcu' not allowed with '-m64' +diff --git a/test/Driver/miamcu-opt.cpp b/test/Driver/miamcu-opt.cpp +index 6c8d755..b63c455 100644 +--- a/test/Driver/miamcu-opt.cpp ++++ b/test/Driver/miamcu-opt.cpp +@@ -1,3 +1,3 @@ +-// RUN: %clang -miamcu %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -miamcu -rtlib=platform %s -### -o %t.o 2>&1 | FileCheck %s + + // CHECK: error: the clang compiler does not support 'C++ for IAMCU' +diff --git a/test/Driver/mingw-libgcc.c b/test/Driver/mingw-libgcc.c +index 75a5696..1d45c91 100644 +--- a/test/Driver/mingw-libgcc.c ++++ b/test/Driver/mingw-libgcc.c +@@ -2,24 +2,24 @@ + // Verified with gcc version 5.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project). + + // gcc, static +-// RUN: %clang -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static-libgcc -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static -shared -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static-libgcc -shared -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static-libgcc -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static -shared -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static-libgcc -shared -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s + + // gcc, dynamic +-// RUN: %clang -shared -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s ++// RUN: %clang -shared -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s + + // g++, static +-// RUN: %clang -static --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static-libgcc --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static-libgcc -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static-libgcc --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static-libgcc -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s + + // g++, dynamic +-// RUN: %clang --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s +-// RUN: %clang -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s ++// RUN: %clang --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s ++// RUN: %clang -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s + + // CHECK_STATIC: "-lgcc" "-lgcc_eh" + // CHECK_DYNAMIC: "-lgcc_s" "-lgcc" +diff --git a/test/Driver/mingw.cpp b/test/Driver/mingw.cpp +index 8dc5b96..c939c7a 100644 +--- a/test/Driver/mingw.cpp ++++ b/test/Driver/mingw.cpp +@@ -1,9 +1,9 @@ +-// RUN: %clang -target i686-windows-gnu -c -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_CLANG_TREE %s ++// RUN: %clang -target i686-windows-gnu -rtlib=platform -c -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_CLANG_TREE %s + // CHECK_MINGW_CLANG_TREE: "{{.*}}/Inputs/mingw_clang_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include" + // CHECK_MINGW_CLANG_TREE: "{{.*}}/Inputs/mingw_clang_tree/mingw32{{/|\\\\}}include" + + +-// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_org_tree/mingw %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ORG_TREE %s ++// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_org_tree/mingw %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ORG_TREE %s + // CHECK_MINGW_ORG_TREE: "{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}mingw32{{/|\\\\}}4.8.1{{/|\\\\}}include{{/|\\\\}}c++" + // CHECK_MINGW_ORG_TREE: "{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}mingw32{{/|\\\\}}4.8.1{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}mingw32" + // CHECK_MINGW_ORG_TREE: "{{.*}}{{/|\\\\}}Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}mingw32{{/|\\\\}}4.8.1{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" +@@ -13,7 +13,7 @@ + // CHECK_MINGW_ORG_TREE: {{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}include + + +-// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_builds_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_BUILDS_TREE %s ++// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_builds_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_BUILDS_TREE %s + // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++" + // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}i686-w64-mingw32" + // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" +@@ -22,7 +22,7 @@ + // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include" + + +-// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_msys2_tree/msys64/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_MSYS_TREE %s ++// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_msys2_tree/msys64/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_MSYS_TREE %s + // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64{{/|\\\\}}mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.9.2" + // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64/mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.9.2{{/|\\\\}}i686-w64-mingw32" + // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64/mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.9.2{{/|\\\\}}backward" +@@ -32,7 +32,7 @@ + // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64/mingw32{{/|\\\\}}include" + + +-// RUN: %clang -target x86_64-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_opensuse_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_OPENSUSE_TREE %s ++// RUN: %clang -target x86_64-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_opensuse_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_OPENSUSE_TREE %s + // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include{{/|\\\\}}c++" + // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}x86_64-w64-mingw32" + // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" +@@ -41,7 +41,7 @@ + // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include-fixed" + + +-// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_arch_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ARCH_TREE %s ++// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_arch_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ARCH_TREE %s + // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0" + // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0{{/|\\\\}}i686-w64-mingw32" + // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0{{/|\\\\}}backward" +@@ -50,7 +50,7 @@ + // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include" + + +-// RUN: %clang -target x86_64-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_ubuntu_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_UBUNTU_TREE %s ++// RUN: %clang -target x86_64-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_ubuntu_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_UBUNTU_TREE %s + // CHECK_MINGW_UBUNTU_TREE: "{{.*}}/Inputs/mingw_ubuntu_tree/usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.8" + // CHECK_MINGW_UBUNTU_TREE: "{{.*}}/Inputs/mingw_ubuntu_tree/usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.8{{/|\\\\}}x86_64-w64-mingw32" + // CHECK_MINGW_UBUNTU_TREE: "{{.*}}/Inputs/mingw_ubuntu_tree/usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.8{{/|\\\\}}backward" +diff --git a/test/Driver/mips-mti-linux.c b/test/Driver/mips-mti-linux.c +index e3560e2..4835d79 100644 +--- a/test/Driver/mips-mti-linux.c ++++ b/test/Driver/mips-mti-linux.c +@@ -8,7 +8,7 @@ + + // = Big-endian, mips32r2, hard float + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-mti-linux -mips32r2 -mhard-float \ ++// RUN: --target=mips-mti-linux -mips32r2 -mhard-float -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s + // +@@ -26,7 +26,7 @@ + + // = Little-endian, mips32r2, hard float + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float \ ++// RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-LE-HF-32R2 %s + // +diff --git a/test/Driver/sanitizer-ld.c b/test/Driver/sanitizer-ld.c +index 4d4ea29..9f6fae3 100644 +--- a/test/Driver/sanitizer-ld.c ++++ b/test/Driver/sanitizer-ld.c +@@ -343,7 +343,7 @@ + + // CFI by itself does not link runtime libraries. + // RUN: %clang -fsanitize=cfi %s -### -o %t.o 2>&1 \ +-// RUN: -target x86_64-unknown-linux \ ++// RUN: -target x86_64-unknown-linux -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ + // RUN: | FileCheck --check-prefix=CHECK-CFI-LINUX %s + // CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}" +diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c +index 3812287..84ef2df 100644 +--- a/test/Driver/windows-cross.c ++++ b/test/Driver/windows-cross.c +@@ -1,4 +1,4 @@ +-// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -stdlib=libstdc++ -o /dev/null %s 2>&1 \ ++// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -stdlib=libstdc++ -rtlib=platform -o /dev/null %s 2>&1 \ + // RUN: | FileCheck %s --check-prefix CHECK-BASIC + + // CHECK-BASIC: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definition" "-o" "{{[^"]*}}" "{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/crtbegin.obj" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/gcc" "{{.*}}.o" "-lmsvcrt" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +diff --git a/test/OpenMP/linking.c b/test/OpenMP/linking.c +index 81706d4..7b30592 100644 +--- a/test/OpenMP/linking.c ++++ b/test/OpenMP/linking.c +@@ -4,42 +4,42 @@ + // FIXME: Replace DEFAULT_OPENMP_LIB below with the value chosen at configure time. + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp -target i386-unknown-linux \ ++// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s + // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" + // CHECK-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" + // CHECK-LD-32: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp -target x86_64-unknown-linux \ ++// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s + // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" + // CHECK-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" + // CHECK-LD-64: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp=libgomp -target i386-unknown-linux \ ++// RUN: -fopenmp=libgomp -target i386-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-32 %s + // CHECK-GOMP-LD-32: "{{.*}}ld{{(.exe)?}}" + // CHECK-GOMP-LD-32: "-lgomp" "-lrt" "-lgcc" + // CHECK-GOMP-LD-32: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp=libgomp -target x86_64-unknown-linux \ ++// RUN: -fopenmp=libgomp -target x86_64-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-64 %s + // CHECK-GOMP-LD-64: "{{.*}}ld{{(.exe)?}}" + // CHECK-GOMP-LD-64: "-lgomp" "-lrt" "-lgcc" + // CHECK-GOMP-LD-64: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp -target i386-unknown-linux \ ++// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s + // CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}" + // CHECK-IOMP5-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" + // CHECK-IOMP5-LD-32: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp -target x86_64-unknown-linux \ ++// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s + // CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}" + // CHECK-IOMP5-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" +@@ -57,6 +57,7 @@ + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: -fopenmp -fopenmp=libgomp -target i386-unknown-linux \ ++// RUN: -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-32 %s + // CHECK-LD-OVERRIDE-32: "{{.*}}ld{{(.exe)?}}" + // CHECK-LD-OVERRIDE-32: "-lgomp" "-lrt" "-lgcc" +@@ -64,13 +65,14 @@ + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: -fopenmp -fopenmp=libgomp -target x86_64-unknown-linux \ ++// RUN: -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-64 %s + // CHECK-LD-OVERRIDE-64: "{{.*}}ld{{(.exe)?}}" + // CHECK-LD-OVERRIDE-64: "-lgomp" "-lrt" "-lgcc" + // CHECK-LD-OVERRIDE-64: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp=libomp -target x86_64-msvc-win32 \ ++// RUN: -fopenmp=libomp -target x86_64-msvc-win32 -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-MSVC-LINK-64 %s + // CHECK-MSVC-LINK-64: link.exe + // CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcomp.lib +@@ -79,7 +81,7 @@ + // CHECK-MSVC-LINK-64-SAME: -defaultlib:libomp.lib + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 \ ++// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-MSVC-ILINK-64 %s + // CHECK-MSVC-ILINK-64: link.exe + // CHECK-MSVC-ILINK-64-SAME: -nodefaultlib:vcomp.lib +-- +2.9.3 + diff --git a/sys-devel/llvm/files/3.9.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch b/sys-devel/llvm/files/3.9.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch new file mode 100644 index 00000000000..269a9a17ad1 --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/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?= +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/cmake/base-config-ix.cmake ++++ b/projects/compiler-rt/cmake/base-config-ix.cmake +@@ -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 + diff --git a/sys-devel/llvm/files/3.9.1/lldb/six.patch b/sys-devel/llvm/files/3.9.1/lldb/six.patch new file mode 100644 index 00000000000..324f2b8935b --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/lldb/six.patch @@ -0,0 +1,13 @@ +diff -Naur llvm-3.8.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py llvm-3.8.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py +--- llvm-3.8.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2015-12-11 16:43:36.000000000 +0100 ++++ llvm-3.8.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2016-03-09 14:12:15.614483414 +0100 +@@ -720,9 +720,6 @@ + bOk, strMsg = create_symlinks(vDictArgs, strFrameworkPythonDir) + + if bOk: +- bOk, strMsg = copy_six(vDictArgs, strFrameworkPythonDir) +- +- if bOk: + bOk, strMsg = copy_lldbpy_file_to_lldb_pkg_dir(vDictArgs, + strFrameworkPythonDir, + strCfgBldDir) diff --git a/sys-devel/llvm/files/3.9.1/llvm-config-r1.patch b/sys-devel/llvm/files/3.9.1/llvm-config-r1.patch new file mode 100644 index 00000000000..38505f15b09 --- /dev/null +++ b/sys-devel/llvm/files/3.9.1/llvm-config-r1.patch @@ -0,0 +1,73 @@ +From 7422ff662be0daeb3931fde397f1fed8ff86c50d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sat, 20 Aug 2016 23:47:41 +0200 +Subject: [PATCH] llvm-config: Clean up exported values, update for shared + linking + +Gentoo-specific fixup for llvm-config, including: +- wiping build-specific CFLAGS, CXXFLAGS, +- updating library suffixes for shared libs, +- wiping --system-libs for shared linking, +- making --src-root return invalid path (/dev/null), +- making --build-mode return "Release" rather than "Gentoo". + +Thanks to Steven Newbury for the initial patch. + +Bug: https://bugs.gentoo.org/565358 +Bug: https://bugs.gentoo.org/501684 +--- + tools/llvm-config/CMakeLists.txt | 11 ++++++++--- + tools/llvm-config/llvm-config.cpp | 9 +++++++-- + 2 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt +index 83794bb..eba6f45 100644 +--- a/tools/llvm-config/CMakeLists.txt ++++ b/tools/llvm-config/CMakeLists.txt +@@ -23,6 +23,10 @@ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR}) + set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR}) + set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") +-set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") +-set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}") ++# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler ++# specific flags will be set when we don't know what compiler will be used ++# with external project utilising llvm-config. C++ Standard is required. ++# TODO: figure out if we can remove -std=c++11 and move it to revdeps. ++set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") ++set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") + set(LLVM_BUILD_SYSTEM cmake) + set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI}) +@@ -31,5 +35,6 @@ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI}) + set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}") + set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE}) +-set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS}) ++# We don't do static libs, so we don't need to supply any system-libs ++set(LLVM_SYSTEM_LIBS "") + if(BUILD_SHARED_LIBS) + set(LLVM_ENABLE_SHARED ON) +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 80f6279..309c5dc 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -485,5 +485,6 @@ int main(int argc, char **argv) { + OS << Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE) << '\n'; + } else if (Arg == "--build-mode") { +- OS << build_mode << '\n'; ++ // force Release since we force non-standard Gentoo build mode ++ OS << "Release" << '\n'; + } else if (Arg == "--assertion-mode") { + #if defined(NDEBUG) +@@ -501,5 +502,9 @@ int main(int argc, char **argv) { + OS << ActivePrefix << '\n'; + } else if (Arg == "--src-root") { +- OS << LLVM_SRC_ROOT << '\n'; ++ if (IsInDevelopmentTree) { ++ OS << LLVM_SRC_ROOT << '\n'; ++ } else { ++ OS << "/dev/null\n"; ++ } + } else { + usage(); +-- +2.9.3 + diff --git a/sys-devel/llvm/llvm-3.4.2-r100.ebuild b/sys-devel/llvm/llvm-3.4.2-r100.ebuild index 56a9d131e6e..f9347dfb8ac 100644 --- a/sys-devel/llvm/llvm-3.4.2-r100.ebuild +++ b/sys-devel/llvm/llvm-3.4.2-r100.ebuild @@ -106,7 +106,7 @@ src_prepare() { epatch "${FILESDIR}"/3.4.2/clang/gentoo-install.patch epatch "${FILESDIR}"/3.4.2/clang/darwin_build_fix.patch - epatch "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch + epatch "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp fi diff --git a/sys-devel/llvm/llvm-3.5.2.ebuild b/sys-devel/llvm/llvm-3.5.2.ebuild index 762055be933..d9468a839d1 100644 --- a/sys-devel/llvm/llvm-3.5.2.ebuild +++ b/sys-devel/llvm/llvm-3.5.2.ebuild @@ -172,7 +172,7 @@ src_prepare() { epatch "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch epatch "${FILESDIR}"/3.5.2/clang/gentoo-install.patch - epatch "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch + epatch "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp fi diff --git a/sys-devel/llvm/llvm-3.6.2.ebuild b/sys-devel/llvm/llvm-3.6.2.ebuild index 9cd430212f1..27ad004e968 100644 --- a/sys-devel/llvm/llvm-3.6.2.ebuild +++ b/sys-devel/llvm/llvm-3.6.2.ebuild @@ -176,7 +176,7 @@ src_prepare() { epatch "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch epatch "${FILESDIR}"/3.7.1/clang/gentoo-install.patch - epatch "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch + epatch "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp # Fix build fails with using gcc-4.9 on Gentoo/FreeBSD, bug #548444 diff --git a/sys-devel/llvm/llvm-3.7.1-r3.ebuild b/sys-devel/llvm/llvm-3.7.1-r3.ebuild index ac91baf3d43..b1e9ceb1ddc 100644 --- a/sys-devel/llvm/llvm-3.7.1-r3.ebuild +++ b/sys-devel/llvm/llvm-3.7.1-r3.ebuild @@ -157,17 +157,17 @@ src_prepare() { # Make ocaml warnings non-fatal, bug #537308 sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die # Fix libdir for ocaml bindings install, bug #559134 - eapply "${FILESDIR}"/3.9.0/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch + eapply "${FILESDIR}"/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch # Do not build/install ocaml docs with USE=-doc, bug #562008 - eapply "${FILESDIR}"/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch + eapply "${FILESDIR}"/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch # Make it possible to override Sphinx HTML install dirs # https://llvm.org/bugs/show_bug.cgi?id=23780 - eapply "${FILESDIR}"/3.9.0/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch + eapply "${FILESDIR}"/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch # Prevent race conditions with parallel Sphinx runs # https://llvm.org/bugs/show_bug.cgi?id=23781 - eapply "${FILESDIR}"/3.9.0/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch + eapply "${FILESDIR}"/3.9.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch # Prevent installing libgtest # https://llvm.org/bugs/show_bug.cgi?id=18341 @@ -202,7 +202,7 @@ src_prepare() { eapply "${FILESDIR}"/3.7.1/clang/gentoo-install.patch - eapply "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch + eapply "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp # Fix -isystem support in ccc-analyzer @@ -223,7 +223,7 @@ src_prepare() { # Make it possible to override CLANG_LIBDIR_SUFFIX # (that is used only to find LLVMgold.so) # https://llvm.org/bugs/show_bug.cgi?id=23793 - eapply "${FILESDIR}"/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch + eapply "${FILESDIR}"/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch # Fix git-clang-format shebang, bug #562688 python_fix_shebang tools/clang/tools/clang-format/git-clang-format diff --git a/sys-devel/llvm/llvm-3.8.1-r2.ebuild b/sys-devel/llvm/llvm-3.8.1-r2.ebuild index 53dd9100947..9eff8cd6672 100644 --- a/sys-devel/llvm/llvm-3.8.1-r2.ebuild +++ b/sys-devel/llvm/llvm-3.8.1-r2.ebuild @@ -157,17 +157,17 @@ src_prepare() { # Make ocaml warnings non-fatal, bug #537308 sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die # Fix libdir for ocaml bindings install, bug #559134 - eapply "${FILESDIR}"/3.9.0/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch + eapply "${FILESDIR}"/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch # Do not build/install ocaml docs with USE=-doc, bug #562008 - eapply "${FILESDIR}"/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch + eapply "${FILESDIR}"/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch # Make it possible to override Sphinx HTML install dirs # https://llvm.org/bugs/show_bug.cgi?id=23780 - eapply "${FILESDIR}"/3.9.0/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch + eapply "${FILESDIR}"/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch # Prevent race conditions with parallel Sphinx runs # https://llvm.org/bugs/show_bug.cgi?id=23781 - eapply "${FILESDIR}"/3.9.0/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch + eapply "${FILESDIR}"/3.9.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch # Prevent installing libgtest # https://llvm.org/bugs/show_bug.cgi?id=18341 @@ -178,7 +178,7 @@ src_prepare() { # Fix llvm-config for shared linking and sane flags # https://bugs.gentoo.org/show_bug.cgi?id=565358 - eapply "${FILESDIR}"/3.9.0/llvm-config-r1.patch + eapply "${FILESDIR}"/3.9.1/llvm-config-r1.patch # Restore SOVERSIONs for shared libraries # https://bugs.gentoo.org/show_bug.cgi?id=578392 @@ -204,7 +204,7 @@ src_prepare() { # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3 eapply "${FILESDIR}"/3.8.1/clang/gcc4.9-search-path.patch - eapply "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch + eapply "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp pushd "${S}"/tools/clang >/dev/null || die @@ -220,7 +220,7 @@ src_prepare() { # Install clang runtime into /usr/lib/clang # https://llvm.org/bugs/show_bug.cgi?id=23792 - eapply "${FILESDIR}"/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch + eapply "${FILESDIR}"/3.9.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch eapply "${FILESDIR}"/3.8.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch # Do not force -march flags on arm platforms @@ -230,7 +230,7 @@ src_prepare() { # Make it possible to override CLANG_LIBDIR_SUFFIX # (that is used only to find LLVMgold.so) # https://llvm.org/bugs/show_bug.cgi?id=23793 - eapply "${FILESDIR}"/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch + eapply "${FILESDIR}"/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch # Fix git-clang-format shebang, bug #562688 python_fix_shebang tools/clang/tools/clang-format/git-clang-format @@ -259,7 +259,7 @@ src_prepare() { sed -e 's/add_subdirectory(readline)/#&/' \ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die # Do not install bundled six module - eapply "${FILESDIR}"/3.9.0/lldb/six.patch + eapply "${FILESDIR}"/3.9.1/lldb/six.patch fi # User patches diff --git a/sys-devel/llvm/llvm-3.8.1.ebuild b/sys-devel/llvm/llvm-3.8.1.ebuild index 07d910bf3ef..fb0575f2152 100644 --- a/sys-devel/llvm/llvm-3.8.1.ebuild +++ b/sys-devel/llvm/llvm-3.8.1.ebuild @@ -158,17 +158,17 @@ src_prepare() { # Make ocaml warnings non-fatal, bug #537308 sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die # Fix libdir for ocaml bindings install, bug #559134 - eapply "${FILESDIR}"/3.9.0/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch + eapply "${FILESDIR}"/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch # Do not build/install ocaml docs with USE=-doc, bug #562008 - eapply "${FILESDIR}"/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch + eapply "${FILESDIR}"/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch # Make it possible to override Sphinx HTML install dirs # https://llvm.org/bugs/show_bug.cgi?id=23780 - eapply "${FILESDIR}"/3.9.0/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch + eapply "${FILESDIR}"/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch # Prevent race conditions with parallel Sphinx runs # https://llvm.org/bugs/show_bug.cgi?id=23781 - eapply "${FILESDIR}"/3.9.0/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch + eapply "${FILESDIR}"/3.9.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch # Prevent installing libgtest # https://llvm.org/bugs/show_bug.cgi?id=18341 @@ -199,7 +199,7 @@ src_prepare() { # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3 eapply "${FILESDIR}"/3.8.1/clang/gcc4.9-search-path.patch - eapply "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch + eapply "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp eapply "${FILESDIR}"/3.8.1/compiler-rt/darwin-default-sysroot.patch @@ -209,7 +209,7 @@ src_prepare() { # Install clang runtime into /usr/lib/clang # https://llvm.org/bugs/show_bug.cgi?id=23792 - eapply "${FILESDIR}"/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch + eapply "${FILESDIR}"/3.9.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch eapply "${FILESDIR}"/3.8.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch # Do not force -march flags on arm platforms @@ -219,7 +219,7 @@ src_prepare() { # Make it possible to override CLANG_LIBDIR_SUFFIX # (that is used only to find LLVMgold.so) # https://llvm.org/bugs/show_bug.cgi?id=23793 - eapply "${FILESDIR}"/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch + eapply "${FILESDIR}"/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch # Fix git-clang-format shebang, bug #562688 python_fix_shebang tools/clang/tools/clang-format/git-clang-format @@ -244,7 +244,7 @@ src_prepare() { sed -e 's/add_subdirectory(readline)/#&/' \ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die # Do not install bundled six module - eapply "${FILESDIR}"/3.9.0/lldb/six.patch + eapply "${FILESDIR}"/3.9.1/lldb/six.patch fi # User patches diff --git a/sys-devel/llvm/llvm-3.9.0-r1.ebuild b/sys-devel/llvm/llvm-3.9.0-r1.ebuild index 65d153e3587..905de6cef1f 100644 --- a/sys-devel/llvm/llvm-3.9.0-r1.ebuild +++ b/sys-devel/llvm/llvm-3.9.0-r1.ebuild @@ -168,28 +168,28 @@ src_prepare() { python_setup # Fix libdir for ocaml bindings install, bug #559134 - eapply "${FILESDIR}"/3.9.0/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch + eapply "${FILESDIR}"/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch # Do not build/install ocaml docs with USE=-doc, bug #562008 - eapply "${FILESDIR}"/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch + eapply "${FILESDIR}"/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch # Make it possible to override Sphinx HTML install dirs # https://llvm.org/bugs/show_bug.cgi?id=23780 - eapply "${FILESDIR}"/3.9.0/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch + eapply "${FILESDIR}"/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch # Prevent race conditions with parallel Sphinx runs # https://llvm.org/bugs/show_bug.cgi?id=23781 - eapply "${FILESDIR}"/3.9.0/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch + eapply "${FILESDIR}"/3.9.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch # Allow custom cmake build types (like 'Gentoo') eapply "${FILESDIR}"/9999/0006-cmake-Remove-the-CMAKE_BUILD_TYPE-assertion.patch # Fix llvm-config for shared linking and sane flags # https://bugs.gentoo.org/show_bug.cgi?id=565358 - eapply "${FILESDIR}"/3.9.0/llvm-config-r1.patch + eapply "${FILESDIR}"/3.9.1/llvm-config-r1.patch # Restore SOVERSIONs for shared libraries # https://bugs.gentoo.org/show_bug.cgi?id=578392 - eapply "${FILESDIR}"/3.9.0/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch + eapply "${FILESDIR}"/3.9.1/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch # support building llvm against musl-libc use elibc_musl && eapply "${FILESDIR}"/9999/musl-fixes.patch @@ -204,14 +204,14 @@ src_prepare() { # Automatically select active system GCC's libraries, bugs #406163 and #417913 eapply "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch - eapply "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch + eapply "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp eapply "${FILESDIR}"/3.8.1/compiler-rt/darwin-default-sysroot.patch pushd "${S}"/tools/clang >/dev/null || die # be able to specify default values for -stdlib and -rtlib at build time - eapply "${FILESDIR}"/3.9.0/clang/default-libs.patch + eapply "${FILESDIR}"/3.9.1/clang/default-libs.patch popd >/dev/null || die sed -i -e "s^@EPREFIX@^${EPREFIX}^" \ @@ -219,13 +219,13 @@ src_prepare() { # Install clang runtime into /usr/lib/clang # https://llvm.org/bugs/show_bug.cgi?id=23792 - eapply "${FILESDIR}"/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch - eapply "${FILESDIR}"/3.9.0/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch + eapply "${FILESDIR}"/3.9.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch + eapply "${FILESDIR}"/3.9.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch # Make it possible to override CLANG_LIBDIR_SUFFIX # (that is used only to find LLVMgold.so) # https://llvm.org/bugs/show_bug.cgi?id=23793 - eapply "${FILESDIR}"/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch + eapply "${FILESDIR}"/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch # Fix git-clang-format shebang, bug #562688 python_fix_shebang tools/clang/tools/clang-format/git-clang-format @@ -246,7 +246,7 @@ src_prepare() { sed -e 's/add_subdirectory(readline)/#&/' \ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die # Do not install bundled six module - eapply "${FILESDIR}"/3.9.0/lldb/six.patch + eapply "${FILESDIR}"/3.9.1/lldb/six.patch fi # User patches -- cgit v1.2.1