internal/rosa/llvm: add rosa vendor
All checks were successful
Test / Create distribution (push) Successful in 1m8s
Test / Sandbox (push) Successful in 2m52s
Test / Hakurei (push) Successful in 4m37s
Test / ShareFS (push) Successful in 4m41s
Test / Hpkg (push) Successful in 5m26s
Test / Sandbox (race detector) (push) Successful in 5m32s
Test / Hakurei (race detector) (push) Successful in 6m32s
Test / Flake checks (push) Successful in 1m39s
All checks were successful
Test / Create distribution (push) Successful in 1m8s
Test / Sandbox (push) Successful in 2m52s
Test / Hakurei (push) Successful in 4m37s
Test / ShareFS (push) Successful in 4m41s
Test / Hpkg (push) Successful in 5m26s
Test / Sandbox (race detector) (push) Successful in 5m32s
Test / Hakurei (race detector) (push) Successful in 6m32s
Test / Flake checks (push) Successful in 1m39s
This cleans up checks specific to Rosa OS, and fixes stack overflow in llvm under certain conditions. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -15,15 +15,12 @@ func (t Toolchain) newGoBootstrap() pkg.Artifact {
|
||||
}, nil, []string{
|
||||
"CGO_ENABLED=0",
|
||||
}, `
|
||||
mkdir -p /var/tmp
|
||||
cp -r /usr/src/go /work
|
||||
cd /work/go/src
|
||||
mkdir -p /var/tmp/ /work/system/
|
||||
cp -r /usr/src/go /work/system/
|
||||
cd /work/system/go/src
|
||||
chmod -R +w ..
|
||||
|
||||
./make.bash
|
||||
cd /work/
|
||||
mkdir system/
|
||||
mv go/ system/
|
||||
`, pkg.Path(AbsUsrSrc.Append("go"), false, pkg.NewHTTPGetTar(
|
||||
nil, "https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz",
|
||||
mustDecode(checksum),
|
||||
|
||||
@@ -322,6 +322,40 @@ ninja check-all
|
||||
`,
|
||||
|
||||
patches: [][2]string{
|
||||
{"add-rosa-vendor", `diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
|
||||
index 657f4230379e..12c305756184 100644
|
||||
--- a/llvm/include/llvm/TargetParser/Triple.h
|
||||
+++ b/llvm/include/llvm/TargetParser/Triple.h
|
||||
@@ -185,6 +185,7 @@ public:
|
||||
|
||||
Apple,
|
||||
PC,
|
||||
+ Rosa,
|
||||
SCEI,
|
||||
Freescale,
|
||||
IBM,
|
||||
diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
|
||||
index 0584c941d2e6..e4d6ef963cc7 100644
|
||||
--- a/llvm/lib/TargetParser/Triple.cpp
|
||||
+++ b/llvm/lib/TargetParser/Triple.cpp
|
||||
@@ -269,6 +269,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
|
||||
case NVIDIA: return "nvidia";
|
||||
case OpenEmbedded: return "oe";
|
||||
case PC: return "pc";
|
||||
+ case Rosa: return "rosa";
|
||||
case SCEI: return "scei";
|
||||
case SUSE: return "suse";
|
||||
}
|
||||
@@ -669,6 +670,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
|
||||
.Case("suse", Triple::SUSE)
|
||||
.Case("oe", Triple::OpenEmbedded)
|
||||
.Case("intel", Triple::Intel)
|
||||
+ .Case("rosa", Triple::Rosa)
|
||||
.Default(Triple::UnknownVendor);
|
||||
}
|
||||
|
||||
`},
|
||||
|
||||
{"xfail-broken-tests", `diff --git a/clang/test/Modules/timestamps.c b/clang/test/Modules/timestamps.c
|
||||
index 50fdce630255..4b4465a75617 100644
|
||||
--- a/clang/test/Modules/timestamps.c
|
||||
@@ -362,16 +396,14 @@ index cdbf21fb9026..dd052858700d 100644
|
||||
`},
|
||||
|
||||
{"path-system-libraries", `diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
|
||||
index 8d3775de9be5..1e126e2d6f24 100644
|
||||
index 8d3775de9be5..5200b2a4d37d 100644
|
||||
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
|
||||
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
|
||||
@@ -463,6 +463,15 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs,
|
||||
@@ -463,6 +463,13 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs,
|
||||
if (!TC.isCrossCompiling())
|
||||
addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH");
|
||||
|
||||
+ const std::string RosaSuffix = "-rosa-linux-musl";
|
||||
+ if (TC.getTripleString().size() > RosaSuffix.size() &&
|
||||
+ std::equal(RosaSuffix.rbegin(), RosaSuffix.rend(), TC.getTripleString().rbegin())) {
|
||||
+ if (TC.getTriple().getVendor() == llvm::Triple::Rosa) {
|
||||
+ CmdArgs.push_back("-rpath");
|
||||
+ CmdArgs.push_back("/system/lib");
|
||||
+ CmdArgs.push_back("-rpath");
|
||||
@@ -382,7 +414,7 @@ index 8d3775de9be5..1e126e2d6f24 100644
|
||||
// If the current tool chain refers to an OpenMP offloading host, we
|
||||
// should ignore inputs that refer to OpenMP offloading devices -
|
||||
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
|
||||
index 8ac8d4eb9181..795995bb53cb 100644
|
||||
index 8ac8d4eb9181..7d2d8541aca9 100644
|
||||
--- a/clang/lib/Driver/ToolChains/Linux.cpp
|
||||
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
|
||||
@@ -324,6 +324,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
|
||||
@@ -414,13 +446,11 @@ index 8ac8d4eb9181..795995bb53cb 100644
|
||||
}
|
||||
|
||||
ToolChain::RuntimeLibType Linux::GetDefaultRuntimeLibType() const {
|
||||
@@ -457,6 +462,11 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
|
||||
@@ -457,6 +462,9 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
|
||||
return Triple.isArch64Bit() ? "/system/bin/linker64" : "/system/bin/linker";
|
||||
}
|
||||
if (Triple.isMusl()) {
|
||||
+ const std::string RosaSuffix = "-rosa-linux-musl";
|
||||
+ if (Triple.str().size() > RosaSuffix.size() &&
|
||||
+ std::equal(RosaSuffix.rbegin(), RosaSuffix.rend(), Triple.str().rbegin()))
|
||||
+ if (Triple.getVendor() == llvm::Triple::Rosa)
|
||||
+ return "/system/bin/linker";
|
||||
+
|
||||
std::string ArchName;
|
||||
|
||||
Reference in New Issue
Block a user