sys-devel/llvm: Move 3.9.1 patchset to tarball

This commit is contained in:
Michał Górny
2017-06-03 11:37:16 +02:00
parent 213b03205a
commit 75f8d3f4c6
17 changed files with 20 additions and 1716 deletions

View File

@@ -32,6 +32,7 @@ DIST llvm-3.8.0-manpages.tar.bz2 37889 SHA256 4dda7f69f9412e0fb50d32631df34d6ea7
DIST llvm-3.8.1-patchset.tar.xz 24260 SHA256 4a1677b5aff3a4ca8ccdbcc45e286e44d23867cbaa48a39cffc0fc2a8765ed6c SHA512 1e4ec68c56cc72a89afb573ad0c3cada10be7ec02e0af033a6c5cf8ce46ed7bf40389543c2f1b11e7080dba49962c57b4ea9f9bc971c4647eb3fd945c0cf0529 WHIRLPOOL 38c16b23f995818a6ca292e89d28f85ae6d19327bc0efe72270611077a7b76bca99b2e1f11b8653550bddee4123f2611621b86c4b81cdb8f96edc1cd4c5cfc4f
DIST llvm-3.8.1.src.tar.xz 16551472 SHA256 6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9 SHA512 99bbb2cc5f337fd5edf1621f8028c8cb74011aa4af2531018dc05409b27f7b8d0c2f76a00115f677f7c013029d5d9f55d085a5b40433409aac4e9161d53bd366 WHIRLPOOL a99cef164a0e05e5237b840bee776d48fe0bde460cb4536f03a5e4eb0cc630deeb96f76bdd42f912a4b2dab08133bd9137ea16be1b9582d375f0f5841dd40234
DIST llvm-3.9.0_rc3-manpages.tar.bz2 80007 SHA256 991f5238d23c0aee2fd303d1adecd6045c42ed066f42f0d58f62c3a25c197140 SHA512 f96c340021de3f096ec3ad7d51a6af2c7a84974122d1df15729a39d4f9d65452f063a85ab38adb064288dc14220d9cc679b31ee19b48424d3d7cde621ff37597 WHIRLPOOL d3f24a2faaa5aa909519373532262c342acf517048ac543f303b6ddb539f5ece876a338c8efc445f4ada6f723a4e65e35bd5f2f9b4f52ef96ef832000259ab20
DIST llvm-3.9.1-patchset.tar.xz 16404 SHA256 a4b3e5887b53af47984ea39ff8640f11e8a9accbafd1be20fb9cf25f2980b16c SHA512 dcae89ba910b5195bb455924242912f526b6994f0f236571b6364fd594bf9ca03cc74e116a44ae4372e34ce63b21f1351125157e7af7a957aee115f400b54089 WHIRLPOOL a9ec4315e8bb9593e6734e22a0d81fbe0398adedcfe7f6b81de852c1a1092593e07624a5ce7b67bca8be8b34c7453fda9f7eb33be41d11f51458800248a15649
DIST llvm-3.9.1.src.tar.xz 18130436 SHA256 1fd90354b9cf19232e8f168faf2220e79be555df3aa743242700879e8fd329ee SHA512 50cbe8ee911080f586e77861c442348701bd02e2de0c090c54c34f82ac275ecfcd712af0f41e387c33b4a6057778a4258a27554292fe68ab4af3fd9dd6d90683 WHIRLPOOL 1cd1a25befcb178bec4a4aace4367167f3838d32edbe9db9de8c6e558c01c1fcf123f6d6f80b7ec9ff32b3d6dcf2de2f4eb4201d417c3d17a5c8a69934832903
DIST llvm-4.0.0.src.tar.xz 21016340 SHA256 8d10511df96e73b8ff9e7abbfb4d4d432edbdbe965f1f4f07afaf370b8a533be SHA512 cf681f0626ef6d568d951cdc3e143471a1d7715a0ba11e52aa273cf5d8d421e1357ef2645cc85879eaefcd577e99e74d07b01566825b3d0461171ef2cbfc7704 WHIRLPOOL 9783e8f47306c1deb2e114d4b46a7db9b0260b4965076345c88765413c5fc8e73fab5f88ae4903adbdea31406022948b16d32ae47d98f5def074509d5d794579
DIST llvm-manpages-4.0.0.tar.bz2 84861 SHA256 4676b3a18e95ddba19e868bfac0753154be2b57bc0d557f90270e4d2b0913d37 SHA512 7a04ffb607203aca099c816fe6e143779062610935f501786bd64bad6001741fb7a55adebe4e52e0611aa70fa04b22e1a7cab7b3da9dc2ed996fd0baf1ae8916 WHIRLPOOL e2ce15c26008995d71b830d74c5e6ca7dd862ed8208168facc0be6e7f855e5f59b143057ec2bbbaa70ed54dc77ad31279239886d25fe67c0853a9dee7baff31b

View File

@@ -1,71 +0,0 @@
From 2907883b3c504a08b98cf735ceaa8e438d20f37e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
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 <gienah@gentoo.org>
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

View File

@@ -1,28 +0,0 @@
From 726806d9b4932287d67f9b6b112099648ea008b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
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 <voyageur@gentoo.org>
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

View File

@@ -1,37 +0,0 @@
From 1251ac2021b768d3a56b4dc03212ea2fd12a34dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Mon, 8 Jun 2015 06:43:00 +0200
Subject: [PATCH 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

View File

@@ -1,35 +0,0 @@
From 40960f63616f62c8ac52eeeddf68bdb441b8be3e Mon Sep 17 00:00:00 2001
From: Michal Gorny <mgorny@gentoo.org>
Date: Tue, 4 Oct 2016 06:09:14 +0000
Subject: [PATCH] [cmake] Use separate doctrees to prevent races between Sphinx
instances
Use separate doctrees between different Sphinx builders in order to
prevent race condition issues due to multiple Sphinx instances accessing
the same doctree cache in parallel.
Bug: https://llvm.org/bugs/show_bug.cgi?id=23781
Differential Revision: https://reviews.llvm.org/D23755
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283188 91177308-0d34-0410-b5e6-96231b3b80d8
---
cmake/modules/AddSphinxTarget.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake
index a968555aa06..ca9f4c38ffd 100644
--- a/cmake/modules/AddSphinxTarget.cmake
+++ b/cmake/modules/AddSphinxTarget.cmake
@@ -6,7 +6,7 @@
# ``project`` should be the project name
function (add_sphinx_target builder project)
set(SPHINX_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/${builder}")
- set(SPHINX_DOC_TREE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
+ set(SPHINX_DOC_TREE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees-${builder}")
set(SPHINX_TARGET_NAME docs-${project}-${builder})
if (SPHINX_WARNINGS_AS_ERRORS)
--
2.11.0

View File

@@ -1,28 +0,0 @@
From a2ecd4815d285281cb816e06b25dc0dc2a933073 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sun, 21 Aug 2016 23:13:45 +0200
Subject: [PATCH 06/10] cmake: Remove the CMAKE_BUILD_TYPE assertion
---
CMakeLists.txt | 5 -----
1 file changed, 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 894bc8c..453fcb8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -232,11 +232,6 @@ endif()
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
-if (CMAKE_BUILD_TYPE AND
- NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
- message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
-endif()
-
set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
--
2.9.3

View File

@@ -1,62 +0,0 @@
From aeddc35a35c55f487977d7609060225e03e2028b Mon Sep 17 00:00:00 2001
From: Michal Gorny <mgorny@gentoo.org>
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

View File

@@ -1,120 +0,0 @@
From d6b5bd6f44e8091a4c4870f1c52921c25a4f8cca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sat, 21 Jan 2017 12:35:36 +0100
Subject: [PATCH] Revert "AMDGPU: Fix an interaction between WQM and polygon
stippling"
https://bugs.gentoo.org/603858
---
lib/Target/AMDGPU/SIInstructions.td | 1 -
lib/Target/AMDGPU/SIWholeQuadMode.cpp | 7 +++++
test/CodeGen/AMDGPU/wqm.ll | 49 +++--------------------------------
3 files changed, 11 insertions(+), 46 deletions(-)
diff --git a/lib/Target/AMDGPU/SIInstructions.td b/lib/Target/AMDGPU/SIInstructions.td
index dde5f2fc6b4..18b7d5d62ef 100644
--- a/lib/Target/AMDGPU/SIInstructions.td
+++ b/lib/Target/AMDGPU/SIInstructions.td
@@ -2029,7 +2029,6 @@ def SI_RETURN : PseudoInstSI <
let hasSideEffects = 1;
let SALU = 1;
let hasNoSchedulingInfo = 1;
- let DisableWQM = 1;
}
let Uses = [EXEC], Defs = [EXEC, VCC, M0],
diff --git a/lib/Target/AMDGPU/SIWholeQuadMode.cpp b/lib/Target/AMDGPU/SIWholeQuadMode.cpp
index 1534d582569..b200c153df0 100644
--- a/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+++ b/lib/Target/AMDGPU/SIWholeQuadMode.cpp
@@ -219,6 +219,13 @@ char SIWholeQuadMode::scanInstructions(MachineFunction &MF,
markInstruction(MI, Flags, Worklist);
GlobalFlags |= Flags;
}
+
+ if (WQMOutputs && MBB.succ_empty()) {
+ // This is a prolog shader. Make sure we go back to exact mode at the end.
+ Blocks[&MBB].OutNeeds = StateExact;
+ Worklist.push_back(&MBB);
+ GlobalFlags |= StateExact;
+ }
}
return GlobalFlags;
diff --git a/test/CodeGen/AMDGPU/wqm.ll b/test/CodeGen/AMDGPU/wqm.ll
index 41e42645788..809a7ba9b82 100644
--- a/test/CodeGen/AMDGPU/wqm.ll
+++ b/test/CodeGen/AMDGPU/wqm.ll
@@ -17,18 +17,17 @@ main_body:
;CHECK-LABEL: {{^}}test2:
;CHECK-NEXT: ; %main_body
;CHECK-NEXT: s_wqm_b64 exec, exec
+;CHECK: image_sample
;CHECK-NOT: exec
-define amdgpu_ps void @test2(<8 x i32> inreg %rsrc, <4 x i32> inreg %sampler, float addrspace(1)* inreg %ptr, <4 x i32> %c) {
+;CHECK: _load_dword v0,
+define amdgpu_ps float @test2(<8 x i32> inreg %rsrc, <4 x i32> inreg %sampler, float addrspace(1)* inreg %ptr, <4 x i32> %c) {
main_body:
%c.1 = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> %c, <8 x i32> %rsrc, <4 x i32> %sampler, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%c.2 = bitcast <4 x float> %c.1 to <4 x i32>
%c.3 = extractelement <4 x i32> %c.2, i32 0
%gep = getelementptr float, float addrspace(1)* %ptr, i32 %c.3
%data = load float, float addrspace(1)* %gep
-
- call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 1, float %data, float undef, float undef, float undef)
-
- ret void
+ ret float %data
}
; ... but disabled for stores (and, in this simple case, not re-enabled).
@@ -415,46 +414,6 @@ entry:
ret void
}
-; Must return to exact at the end of a non-void returning shader,
-; otherwise the EXEC mask exported by the epilog will be wrong. This is true
-; even if the shader has no kills, because a kill could have happened in a
-; previous shader fragment.
-;
-; CHECK-LABEL: {{^}}test_nonvoid_return:
-; CHECK: s_mov_b64 [[LIVE:s\[[0-9]+:[0-9]+\]]], exec
-; CHECK: s_wqm_b64 exec, exec
-;
-; CHECK: s_and_b64 exec, exec, [[LIVE]]
-; CHECK-NOT: exec
-define amdgpu_ps <4 x float> @test_nonvoid_return() nounwind {
- %tex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
- %tex.i = bitcast <4 x float> %tex to <4 x i32>
- %dtex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> %tex.i, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
- ret <4 x float> %dtex
-}
-
-; CHECK-LABEL: {{^}}test_nonvoid_return_unreachable:
-; CHECK: s_mov_b64 [[LIVE:s\[[0-9]+:[0-9]+\]]], exec
-; CHECK: s_wqm_b64 exec, exec
-;
-; CHECK: s_and_b64 exec, exec, [[LIVE]]
-; CHECK-NOT: exec
-define amdgpu_ps <4 x float> @test_nonvoid_return_unreachable(i32 inreg %c) nounwind {
-entry:
- %tex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
- %tex.i = bitcast <4 x float> %tex to <4 x i32>
- %dtex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> %tex.i, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
-
- %cc = icmp sgt i32 %c, 0
- br i1 %cc, label %if, label %else
-
-if:
- store volatile <4 x float> %dtex, <4 x float>* undef
- unreachable
-
-else:
- ret <4 x float> %dtex
-}
declare void @llvm.amdgcn.image.store.v4i32(<4 x float>, <4 x i32>, <8 x i32>, i32, i1, i1, i1, i1) #1
declare void @llvm.amdgcn.buffer.store.f32(float, <4 x i32>, i32, i32, i1, i1) #1
--
2.11.0

View File

@@ -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)

View File

@@ -1,28 +0,0 @@
From d07632abe23d55eec2aae303a142a97765a77d32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Tue, 9 Jun 2015 12:20:06 +0200
Subject: [PATCH 2/2] cmake: Make CLANG_LIBDIR_SUFFIX overridable
Make CLANG_LIBDIR_SUFFIX a cache variable so that it can be explicitly
overriden. It is used purely to find the LLVMgold.so plugin, so we want
to set it to native suffix.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 357286b..647f976 100644
--- a/tools/clang/CMakeLists.txt
+++ b/tools/clang/CMakeLists.txt
@@ -203,7 +203,7 @@ set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING
"Vendor-specific uti.")
# The libdir suffix must exactly match whatever LLVM's configuration used.
-set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}")
+set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING "")
set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
--
2.4.3

View File

@@ -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);
}

View File

@@ -1,703 +0,0 @@
From 2d354bfbb2f5efdf3f6b2405078f9ccb65c21536 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
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

View File

@@ -1,422 +0,0 @@
From a0b8bc9ef667ed7158400f7cbf772e470661d203 Mon Sep 17 00:00:00 2001
From: Michal Gorny <mgorny@gentoo.org>
Date: Tue, 25 Oct 2016 15:07:41 +0000
Subject: [PATCH] (squashed gcc-config patch, from commits:)
[Driver] Support obtaining active toolchain from gcc-config on Gentoo
Support using gcc-config to determine the correct GCC toolchain location
on Gentoo. In order to do that, attempt to read gcc-config configuration
form [[sysroot]]/etc/env.d/gcc, if no custom toolchain location is
provided.
Differential Revision: https://reviews.llvm.org/D25661
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285074 91177308-0d34-0410-b5e6-96231b3b80d8
[Driver] Fix finding multilib gcc install on Gentoo (with gcc-config)
Fix the gcc-config code to support multilib gcc installs properly. This
solves two problems: -mx32 using the 64-bit gcc directory (due to matching
installation triple), and -m32 not respecting gcc-config at all (due to
mismatched installation triple).
In order to fix the former issue, split the multilib scan out of
Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple() (the code
is otherwise unchanged), and call it for each installation found via
gcc-config.
In order to fix the latter issue, split the gcc-config processing out of
Generic_GCC::GCCInstallationDetector::init() and repeat it for all
triples, including extra and biarch triples. The only change
in the gcc-config code itself is adding the call to multilib scan.
Convert the gentoo_linux_gcc_multi_version_tree test input to multilib
x86_64+32+x32 install, and add appropriate tests to linux-header-search
and linux-ld.
Differential Revision: https://reviews.llvm.org/D26887
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289436 91177308-0d34-0410-b5e6-96231b3b80d8
[Driver] Attempt to fix new linux-ld tests on Windows
(broken by r289436)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289440 91177308-0d34-0410-b5e6-96231b3b80d8
---
lib/Driver/ToolChains.cpp | 104 +++++++++++++++++----
lib/Driver/ToolChains.h | 10 ++
.../etc/env.d/gcc/config-x86_64-pc-linux-gnu | 1 +
.../etc/env.d/gcc/x86_64-pc-linux-gnu-4.9.3 | 10 ++
.../etc/gentoo-release | 1 +
.../usr/include/.keep | 0
.../gcc/x86_64-pc-linux-gnu/4.9.3/32/crtbegin.o | 0
.../lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o | 0
.../4.9.3/include/g++-v4.9.3/.keep | 0
.../gcc/x86_64-pc-linux-gnu/4.9.3/x32/crtbegin.o | 0
.../gcc/x86_64-pc-linux-gnu/5.4.0/32/crtbegin.o | 0
.../lib/gcc/x86_64-pc-linux-gnu/5.4.0/crtbegin.o | 0
.../5.4.0/include/g++-v5.4.0/.keep | 0
.../gcc/x86_64-pc-linux-gnu/5.4.0/x32/crtbegin.o | 0
.../usr/x86_64-pc-linux-gnu/lib/.keep | 0
test/Driver/linux-header-search.cpp | 42 +++++++++
test/Driver/linux-ld.c | 53 +++++++++++
17 files changed, 204 insertions(+), 17 deletions(-)
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/env.d/gcc/config-x86_64-pc-linux-gnu
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/env.d/gcc/x86_64-pc-linux-gnu-4.9.3
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/gentoo-release
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/include/.keep
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32/crtbegin.o
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/x32/crtbegin.o
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/32/crtbegin.o
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/crtbegin.o
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5.4.0/.keep
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/x32/crtbegin.o
create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/x86_64-pc-linux-gnu/lib/.keep
diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
index 1b02f467c1..84123ea132 100644
--- a/tools/clang/lib/Driver/ToolChains.cpp
+++ b/tools/clang/lib/Driver/ToolChains.cpp
@@ -1420,6 +1420,25 @@ void Generic_GCC::GCCInstallationDetector::init(
}
}
+ // Try to respect gcc-config on Gentoo. However, do that only
+ // if --gcc-toolchain is not provided or equal to the Gentoo install
+ // in /usr. This avoids accidentally enforcing the system GCC version
+ // when using a custom toolchain.
+ if (GCCToolchainDir == "" || GCCToolchainDir == D.SysRoot + "/usr") {
+ for (StringRef CandidateTriple : ExtraTripleAliases) {
+ if (ScanGentooGccConfig(TargetTriple, Args, CandidateTriple))
+ return;
+ }
+ for (StringRef CandidateTriple : CandidateTripleAliases) {
+ if (ScanGentooGccConfig(TargetTriple, Args, CandidateTriple))
+ return;
+ }
+ for (StringRef CandidateTriple : CandidateBiarchTripleAliases) {
+ if (ScanGentooGccConfig(TargetTriple, Args, CandidateTriple, true))
+ return;
+ }
+ }
+
// Loop over the various components which exist and select the best GCC
// installation available. GCC installs are ranked by version number.
Version = GCCVersion::Parse("0.0.0");
@@ -2546,6 +2565,33 @@ void Generic_GCC::GCCInstallationDetector::scanLibDirForGCCTripleSolaris(
}
}
+bool Generic_GCC::GCCInstallationDetector::ScanGCCForMultilibs(
+ const llvm::Triple &TargetTriple, const ArgList &Args,
+ StringRef Path, bool NeedsBiarchSuffix) {
+ llvm::Triple::ArchType TargetArch = TargetTriple.getArch();
+ DetectedMultilibs Detected;
+
+ // Android standalone toolchain could have multilibs for ARM and Thumb.
+ // Debian mips multilibs behave more like the rest of the biarch ones,
+ // so handle them there
+ if (isArmOrThumbArch(TargetArch) && TargetTriple.isAndroid()) {
+ // It should also work without multilibs in a simplified toolchain.
+ findAndroidArmMultilibs(D, TargetTriple, Path, Args, Detected);
+ } else if (isMipsArch(TargetArch)) {
+ if (!findMIPSMultilibs(D, TargetTriple, Path, Args, Detected))
+ return false;
+ } else if (!findBiarchMultilibs(D, TargetTriple, Path, Args,
+ NeedsBiarchSuffix, Detected)) {
+ return false;
+ }
+
+ Multilibs = Detected.Multilibs;
+ SelectedMultilib = Detected.SelectedMultilib;
+ BiarchSibling = Detected.BiarchSibling;
+
+ return true;
+}
+
void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
const llvm::Triple &TargetTriple, const ArgList &Args,
const std::string &LibDir, StringRef CandidateTriple,
@@ -2601,25 +2647,10 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
if (CandidateVersion <= Version)
continue;
- DetectedMultilibs Detected;
-
- // Android standalone toolchain could have multilibs for ARM and Thumb.
- // Debian mips multilibs behave more like the rest of the biarch ones,
- // so handle them there
- if (isArmOrThumbArch(TargetArch) && TargetTriple.isAndroid()) {
- // It should also work without multilibs in a simplified toolchain.
- findAndroidArmMultilibs(D, TargetTriple, LI->getName(), Args, Detected);
- } else if (isMipsArch(TargetArch)) {
- if (!findMIPSMultilibs(D, TargetTriple, LI->getName(), Args, Detected))
- continue;
- } else if (!findBiarchMultilibs(D, TargetTriple, LI->getName(), Args,
- NeedsBiarchSuffix, Detected)) {
+ if (!ScanGCCForMultilibs(TargetTriple, Args, LI->getName(),
+ NeedsBiarchSuffix))
continue;
- }
- Multilibs = Detected.Multilibs;
- SelectedMultilib = Detected.SelectedMultilib;
- BiarchSibling = Detected.BiarchSibling;
Version = CandidateVersion;
GCCTriple.setTriple(CandidateTriple);
// FIXME: We hack together the directory name here instead of
@@ -2633,6 +2664,45 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
}
}
+bool Generic_GCC::GCCInstallationDetector::ScanGentooGccConfig(
+ const llvm::Triple &TargetTriple, const ArgList &Args,
+ StringRef CandidateTriple, bool NeedsBiarchSuffix) {
+ llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
+ D.getVFS().getBufferForFile(D.SysRoot + "/etc/env.d/gcc/config-" +
+ CandidateTriple.str());
+ if (File) {
+ SmallVector<StringRef, 2> Lines;
+ File.get()->getBuffer().split(Lines, "\n");
+ for (StringRef Line : Lines) {
+ // CURRENT=triple-version
+ if (Line.startswith("CURRENT=")) {
+ const std::pair<StringRef, StringRef> ActiveVersion =
+ Line.substr(8).rsplit('-');
+ // Note: Strictly speaking, we should be reading
+ // /etc/env.d/gcc/${CURRENT} now. However, the file doesn't
+ // contain anything new or especially useful to us.
+ const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" +
+ ActiveVersion.first.str() + "/" +
+ ActiveVersion.second.str();
+ if (D.getVFS().exists(GentooPath + "/crtbegin.o")) {
+ if (!ScanGCCForMultilibs(TargetTriple, Args, GentooPath,
+ NeedsBiarchSuffix))
+ return false;
+
+ Version = GCCVersion::Parse(ActiveVersion.second);
+ GCCInstallPath = GentooPath;
+ GCCParentLibPath = GentooPath + "/../../..";
+ GCCTriple.setTriple(ActiveVersion.first);
+ IsValid = true;
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple &Triple,
const ArgList &Args)
: ToolChain(D, Triple, Args), GCCInstallation(D), CudaInstallation(D) {
diff --git a/tools/clang/lib/Driver/ToolChains.h b/tools/clang/lib/Driver/ToolChains.h
index 369712fa93..6c2d0cb201 100644
--- a/tools/clang/lib/Driver/ToolChains.h
+++ b/tools/clang/lib/Driver/ToolChains.h
@@ -143,6 +143,11 @@ public:
SmallVectorImpl<StringRef> &BiarchLibDirs,
SmallVectorImpl<StringRef> &BiarchTripleAliases);
+ bool ScanGCCForMultilibs(const llvm::Triple &TargetTriple,
+ const llvm::opt::ArgList &Args,
+ StringRef Path,
+ bool NeedsBiarchSuffix = false);
+
void ScanLibDirForGCCTriple(const llvm::Triple &TargetArch,
const llvm::opt::ArgList &Args,
const std::string &LibDir,
@@ -154,6 +159,11 @@ public:
const std::string &LibDir,
StringRef CandidateTriple,
bool NeedsBiarchSuffix = false);
+
+ bool ScanGentooGccConfig(const llvm::Triple &TargetTriple,
+ const llvm::opt::ArgList &Args,
+ StringRef CandidateTriple,
+ bool NeedsBiarchSuffix = false);
};
protected:
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/env.d/gcc/config-x86_64-pc-linux-gnu b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/env.d/gcc/config-x86_64-pc-linux-gnu
new file mode 100644
index 0000000000..5ef56a33a6
--- /dev/null
+++ b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/env.d/gcc/config-x86_64-pc-linux-gnu
@@ -0,0 +1 @@
+CURRENT=x86_64-pc-linux-gnu-4.9.3
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/env.d/gcc/x86_64-pc-linux-gnu-4.9.3 b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/env.d/gcc/x86_64-pc-linux-gnu-4.9.3
new file mode 100644
index 0000000000..9ff406284f
--- /dev/null
+++ b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/env.d/gcc/x86_64-pc-linux-gnu-4.9.3
@@ -0,0 +1,10 @@
+PATH="/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3"
+ROOTPATH="/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3"
+GCC_PATH="/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3"
+LDPATH="/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3:/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32"
+MANPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man"
+INFOPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/info"
+STDCXX_INCDIR="g++-v4"
+CTARGET="x86_64-pc-linux-gnu"
+GCC_SPECS=""
+MULTIOSDIRS="../lib64:../lib32"
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/gentoo-release b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/gentoo-release
new file mode 100644
index 0000000000..5f0944f7d9
--- /dev/null
+++ b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/etc/gentoo-release
@@ -0,0 +1 @@
+Gentoo Base System release 2.3
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/include/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/include/.keep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32/crtbegin.o b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32/crtbegin.o
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/x32/crtbegin.o b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/x32/crtbegin.o
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/32/crtbegin.o b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/32/crtbegin.o
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/crtbegin.o b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/crtbegin.o
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5.4.0/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5.4.0/.keep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/x32/crtbegin.o b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/x32/crtbegin.o
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/x86_64-pc-linux-gnu/lib/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_multi_version_tree/usr/x86_64-pc-linux-gnu/lib/.keep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/clang/test/Driver/linux-header-search.cpp b/tools/clang/test/Driver/linux-header-search.cpp
index 5f6ac504a0..274895fb4f 100644
--- a/tools/clang/test/Driver/linux-header-search.cpp
+++ b/tools/clang/test/Driver/linux-header-search.cpp
@@ -301,6 +301,48 @@
// CHECK-GENTOO-4-9-3: "-internal-externc-isystem" "[[SYSROOT]]/include"
// CHECK-GENTOO-4-9-3: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
//
+// Test support for Gentoo's gcc-config -- clang should prefer the older
+// (4.9.3) version over the newer (5.4.0) due to preference specified
+// in /etc/env.d/gcc/x86_64-pc-linux-gnu.
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN: -target x86_64-unknown-linux-gnu -stdlib=libstdc++ \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
+// RUN: --gcc-toolchain="" \
+// RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-3 %s
+//
+// Test that gcc-config support does not break multilib.
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN: -target x86_64-unknown-linux-gnux32 -stdlib=libstdc++ \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
+// RUN: --gcc-toolchain="" \
+// RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-3-X32 %s
+// CHECK-GENTOO-4-9-3-X32: "{{.*}}clang{{.*}}" "-cc1"
+// CHECK-GENTOO-4-9-3-X32: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
+// CHECK-GENTOO-4-9-3-X32: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3"
+// CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/x86_64-pc-linux-gnu/x32"
+// CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/backward"
+// CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
+// CHECK-GENTOO-4-9-3-X32: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-GENTOO-4-9-3-X32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+//
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN: -target i386-unknown-linux-gnu -stdlib=libstdc++ \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
+// RUN: --gcc-toolchain="" \
+// RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-3-32 %s
+// CHECK-GENTOO-4-9-3-32: "{{.*}}clang{{.*}}" "-cc1"
+// CHECK-GENTOO-4-9-3-32: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
+// CHECK-GENTOO-4-9-3-32: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3"
+// CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/x86_64-pc-linux-gnu/32"
+// CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/backward"
+// CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
+// CHECK-GENTOO-4-9-3-32: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-GENTOO-4-9-3-32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+//
// Check header search on Debian 6 / MIPS64
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target mips64-unknown-linux-gnuabi64 -stdlib=libstdc++ \
diff --git a/tools/clang/test/Driver/linux-ld.c b/tools/clang/test/Driver/linux-ld.c
index f9f4b482c9..ee995ac2d6 100644
--- a/tools/clang/test/Driver/linux-ld.c
+++ b/tools/clang/test/Driver/linux-ld.c
@@ -1650,3 +1650,56 @@
// CHECK-MUSL-ARMEBHF: "-dynamic-linker" "/lib/ld-musl-armebhf.so.1"
// CHECK-MUSL-AARCH64: "-dynamic-linker" "/lib/ld-musl-aarch64.so.1"
// CHECK-MUSL-AARCH64_BE: "-dynamic-linker" "/lib/ld-musl-aarch64_be.so.1"
+
+// Check whether multilib gcc install works fine on Gentoo with gcc-config
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux-gnu -rtlib=platform \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
+// RUN: --gcc-toolchain="" \
+// RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO %s
+// CHECK-LD-GENTOO-NOT: warning:
+// CHECK-LD-GENTOO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-GENTOO: "--eh-frame-hdr"
+// CHECK-LD-GENTOO: "-m" "elf_x86_64"
+// CHECK-LD-GENTOO: "-dynamic-linker"
+// CHECK-LD-GENTOO: "{{.*}}/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3{{/|\\\\}}crtbegin.o"
+// CHECK-LD-GENTOO: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3"
+// CHECK-LD-GENTOO: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/lib"
+// CHECK-LD-GENTOO: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../.."
+// CHECK-LD-GENTOO: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// CHECK-LD-GENTOO: "-lc"
+// CHECK-LD-GENTOO: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=i686-unknown-linux-gnu -rtlib=platform \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
+// RUN: --gcc-toolchain="" \
+// RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO-32 %s
+// CHECK-LD-GENTOO-32-NOT: warning:
+// CHECK-LD-GENTOO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-GENTOO-32: "--eh-frame-hdr"
+// CHECK-LD-GENTOO-32: "-m" "elf_i386"
+// CHECK-LD-GENTOO-32: "-dynamic-linker"
+// CHECK-LD-GENTOO-32: "{{.*}}/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32{{/|\\\\}}crtbegin.o"
+// CHECK-LD-GENTOO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32"
+// CHECK-LD-GENTOO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/lib"
+// CHECK-LD-GENTOO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../.."
+// CHECK-LD-GENTOO-32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// CHECK-LD-GENTOO-32: "-lc"
+// CHECK-LD-GENTOO-32: "-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 -rtlib=platform \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
+// RUN: --gcc-toolchain="" \
+// RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO-X32 %s
+// CHECK-LD-GENTOO-X32-NOT: warning:
+// CHECK-LD-GENTOO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-GENTOO-X32: "--eh-frame-hdr"
+// CHECK-LD-GENTOO-X32: "-m" "elf32_x86_64"
+// CHECK-LD-GENTOO-X32: "-dynamic-linker"
+// CHECK-LD-GENTOO-X32: "{{.*}}/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/x32{{/|\\\\}}crtbegin.o"
+// CHECK-LD-GENTOO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/x32"
+// CHECK-LD-GENTOO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/lib"
+// CHECK-LD-GENTOO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../.."
+// CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// CHECK-LD-GENTOO-X32: "-lc"
+// CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
--
2.11.0

View File

@@ -1,25 +0,0 @@
From 8bd62a681744d3c31a0837c0f84f99ea4987e017 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Tue, 9 Jun 2015 12:17:57 +0200
Subject: [PATCH] cmake: Install compiler-rt into /usr/lib (without suffix)
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0d8a880..5ae98a9 100644
--- a/projects/compiler-rt/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

View File

@@ -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)

View File

@@ -1,73 +0,0 @@
From 7422ff662be0daeb3931fde397f1fed8ff86c50d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
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

View File

@@ -16,7 +16,8 @@ SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
!doc? ( http://dev.gentoo.org/~mgorny/dist/${PN}-3.9.0_rc3-manpages.tar.bz2 )"
!doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/${PN}-3.9.0_rc3-manpages.tar.bz2 )
https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.xz"
# Keep in sync with CMakeLists.txt
ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Mips MSP430
@@ -165,35 +166,35 @@ src_prepare() {
python_setup
# Fix libdir for ocaml bindings install, bug #559134
eapply "${FILESDIR}"/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
eapply "${WORKDIR}/${P}-patchset"/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.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
eapply "${WORKDIR}/${P}-patchset"/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.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
eapply "${WORKDIR}/${P}-patchset"/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.1/0004-cmake-Use-separate-doctrees-to-prevent-races-between.patch
eapply "${WORKDIR}/${P}-patchset"/0004-cmake-Use-separate-doctrees-to-prevent-races-between.patch
# Allow custom cmake build types (like 'Gentoo')
eapply "${FILESDIR}"/3.9.1/0006-cmake-Remove-the-CMAKE_BUILD_TYPE-assertion.patch
eapply "${WORKDIR}/${P}-patchset"/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.1/llvm-config-r1.patch
eapply "${WORKDIR}/${P}-patchset"/llvm-config-r1.patch
# Restore SOVERSIONs for shared libraries
# https://bugs.gentoo.org/show_bug.cgi?id=578392
eapply "${FILESDIR}"/3.9.1/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch
eapply "${WORKDIR}/${P}-patchset"/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch
# Revert commit breaking AMDGPU
# https://bugs.gentoo.org/show_bug.cgi?id=603858
eapply "${FILESDIR}"/3.9.1/0009-Revert-AMDGPU-Fix-an-interaction-between-WQM-and-pol.patch
eapply "${WORKDIR}/${P}-patchset"/0009-Revert-AMDGPU-Fix-an-interaction-between-WQM-and-pol.patch
# support building llvm against musl-libc
use elibc_musl && eapply "${FILESDIR}"/9999/musl-fixes.patch
use elibc_musl && eapply "${WORKDIR}/${P}-patchset"/musl-fixes.patch
# disable use of SDK on OSX, bug #568758
sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
@@ -203,16 +204,16 @@ src_prepare() {
if use clang; then
# Automatically select active system GCC's libraries, bugs #406163 and #417913
eapply "${FILESDIR}"/3.9.1/clang/gcc-config.patch
eapply "${WORKDIR}/${P}-patchset"/clang/gcc-config.patch
eapply "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch
eapply "${WORKDIR}/${P}-patchset"/clang/darwin_prefix-include-paths.patch
eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
eapply "${FILESDIR}"/3.8.1/compiler-rt/darwin-default-sysroot.patch
eapply "${WORKDIR}/${P}-patchset"/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.1/clang/default-libs.patch
eapply "${WORKDIR}/${P}-patchset"/clang/default-libs.patch
popd >/dev/null || die
sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
@@ -220,13 +221,13 @@ src_prepare() {
# Install clang runtime into /usr/lib/clang
# https://llvm.org/bugs/show_bug.cgi?id=23792
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
eapply "${WORKDIR}/${P}-patchset"/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
eapply "${WORKDIR}/${P}-patchset"/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.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
eapply "${WORKDIR}/${P}-patchset"/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
@@ -247,7 +248,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.1/lldb/six.patch
eapply "${WORKDIR}/${P}-patchset"/lldb/six.patch
fi
# User patches