llvm11: remove clang parts

This commit is contained in:
q66 2021-05-16 03:22:47 +02:00
parent d1e5ce48dc
commit 0d9f8330b5
9 changed files with 2 additions and 1306 deletions

View file

@ -1,44 +0,0 @@
From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Tue, 8 Sep 2015 22:14:57 +0200
Subject: [PATCH 2/7] fix unwind chain inclusion
---
lib/Headers/unwind.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
index 303d792..44e10cc 100644
--- a/lib/Headers/unwind.h
+++ b/lib/Headers/unwind.h
@@ -9,9 +9,6 @@
/* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
-#ifndef __CLANG_UNWIND_H
-#define __CLANG_UNWIND_H
-
#if defined(__APPLE__) && __has_include_next(<unwind.h>)
/* Darwin (from 11.x on) provide an unwind.h. If that's available,
* use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
@@ -39,6 +36,9 @@
# endif
#else
+#ifndef __CLANG_UNWIND_H
+#define __CLANG_UNWIND_H
+
#include <stdint.h>
#ifdef __cplusplus
@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
}
#endif
+#endif /* __CLANG_UNWIND_H */
+
#endif
-#endif /* __CLANG_UNWIND_H */
--
2.5.1

View file

@ -1,546 +0,0 @@
From 84ec75000ec5bd35f8be3245c8fd6b78aabbd63c Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Thu, 17 Dec 2020 03:43:25 +0100
Subject: [PATCH] ppcle suppport
based on https://reviews.llvm.org/D92445
---
lib/Basic/Targets.cpp | 10 +++++++++
lib/Basic/Targets/OSTargets.h | 2 ++
lib/Basic/Targets/PPC.cpp | 3 ++-
lib/Basic/Targets/PPC.h | 2 ++
lib/CodeGen/CGBuiltin.cpp | 1 +
lib/CodeGen/CodeGenModule.cpp | 4 +---
lib/CodeGen/TargetInfo.cpp | 9 +++++++-
lib/Driver/Driver.cpp | 4 +---
lib/Driver/ToolChain.cpp | 2 ++
lib/Driver/ToolChains/Clang.cpp | 9 ++++++--
lib/Driver/ToolChains/CommonArgs.cpp | 1 +
lib/Driver/ToolChains/FreeBSD.cpp | 8 ++++++-
lib/Driver/ToolChains/Gnu.cpp | 25 +++++++++++++++++++++
lib/Driver/ToolChains/Linux.cpp | 13 +++++++++--
lib/Frontend/CompilerInvocation.cpp | 1 +
lib/Sema/SemaChecking.cpp | 1 +
test/CodeGen/altivec.c | 15 ++++++++-----
test/CodeGen/builtins-ppc-altivec.c | 2 ++
test/CodeGen/ppc32-and-aix-struct-return.c | 6 +++++
test/CodeGen/target-data.c | 4 ++++
test/Driver/ppc-endian.c | 26 +++++++++++++++-------
21 files changed, 122 insertions(+), 26 deletions(-)
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 965f2738..d8ff000a 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -334,6 +334,16 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple,
return new PPC32TargetInfo(Triple, Opts);
}
+ case llvm::Triple::ppcle:
+ switch (os) {
+ case llvm::Triple::Linux:
+ return new LinuxTargetInfo<PPC32TargetInfo>(Triple, Opts);
+ case llvm::Triple::FreeBSD:
+ return new FreeBSDTargetInfo<PPC32TargetInfo>(Triple, Opts);
+ default:
+ return new PPC32TargetInfo(Triple, Opts);
+ }
+
case llvm::Triple::ppc64:
if (Triple.isOSDarwin())
return new DarwinPPC64TargetInfo(Triple, Opts);
diff --git a/lib/Basic/Targets/OSTargets.h b/lib/Basic/Targets/OSTargets.h
index 2a9e4f91..39e3b537 100644
--- a/lib/Basic/Targets/OSTargets.h
+++ b/lib/Basic/Targets/OSTargets.h
@@ -252,6 +252,7 @@ public:
case llvm::Triple::mips:
case llvm::Triple::mipsel:
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
this->MCountName = "_mcount";
@@ -408,6 +409,7 @@ public:
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
this->MCountName = "_mcount";
diff --git a/lib/Basic/Targets/PPC.cpp b/lib/Basic/Targets/PPC.cpp
index f0de2bf0..42f30a2f 100644
--- a/lib/Basic/Targets/PPC.cpp
+++ b/lib/Basic/Targets/PPC.cpp
@@ -90,7 +90,8 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
}
// Target properties.
- if (getTriple().getArch() == llvm::Triple::ppc64le) {
+ if (getTriple().getArch() == llvm::Triple::ppc64le ||
+ getTriple().getArch() == llvm::Triple::ppcle) {
Builder.defineMacro("_LITTLE_ENDIAN");
} else {
if (!getTriple().isOSNetBSD() &&
diff --git a/lib/Basic/Targets/PPC.h b/lib/Basic/Targets/PPC.h
index bda6cb7d..d6d8c9a3 100644
--- a/lib/Basic/Targets/PPC.h
+++ b/lib/Basic/Targets/PPC.h
@@ -355,6 +355,8 @@ public:
: PPCTargetInfo(Triple, Opts) {
if (Triple.isOSAIX())
resetDataLayout("E-m:a-p:32:32-i64:64-n32");
+ else if ((Triple.getArch() == llvm::Triple::ppcle))
+ resetDataLayout("e-m:e-p:32:32-i64:64-n32");
else
resetDataLayout("E-m:e-p:32:32-i64:64-n32");
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index 8994b939..4a4b1744 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -4523,6 +4523,7 @@ static Value *EmitTargetArchBuiltinExpr(CodeGenFunction *CGF,
case llvm::Triple::x86_64:
return CGF->EmitX86BuiltinExpr(BuiltinID, E);
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
return CGF->EmitPPCBuiltinExpr(BuiltinID, E);
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 4ae8ce7e..cbf7da1a 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -890,9 +890,7 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
return false;
// PPC has no copy relocations and cannot use a plt entry as a symbol address.
- llvm::Triple::ArchType Arch = TT.getArch();
- if (Arch == llvm::Triple::ppc || Arch == llvm::Triple::ppc64 ||
- Arch == llvm::Triple::ppc64le)
+ if (TT.isPPC())
return false;
// If we can use copy relocations we can assume it is local.
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 9cd63ebe..0434eb6a 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -4838,7 +4838,7 @@ Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAList,
bool PPC32TargetCodeGenInfo::isStructReturnInRegABI(
const llvm::Triple &Triple, const CodeGenOptions &Opts) {
- assert(Triple.getArch() == llvm::Triple::ppc);
+ assert(Triple.isPPC32());
switch (Opts.getStructReturnConvention()) {
case CodeGenOptions::SRCK_Default:
@@ -10874,6 +10874,13 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
return SetCGInfo(
new PPC32TargetCodeGenInfo(Types, IsSoftFloat, RetSmallStructInRegABI));
}
+ case llvm::Triple::ppcle: {
+ bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ bool RetSmallStructInRegABI =
+ PPC32TargetCodeGenInfo::isStructReturnInRegABI(Triple, CodeGenOpts);
+ return SetCGInfo(
+ new PPC32TargetCodeGenInfo(Types, IsSoftFloat, RetSmallStructInRegABI));
+ }
case llvm::Triple::ppc64:
if (Triple.isOSAIX())
return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index ece8222d..9b96d03c 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -4931,9 +4931,7 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
!Target.hasEnvironment())
TC = std::make_unique<toolchains::MipsLLVMToolChain>(*this, Target,
Args);
- else if (Target.getArch() == llvm::Triple::ppc ||
- Target.getArch() == llvm::Triple::ppc64 ||
- Target.getArch() == llvm::Triple::ppc64le)
+ else if (Target.isPPC())
TC = std::make_unique<toolchains::PPCLinuxToolChain>(*this, Target,
Args);
else if (Target.getArch() == llvm::Triple::ve)
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
index b8c12fc9..9507693b 100644
--- a/lib/Driver/ToolChain.cpp
+++ b/lib/Driver/ToolChain.cpp
@@ -238,6 +238,8 @@ StringRef ToolChain::getDefaultUniversalArchName() const {
return "arm64_32";
case llvm::Triple::ppc:
return "ppc";
+ case llvm::Triple::ppcle:
+ return "ppc";
case llvm::Triple::ppc64:
return "ppc64";
case llvm::Triple::ppc64le:
diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp
index af4bcf95..3ee31620 100644
--- a/lib/Driver/ToolChains/Clang.cpp
+++ b/lib/Driver/ToolChains/Clang.cpp
@@ -331,6 +331,7 @@ static void getTargetFeatures(const Driver &D, const llvm::Triple &Triple,
break;
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
ppc::getPPCTargetFeatures(D, Triple, Args, Features);
@@ -527,6 +528,7 @@ static bool useFramePointerForTargetByDefault(const ArgList &Args,
// WebAssembly never wants frame pointers.
return false;
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
case llvm::Triple::riscv32:
@@ -1370,6 +1372,7 @@ static bool isSignedCharDefault(const llvm::Triple &Triple) {
return false;
case llvm::Triple::hexagon:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64le:
case llvm::Triple::riscv32:
case llvm::Triple::riscv64:
@@ -1586,6 +1589,7 @@ void Clang::RenderTargetOptions(const llvm::Triple &EffectiveTriple,
break;
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
AddPPCTargetArgs(Args, CmdArgs);
@@ -4508,7 +4512,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (Arg *A = Args.getLastArg(options::OPT_maix_struct_return,
options::OPT_msvr4_struct_return)) {
- if (TC.getArch() != llvm::Triple::ppc) {
+ if ((TC.getArch() != llvm::Triple::ppc) &&
+ (TC.getArch() != llvm::Triple::ppcle)) {
D.Diag(diag::err_drv_unsupported_opt_for_target)
<< A->getSpelling() << RawTriple.str();
} else if (A->getOption().matches(options::OPT_maix_struct_return)) {
@@ -4621,7 +4626,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (Arg *A = Args.getLastArg(options::OPT_LongDouble_Group)) {
if (TC.getTriple().isX86())
A->render(Args, CmdArgs);
- else if ((TC.getArch() == llvm::Triple::ppc || TC.getTriple().isPPC64()) &&
+ else if (TC.getTriple().isPPC() &&
(A->getOption().getID() != options::OPT_mlong_double_80))
A->render(Args, CmdArgs);
else
diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp
index 6b6e276b..8b63dce7 100644
--- a/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/lib/Driver/ToolChains/CommonArgs.cpp
@@ -313,6 +313,7 @@ std::string tools::getCPUName(const ArgList &Args, const llvm::Triple &T,
return "";
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le: {
std::string TargetCPUName = ppc::getPPCTargetCPU(Args);
diff --git a/lib/Driver/ToolChains/FreeBSD.cpp b/lib/Driver/ToolChains/FreeBSD.cpp
index 909ac5e9..6ec8e807 100644
--- a/lib/Driver/ToolChains/FreeBSD.cpp
+++ b/lib/Driver/ToolChains/FreeBSD.cpp
@@ -42,6 +42,7 @@ void freebsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("--32");
break;
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
CmdArgs.push_back("-a32");
break;
case llvm::Triple::mips:
@@ -191,6 +192,11 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-m");
CmdArgs.push_back("elf32ppc_fbsd");
break;
+ case llvm::Triple::ppcle:
+ CmdArgs.push_back("-m");
+ // Use generic -- only usage is for freestanding.
+ CmdArgs.push_back("elf32lppc");
+ break;
case llvm::Triple::mips:
CmdArgs.push_back("-m");
CmdArgs.push_back("elf32btsmip_fbsd");
@@ -372,7 +378,7 @@ FreeBSD::FreeBSD(const Driver &D, const llvm::Triple &Triple,
// When targeting 32-bit platforms, look for '/usr/lib32/crt1.o' and fall
// back to '/usr/lib' if it doesn't exist.
if ((Triple.getArch() == llvm::Triple::x86 || Triple.isMIPS32() ||
- Triple.getArch() == llvm::Triple::ppc) &&
+ Triple.isPPC32()) &&
D.getVFS().exists(getDriver().SysRoot + "/usr/lib32/crt1.o"))
getFilePaths().push_back(getDriver().SysRoot + "/usr/lib32");
else
diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
index c8a7fce0..38830c4f 100644
--- a/lib/Driver/ToolChains/Gnu.cpp
+++ b/lib/Driver/ToolChains/Gnu.cpp
@@ -116,6 +116,7 @@ void tools::gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
break;
case llvm::Triple::x86:
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
CmdArgs.push_back("-m32");
break;
case llvm::Triple::x86_64:
@@ -271,6 +272,8 @@ static const char *getLDMOption(const llvm::Triple &T, const ArgList &Args) {
return isArmBigEndian(T, Args) ? "armelfb_linux_eabi" : "armelf_linux_eabi";
case llvm::Triple::ppc:
return "elf32ppclinux";
+ case llvm::Triple::ppcle:
+ return "elf32lppclinux";
case llvm::Triple::ppc64:
return "elf64ppc";
case llvm::Triple::ppc64le:
@@ -736,6 +739,14 @@ void tools::gnutools::Assembler::ConstructJob(Compilation &C,
ppc::getPPCAsmModeForCPU(getCPUName(Args, getToolChain().getTriple())));
break;
}
+ case llvm::Triple::ppcle: {
+ CmdArgs.push_back("-a32");
+ CmdArgs.push_back("-mppc");
+ CmdArgs.push_back("-mlittle-endian");
+ CmdArgs.push_back(
+ ppc::getPPCAsmModeForCPU(getCPUName(Args, getToolChain().getTriple())));
+ break;
+ }
case llvm::Triple::ppc64: {
CmdArgs.push_back("-a64");
CmdArgs.push_back("-mppc64");
@@ -2125,6 +2136,11 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
// On 32-bit PowerPC systems running SUSE Linux, gcc is configured as a
// 64-bit compiler which defaults to "-m32", hence "powerpc64-suse-linux".
"powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+ // PPCLE is only used in niche situations such as bootloaders
+ // and compatibility shims.
+ static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+ static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+ "powerpcle-unknown-linux-gnu"};
static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
static const char *const PPC64Triples[] = {
"powerpc64-linux-gnu", "powerpc64-unknown-linux-gnu",
@@ -2365,6 +2381,12 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
BiarchTripleAliases.append(begin(PPC64Triples), end(PPC64Triples));
break;
+ case llvm::Triple::ppcle:
+ LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
+ TripleAliases.append(begin(PPCLETriples), end(PPCLETriples));
+ BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
+ BiarchTripleAliases.append(begin(PPC64LETriples), end(PPC64LETriples));
+ break;
case llvm::Triple::ppc64:
LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
TripleAliases.append(begin(PPC64Triples), end(PPC64Triples));
@@ -2374,6 +2396,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
case llvm::Triple::ppc64le:
LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
TripleAliases.append(begin(PPC64LETriples), end(PPC64LETriples));
+ BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
+ BiarchTripleAliases.append(begin(PPCLETriples), end(PPCLETriples));
break;
case llvm::Triple::riscv32:
LibDirs.append(begin(RISCV32LibDirs), end(RISCV32LibDirs));
@@ -2697,6 +2721,7 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const {
case llvm::Triple::thumb:
case llvm::Triple::thumbeb:
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
case llvm::Triple::riscv32:
diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
index 18035047..765a3ec2 100644
--- a/lib/Driver/ToolChains/Linux.cpp
+++ b/lib/Driver/ToolChains/Linux.cpp
@@ -142,6 +142,10 @@ std::string Linux::getMultiarchTriple(const Driver &D,
if (D.getVFS().exists(SysRoot + "/lib/powerpc-linux-gnu"))
return "powerpc-linux-gnu";
break;
+ case llvm::Triple::ppcle:
+ if (D.getVFS().exists(SysRoot + "/lib/powerpcle-linux-gnu"))
+ return "powerpcle-linux-gnu";
+ break;
case llvm::Triple::ppc64:
if (D.getVFS().exists(SysRoot + "/lib/powerpc64-linux-gnu"))
return "powerpc64-linux-gnu";
@@ -194,8 +198,7 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) {
// FIXME: This is a bit of a hack. We should really unify this code for
// reasoning about oslibdir spellings with the lib dir spellings in the
// GCCInstallationDetector, but that is a more significant refactoring.
- if (Triple.getArch() == llvm::Triple::x86 ||
- Triple.getArch() == llvm::Triple::ppc)
+ if (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32())
return "lib32";
if (Triple.getArch() == llvm::Triple::x86_64 &&
@@ -492,6 +495,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
break;
}
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
LibDir = "lib";
Loader = "ld.so.1";
break;
@@ -642,6 +646,8 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
const StringRef PPCMultiarchIncludeDirs[] = {
"/usr/include/powerpc-linux-gnu",
"/usr/include/powerpc-linux-gnuspe"};
+ const StringRef PPCLEMultiarchIncludeDirs[] = {
+ "/usr/include/powerpcle-linux-gnu"};
const StringRef PPC64MultiarchIncludeDirs[] = {
"/usr/include/powerpc64-linux-gnu"};
const StringRef PPC64LEMultiarchIncludeDirs[] = {
@@ -715,6 +721,9 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
case llvm::Triple::ppc:
MultiarchIncludeDirs = PPCMultiarchIncludeDirs;
break;
+ case llvm::Triple::ppcle:
+ MultiarchIncludeDirs = PPCLEMultiarchIncludeDirs;
+ break;
case llvm::Triple::ppc64:
MultiarchIncludeDirs = PPC64MultiarchIncludeDirs;
break;
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 73114c6d..a577e6dc 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -3169,6 +3169,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
if (TT.getArch() == llvm::Triple::UnknownArch ||
!(TT.getArch() == llvm::Triple::aarch64 ||
TT.getArch() == llvm::Triple::ppc ||
+ TT.getArch() == llvm::Triple::ppcle ||
TT.getArch() == llvm::Triple::ppc64 ||
TT.getArch() == llvm::Triple::ppc64le ||
TT.getArch() == llvm::Triple::nvptx ||
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index b00d2ff5..40f39654 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -1425,6 +1425,7 @@ bool Sema::CheckTSBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
case llvm::Triple::x86_64:
return CheckX86BuiltinFunctionCall(TI, BuiltinID, TheCall);
case llvm::Triple::ppc:
+ case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
return CheckPPCBuiltinFunctionCall(TI, BuiltinID, TheCall);
diff --git a/test/CodeGen/altivec.c b/test/CodeGen/altivec.c
index a4d38fa2..7af963aa 100644
--- a/test/CodeGen/altivec.c
+++ b/test/CodeGen/altivec.c
@@ -1,17 +1,22 @@
-// RUN: %clang_cc1 -target-feature +altivec -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -target-feature +altivec -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE
+// RUN: %clang_cc1 -target-feature +altivec -triple powerpcle-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-LE
// Check initialization
vector int test0 = (vector int)(1); // CHECK: @test0 = global <4 x i32> <i32 1, i32 1, i32 1, i32 1>
vector float test1 = (vector float)(1.0); // CHECK: @test1 = global <4 x float> <float 1.000000e+{{0+}}, float 1.000000e+{{0+}}, float 1.000000e+{{0+}}, float 1.000000e+{{0+}}>
-// CHECK: @v1 = global <16 x i8> <i8 0, i8 0, i8 0, i8 1, i8 0, i8 0, i8 0, i8 2, i8 0, i8 0, i8 0, i8 3, i8 0, i8 0, i8 0, i8 4>
+// CHECK-BE: @v1 = global <16 x i8> <i8 0, i8 0, i8 0, i8 1, i8 0, i8 0, i8 0, i8 2, i8 0, i8 0, i8 0, i8 3, i8 0, i8 0, i8 0, i8 4>
+// CHECK-LE: @v1 = global <16 x i8> <i8 1, i8 0, i8 0, i8 0, i8 2, i8 0, i8 0, i8 0, i8 3, i8 0, i8 0, i8 0, i8 4, i8 0, i8 0, i8 0>
vector char v1 = (vector char)((vector int)(1, 2, 3, 4));
-// CHECK: @v2 = global <16 x i8> <i8 63, i8 -128, i8 0, i8 0, i8 64, i8 0, i8 0, i8 0, i8 64, i8 64, i8 0, i8 0, i8 64, i8 -128, i8 0, i8 0>
+// CHECK-BE: @v2 = global <16 x i8> <i8 63, i8 -128, i8 0, i8 0, i8 64, i8 0, i8 0, i8 0, i8 64, i8 64, i8 0, i8 0, i8 64, i8 -128, i8 0, i8 0>
+// CHECK-LE: @v2 = global <16 x i8> <i8 0, i8 0, i8 -128, i8 63, i8 0, i8 0, i8 0, i8 64, i8 0, i8 0, i8 64, i8 64, i8 0, i8 0, i8 -128, i8 64>
vector char v2 = (vector char)((vector float)(1.0f, 2.0f, 3.0f, 4.0f));
-// CHECK: @v3 = global <16 x i8> <i8 0, i8 0, i8 0, i8 97, i8 0, i8 0, i8 0, i8 98, i8 0, i8 0, i8 0, i8 99, i8 0, i8 0, i8 0, i8 100>
+// CHECK-BE: @v3 = global <16 x i8> <i8 0, i8 0, i8 0, i8 97, i8 0, i8 0, i8 0, i8 98, i8 0, i8 0, i8 0, i8 99, i8 0, i8 0, i8 0, i8 100>
+// CHECK-LE: @v3 = global <16 x i8> <i8 97, i8 0, i8 0, i8 0, i8 98, i8 0, i8 0, i8 0, i8 99, i8 0, i8 0, i8 0, i8 100, i8 0, i8 0, i8 0>
vector char v3 = (vector char)((vector int)('a', 'b', 'c', 'd'));
-// CHECK: @v4 = global <4 x i32> <i32 16909060, i32 0, i32 0, i32 0>
+// CHECK-BE: @v4 = global <4 x i32> <i32 16909060, i32 0, i32 0, i32 0>
+// CHECK-LE: @v4 = global <4 x i32> <i32 67305985, i32 0, i32 0, i32 0>
vector int v4 = (vector char){1, 2, 3, 4};
void test2()
diff --git a/test/CodeGen/builtins-ppc-altivec.c b/test/CodeGen/builtins-ppc-altivec.c
index 06f70a90..b29dc18a 100644
--- a/test/CodeGen/builtins-ppc-altivec.c
+++ b/test/CodeGen/builtins-ppc-altivec.c
@@ -1,6 +1,8 @@
// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -target-feature +altivec -triple powerpc-unknown-unknown -emit-llvm %s \
// RUN: -flax-vector-conversions=none -o - | FileCheck %s
+// RUN: %clang_cc1 -target-feature +altivec -triple powerpcle-unknown-unknown -emit-llvm %s \
+// RUN: -flax-vector-conversions=none -o - | FileCheck %s -check-prefix=CHECK-LE
// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64-unknown-unknown -emit-llvm %s \
// RUN: -flax-vector-conversions=none -o - | FileCheck %s
// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64le-unknown-unknown -emit-llvm %s \
diff --git a/test/CodeGen/ppc32-and-aix-struct-return.c b/test/CodeGen/ppc32-and-aix-struct-return.c
index 1e0fb928..41418a20 100644
--- a/test/CodeGen/ppc32-and-aix-struct-return.c
+++ b/test/CodeGen/ppc32-and-aix-struct-return.c
@@ -11,6 +11,12 @@
// RUN: -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-AIX
// RUN: %clang_cc1 -triple powerpc-unknown-linux -msvr4-struct-return \
// RUN: -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-SVR4
+// RUN: %clang_cc1 -triple powerpcle-unknown-linux \
+// RUN: -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-AIX
+// RUN: %clang_cc1 -triple powerpcle-unknown-linux -maix-struct-return \
+// RUN: -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-AIX
+// RUN: %clang_cc1 -triple powerpcle-unknown-linux -msvr4-struct-return \
+// RUN: -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-SVR4
// RUN: %clang_cc1 -triple powerpc-unknown-netbsd \
// RUN: -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-SVR4
// RUN: %clang_cc1 -triple powerpc-unknown-openbsd \
diff --git a/test/CodeGen/target-data.c b/test/CodeGen/target-data.c
index 8c740119..239d0184 100644
--- a/test/CodeGen/target-data.c
+++ b/test/CodeGen/target-data.c
@@ -122,6 +122,10 @@
// RUN: FileCheck %s -check-prefix=PPC
// PPC: target datalayout = "E-m:e-p:32:32-i64:64-n32"
+// RUN: %clang_cc1 -triple powerpcle-unknown -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=PPCLE
+// PPCLE: target datalayout = "e-m:e-p:32:32-i64:64-n32"
+
// RUN: %clang_cc1 -triple powerpc64-freebsd -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=PPC64-FREEBSD
// PPC64-FREEBSD: target datalayout = "E-m:e-i64:64-n32:64"
diff --git a/test/Driver/ppc-endian.c b/test/Driver/ppc-endian.c
index 4d8db389..00c1c25b 100644
--- a/test/Driver/ppc-endian.c
+++ b/test/Driver/ppc-endian.c
@@ -1,9 +1,19 @@
-// RUN: %clang -target powerpc64le -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-LE %s
-// RUN: %clang -target powerpc64le -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-LE %s
-// RUN: %clang -target powerpc64 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-LE %s
-// CHECK-LE: "-cc1"{{.*}} "-triple" "powerpc64le{{.*}}"
+// RUN: %clang -target powerpc-unknown -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE32 %s
+// RUN: %clang -target powerpc-unknown -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE32 %s
+// RUN: %clang -target powerpcle-unknown -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE32 %s
+// CHECK-BE32: "-cc1"{{.*}} "-triple" "powerpc-{{.*}}"
-// RUN: %clang -target powerpc64 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE %s
-// RUN: %clang -target powerpc64 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE %s
-// RUN: %clang -target powerpc64le -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE %s
-// CHECK-BE: "-cc1"{{.*}} "-triple" "powerpc64{{.*}}"
+// RUN: %clang -target powerpcle-unknown -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-LE32 %s
+// RUN: %clang -target powerpcle-unknown -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-LE32 %s
+// RUN: %clang -target powerpc-unknown -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-LE32 %s
+// CHECK-LE32: "-cc1"{{.*}} "-triple" "powerpcle-{{.*}}"
+
+// RUN: %clang -target powerpc64-unknown -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE64 %s
+// RUN: %clang -target powerpc64-unknown -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE64 %s
+// RUN: %clang -target powerpc64le-unknown -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE64 %s
+// CHECK-BE64: "-cc1"{{.*}} "-triple" "powerpc64-{{.*}}"
+
+// RUN: %clang -target powerpc64le-unknown -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-LE64 %s
+// RUN: %clang -target powerpc64le-unknown -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-LE64 %s
+// RUN: %clang -target powerpc64-unknown -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-LE64 %s
+// CHECK-LE64: "-cc1"{{.*}} "-triple" "powerpc64le-{{.*}}"
--
2.29.2

View file

@ -1,100 +0,0 @@
--- a/lib/Driver/ToolChains/Gnu.cpp
+++ b/lib/Driver/ToolChains/Gnu.cpp
@@ -1938,7 +1938,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
"armv7hl-redhat-linux-gnueabi",
"armv6hl-suse-linux-gnueabi",
- "armv7hl-suse-linux-gnueabi"};
+ "armv7hl-suse-linux-gnueabi",
+ "armv7l-linux-gnueabihf"};
static const char *const ARMebLibDirs[] = {"/lib"};
static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
"armeb-linux-androideabi"};
@@ -2077,6 +2078,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
return;
}
+ if (TargetTriple.isMusl()) {
+ static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
+ static const char *const ARMHFMuslTriples[] = {
+ "arm-linux-musleabihf", "armv7l-linux-musleabihf"
+ };
+ static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
+ static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
+ static const char *const X86MuslTriples[] = {"i686-linux-musl"};
+ static const char *const MIPSMuslTriples[] = {
+ "mips-linux-musl", "mipsel-linux-musl",
+ "mipsel-linux-muslhf", "mips-linux-muslhf"
+ };
+ static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
+ static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
+ static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
+ static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
+
+ switch (TargetTriple.getArch()) {
+ case llvm::Triple::aarch64:
+ LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
+ TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
+ BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
+ BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
+ break;
+ case llvm::Triple::arm:
+ LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
+ if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
+ TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
+ } else {
+ TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
+ }
+ break;
+ case llvm::Triple::x86_64:
+ LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
+ TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
+ BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
+ BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
+ break;
+ case llvm::Triple::x86:
+ LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
+ TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
+ BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
+ BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
+ break;
+ case llvm::Triple::mips:
+ LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
+ TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
+ break;
+ case llvm::Triple::ppc:
+ LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
+ TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
+ BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
+ BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
+ break;
+ case llvm::Triple::ppcle:
+ LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
+ TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
+ BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
+ BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
+ break;
+ case llvm::Triple::ppc64:
+ LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
+ TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
+ BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
+ BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
+ break;
+ case llvm::Triple::ppc64le:
+ LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
+ TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
+ BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
+ BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
+ break;
+ default:
+ break;
+ }
+ TripleAliases.push_back(TargetTriple.str());
+ if (TargetTriple.str() != BiarchTriple.str())
+ BiarchTripleAliases.push_back(BiarchTriple.str());
+ return;
+ }
+
// Android targets should not use GNU/Linux tools or libraries.
if (TargetTriple.isAndroid()) {
static const char *const AArch64AndroidTriples[] = {

View file

@ -1,18 +0,0 @@
--- a/lib/Driver/ToolChains/Linux.cpp
+++ b/lib/Driver/ToolChains/Linux.cpp
@@ -593,12 +593,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
Loader = "ld.so.1";
break;
case llvm::Triple::ppc64:
- LibDir = "lib64";
+ LibDir = "lib";
Loader =
- (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+ (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
break;
case llvm::Triple::ppc64le:
- LibDir = "lib64";
+ LibDir = "lib";
Loader =
(tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
break;

View file

@ -1,30 +0,0 @@
--- a/lib/Basic/Targets/PPC.h
+++ b/lib/Basic/Targets/PPC.h
@@ -408,11 +408,10 @@
SuitableAlign = 64;
} else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
resetDataLayout("e-m:e-i64:64-n32:64");
- ABI = "elfv2";
} else {
resetDataLayout("E-m:e-i64:64-n32:64");
- ABI = "elfv1";
}
+ ABI = "elfv2";
if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() ||
Triple.getOS() == llvm::Triple::AIX || Triple.isMusl()) {
--- a/lib/Driver/ToolChains/Clang.cpp
+++ b/lib/Driver/ToolChains/Clang.cpp
@@ -1883,11 +1883,7 @@
ABIName = "elfv1-qpx";
break;
}
- if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
- T.isOSOpenBSD() || T.isMusl())
- ABIName = "elfv2";
- else
- ABIName = "elfv1";
+ ABIName = "elfv2";
break;
}
case llvm::Triple::ppc64le:

View file

@ -1,11 +0,0 @@
--- compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt
+++ compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt
@@ -428,8 +428,6 @@
)
set(arm_Thumb1_SOURCES
${arm_Thumb1_JT_SOURCES}
- ${arm_Thumb1_SjLj_EH_SOURCES}
- ${arm_Thumb1_VFPv2_SOURCES}
${arm_Thumb1_icache_SOURCES}
)

View file

@ -1,313 +0,0 @@
From c6347af7952635e21aaeca27c5ae6d81e29d9dbc Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Thu, 17 Dec 2020 03:20:31 +0100
Subject: [PATCH] ppcle support
based on https://reviews.llvm.org/D92445
---
ELF/Driver.cpp | 1 +
ELF/InputFiles.cpp | 1 +
ELF/ScriptParser.cpp | 1 +
test/ELF/emulation-ppc.s | 190 +++++++++++++++----------------------
test/ELF/ppc32-gnu-ifunc.s | 6 ++
test/ELF/ppc32-reloc-rel.s | 8 +-
6 files changed, 91 insertions(+), 116 deletions(-)
diff --git a/ELF/Driver.cpp b/ELF/Driver.cpp
index 4637a3b..d81b67c 100644
--- a/ELF/Driver.cpp
+++ b/ELF/Driver.cpp
@@ -142,6 +142,7 @@ static std::tuple<ELFKind, uint16_t, uint8_t> parseEmulation(StringRef emul) {
.Cases("elf32ltsmip", "elf32ltsmipn32", {ELF32LEKind, EM_MIPS})
.Case("elf32lriscv", {ELF32LEKind, EM_RISCV})
.Cases("elf32ppc", "elf32ppclinux", {ELF32BEKind, EM_PPC})
+ .Cases("elf32lppc", "elf32lppclinux", {ELF32LEKind, EM_PPC})
.Case("elf64btsmip", {ELF64BEKind, EM_MIPS})
.Case("elf64ltsmip", {ELF64LEKind, EM_MIPS})
.Case("elf64lriscv", {ELF64LEKind, EM_RISCV})
diff --git a/ELF/InputFiles.cpp b/ELF/InputFiles.cpp
index c2f1830..f83f028 100644
--- a/ELF/InputFiles.cpp
+++ b/ELF/InputFiles.cpp
@@ -1514,6 +1514,7 @@ static uint8_t getBitcodeMachineKind(StringRef path, const Triple &t) {
case Triple::msp430:
return EM_MSP430;
case Triple::ppc:
+ case Triple::ppcle:
return EM_PPC;
case Triple::ppc64:
case Triple::ppc64le:
diff --git a/ELF/ScriptParser.cpp b/ELF/ScriptParser.cpp
index fea6b7a..99b3e15 100644
--- a/ELF/ScriptParser.cpp
+++ b/ELF/ScriptParser.cpp
@@ -410,6 +410,7 @@ static std::pair<ELFKind, uint16_t> parseBfdName(StringRef s) {
.Case("elf64-aarch64", {ELF64LEKind, EM_AARCH64})
.Case("elf64-littleaarch64", {ELF64LEKind, EM_AARCH64})
.Case("elf32-powerpc", {ELF32BEKind, EM_PPC})
+ .Case("elf32-powerpcle", {ELF32LEKind, EM_PPC})
.Case("elf64-powerpc", {ELF64BEKind, EM_PPC64})
.Case("elf64-powerpcle", {ELF64LEKind, EM_PPC64})
.Case("elf64-x86-64", {ELF64LEKind, EM_X86_64})
diff --git a/test/ELF/emulation-ppc.s b/test/ELF/emulation-ppc.s
index def78a5..004eb23 100644
--- a/test/ELF/emulation-ppc.s
+++ b/test/ELF/emulation-ppc.s
@@ -1,144 +1,106 @@
# REQUIRES: ppc
# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %tppc64
# RUN: ld.lld -m elf64ppc %tppc64 -o %t2ppc64
-# RUN: llvm-readobj --file-headers %t2ppc64 | FileCheck --check-prefix=PPC64 %s
+# RUN: llvm-readobj --file-headers %t2ppc64 | FileCheck --check-prefixes=CHECK,PPC64,LINUX,PPCBE %s
# RUN: ld.lld %tppc64 -o %t3ppc64
-# RUN: llvm-readobj --file-headers %t3ppc64 | FileCheck --check-prefix=PPC64 %s
+# RUN: llvm-readobj --file-headers %t3ppc64 | FileCheck --check-prefixes=CHECK,PPC64,LINUX,PPCBE %s
# RUN: echo 'OUTPUT_FORMAT(elf64-powerpc)' > %tppc64.script
# RUN: ld.lld %tppc64.script %tppc64 -o %t4ppc64
-# RUN: llvm-readobj --file-headers %t4ppc64 | FileCheck --check-prefix=PPC64 %s
-
-# PPC64: ElfHeader {
-# PPC64-NEXT: Ident {
-# PPC64-NEXT: Magic: (7F 45 4C 46)
-# PPC64-NEXT: Class: 64-bit (0x2)
-# PPC64-NEXT: DataEncoding: BigEndian (0x2)
-# PPC64-NEXT: FileVersion: 1
-# PPC64-NEXT: OS/ABI: SystemV (0x0)
-# PPC64-NEXT: ABIVersion: 0
-# PPC64-NEXT: Unused: (00 00 00 00 00 00 00)
-# PPC64-NEXT: }
-# PPC64-NEXT: Type: Executable (0x2)
-# PPC64-NEXT: Machine: EM_PPC64 (0x15)
-# PPC64-NEXT: Version: 1
-# PPC64-NEXT: Entry:
-# PPC64-NEXT: ProgramHeaderOffset: 0x40
-# PPC64-NEXT: SectionHeaderOffset:
-# PPC64-NEXT: Flags [ (0x2)
-# PPC64-NEXT: 0x2
-# PPC64-NEXT: ]
-# PPC64-NEXT: HeaderSize: 64
-# PPC64-NEXT: ProgramHeaderEntrySize: 56
-# PPC64-NEXT: ProgramHeaderCount:
-# PPC64-NEXT: SectionHeaderEntrySize: 64
-# PPC64-NEXT: SectionHeaderCount:
-# PPC64-NEXT: StringTableSectionIndex:
-# PPC64-NEXT: }
-
-# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-freebsd %s -o %tppc64fbsd
-# RUN: echo 'OUTPUT_FORMAT(elf64-powerpc-freebsd)' > %tppc64fbsd.script
-# RUN: ld.lld %tppc64fbsd.script %tppc64fbsd -o %t2ppc64fbsd
-# RUN: llvm-readobj --file-headers %t2ppc64fbsd | FileCheck --check-prefix=PPC64-FBSD %s
-
-# PPC64-FBSD: ElfHeader {
-# PPC64-FBSD-NEXT: Ident {
-# PPC64-FBSD-NEXT: Magic: (7F 45 4C 46)
-# PPC64-FBSD-NEXT: Class: 64-bit (0x2)
-# PPC64-FBSD-NEXT: DataEncoding: BigEndian (0x2)
-# PPC64-FBSD-NEXT: FileVersion: 1
-# PPC64-FBSD-NEXT: OS/ABI: FreeBSD (0x9)
-# PPC64-FBSD-NEXT: ABIVersion: 0
-# PPC64-FBSD-NEXT: Unused: (00 00 00 00 00 00 00)
-# PPC64-FBSD-NEXT: }
-# PPC64-FBSD-NEXT: Type: Executable (0x2)
-# PPC64-FBSD-NEXT: Machine: EM_PPC64 (0x15)
-# PPC64-FBSD-NEXT: Version: 1
-# PPC64-FBSD-NEXT: Entry:
-# PPC64-FBSD-NEXT: ProgramHeaderOffset: 0x40
-# PPC64-FBSD-NEXT: SectionHeaderOffset:
-# PPC64-FBSD-NEXT: Flags [ (0x2)
-# PPC64-FBSD-NEXT: 0x2
-# PPC64-FBSD-NEXT: ]
-# PPC64-FBSD-NEXT: HeaderSize: 64
-# PPC64-FBSD-NEXT: ProgramHeaderEntrySize: 56
-# PPC64-FBSD-NEXT: ProgramHeaderCount:
-# PPC64-FBSD-NEXT: SectionHeaderEntrySize: 64
-# PPC64-FBSD-NEXT: SectionHeaderCount:
-# PPC64-FBSD-NEXT: StringTableSectionIndex:
-# PPC64-FBSD-NEXT: }
+# RUN: llvm-readobj --file-headers %t4ppc64 | FileCheck --check-prefixes=CHECK,PPC64,LINUX,PPCBE %s
# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %tppc64le
# RUN: ld.lld -m elf64lppc %tppc64le -o %t2ppc64le
-# RUN: llvm-readobj --file-headers %t2ppc64le | FileCheck --check-prefix=PPC64LE %s
+# RUN: llvm-readobj --file-headers %t2ppc64le | FileCheck --check-prefixes=CHECK,PPC64,LINUX,PPCLE %s
# RUN: ld.lld %tppc64le -o %t3ppc64le
-# RUN: llvm-readobj --file-headers %t3ppc64le | FileCheck --check-prefix=PPC64LE %s
+# RUN: llvm-readobj --file-headers %t3ppc64le | FileCheck --check-prefixes=CHECK,PPC64,LINUX,PPCLE %s
# RUN: echo 'OUTPUT_FORMAT(elf64-powerpcle)' > %tppc64le.script
# RUN: ld.lld %tppc64le.script %tppc64le -o %t4ppc64le
-# RUN: llvm-readobj --file-headers %t4ppc64le | FileCheck --check-prefix=PPC64LE %s
-
-# PPC64LE: ElfHeader {
-# PPC64LE-NEXT: Ident {
-# PPC64LE-NEXT: Magic: (7F 45 4C 46)
-# PPC64LE-NEXT: Class: 64-bit (0x2)
-# PPC64LE-NEXT: DataEncoding: LittleEndian (0x1)
-# PPC64LE-NEXT: FileVersion: 1
-# PPC64LE-NEXT: OS/ABI: SystemV (0x0)
-# PPC64LE-NEXT: ABIVersion: 0
-# PPC64LE-NEXT: Unused: (00 00 00 00 00 00 00)
-# PPC64LE-NEXT: }
-# PPC64LE-NEXT: Type: Executable (0x2)
-# PPC64LE-NEXT: Machine: EM_PPC64 (0x15)
-# PPC64LE-NEXT: Version: 1
-# PPC64LE-NEXT: Entry:
-# PPC64LE-NEXT: ProgramHeaderOffset: 0x40
-# PPC64LE-NEXT: SectionHeaderOffset:
-# PPC64LE-NEXT: Flags [ (0x2)
-# PPC64LE-NEXT: 0x2
-# PPC64LE-NEXT: ]
-# PPC64LE-NEXT: HeaderSize: 64
-# PPC64LE-NEXT: ProgramHeaderEntrySize: 56
-# PPC64LE-NEXT: ProgramHeaderCount:
-# PPC64LE-NEXT: SectionHeaderEntrySize: 64
-# PPC64LE-NEXT: SectionHeaderCount:
-# PPC64LE-NEXT: StringTableSectionIndex:
-# PPC64LE-NEXT: }
+# RUN: llvm-readobj --file-headers %t4ppc64le | FileCheck --check-prefixes=CHECK,PPC64,LINUX,PPCLE %s
# RUN: llvm-mc -filetype=obj -triple=powerpc-unknown-linux %s -o %tppc32
# RUN: ld.lld -m elf32ppc %tppc32 -o %t2ppc32
-# RUN: llvm-readobj --file-headers %t2ppc32 | FileCheck --check-prefix=PPC32 %s
+# RUN: llvm-readobj --file-headers %t2ppc32 | FileCheck --check-prefixes=CHECK,PPC32,LINUX,PPCBE %s
# RUN: ld.lld %tppc32 -o %t3ppc32
-# RUN: llvm-readobj --file-headers %t3ppc32 | FileCheck --check-prefix=PPC32 %s
+# RUN: llvm-readobj --file-headers %t3ppc32 | FileCheck --check-prefixes=CHECK,PPC32,LINUX,PPCBE %s
# RUN: echo 'OUTPUT_FORMAT(elf32-powerpc)' > %tppc32.script
# RUN: ld.lld %tppc32.script %tppc32 -o %t4ppc32
-# RUN: llvm-readobj --file-headers %t4ppc32 | FileCheck --check-prefix=PPC32 %s
+# RUN: llvm-readobj --file-headers %t4ppc32 | FileCheck --check-prefixes=CHECK,PPC32,LINUX,PPCBE %s
# RUN: ld.lld -m elf32ppclinux %tppc32 -o %t5ppc32
-# RUN: llvm-readobj --file-headers %t5ppc32 | FileCheck --check-prefix=PPC32 %s
+# RUN: llvm-readobj --file-headers %t5ppc32 | FileCheck --check-prefixes=CHECK,PPC32,LINUX,PPCBE %s
+
+# RUN: llvm-mc -filetype=obj -triple=powerpcle-unknown-linux %s -o %tppc32le
+# RUN: ld.lld -m elf32lppc %tppc32le -o %t2ppc32le
+# RUN: llvm-readobj --file-headers %t2ppc32le | FileCheck --check-prefixes=CHECK,PPC32,LINUX,PPCLE %s
+# RUN: ld.lld %tppc32le -o %t3ppc32le
+# RUN: llvm-readobj --file-headers %t3ppc32le | FileCheck --check-prefixes=CHECK,PPC32,LINUX,PPCLE %s
+# RUN: echo 'OUTPUT_FORMAT(elf32-powerpcle)' > %tppc32le.script
+# RUN: ld.lld %tppc32le.script %tppc32le -o %t4ppc32le
+# RUN: llvm-readobj --file-headers %t4ppc32le | FileCheck --check-prefixes=CHECK,PPC32,LINUX,PPCLE %s
+# RUN: ld.lld -m elf32lppclinux %tppc32le -o %t5ppc32le
+# RUN: llvm-readobj --file-headers %t5ppc32le | FileCheck --check-prefixes=CHECK,PPC32,LINUX,PPCLE %s
+
+# RUN: llvm-mc -filetype=obj -triple=powerpc-unknown-freebsd %s -o %tppc32fbsd
+# RUN: echo 'OUTPUT_FORMAT(elf32-powerpc-freebsd)' > %tppc32fbsd.script
+# RUN: ld.lld %tppc32fbsd.script %tppc32fbsd -o %t2ppc32fbsd
+# RUN: llvm-readobj --file-headers %t2ppc32fbsd | FileCheck --check-prefixes=CHECK,PPC32,FBSD,PPCBE %s
+
+# RUN: llvm-mc -filetype=obj -triple=powerpcle-unknown-freebsd %s -o %tppc32fbsdle
+# RUN: echo 'OUTPUT_FORMAT(elf32-powerpcle-freebsd)' > %tppc32fbsdle.script
+# RUN: ld.lld %tppc32fbsdle.script %tppc32fbsdle -o %t2ppc32fbsdle
+# RUN: llvm-readobj --file-headers %t2ppc32fbsdle | FileCheck --check-prefixes=CHECK,PPC32,FBSD,PPCLE %s
+
+# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-freebsd %s -o %tppc64fbsd
+# RUN: echo 'OUTPUT_FORMAT(elf64-powerpc-freebsd)' > %tppc64fbsd.script
+# RUN: ld.lld %tppc64fbsd.script %tppc64fbsd -o %t2ppc64fbsd
+# RUN: llvm-readobj --file-headers %t2ppc64fbsd | FileCheck --check-prefixes=CHECK,PPC64,FBSD,PPCBE %s
+
+# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-freebsd %s -o %tppc64fbsdle
+# RUN: echo 'OUTPUT_FORMAT(elf64-powerpcle-freebsd)' > %tppc64fbsdle.script
+# RUN: ld.lld %tppc64fbsdle.script %tppc64fbsdle -o %t2ppc64fbsdle
+# RUN: llvm-readobj --file-headers %t2ppc64fbsdle | FileCheck --check-prefixes=CHECK,PPC64,FBSD,PPCLE %s
-# PPC32: ElfHeader {
-# PPC32-NEXT: Ident {
-# PPC32-NEXT: Magic: (7F 45 4C 46)
+# CHECK: ElfHeader {
+# CHECK-NEXT: Ident {
+# CHECK-NEXT: Magic: (7F 45 4C 46)
+
+# PPC64-NEXT: Class: 64-bit (0x2)
# PPC32-NEXT: Class: 32-bit (0x1)
-# PPC32-NEXT: DataEncoding: BigEndian (0x2)
-# PPC32-NEXT: FileVersion: 1
-# PPC32-NEXT: OS/ABI: SystemV (0x0)
-# PPC32-NEXT: ABIVersion: 0
-# PPC32-NEXT: Unused: (00 00 00 00 00 00 00)
-# PPC32-NEXT: }
-# PPC32-NEXT: Type: Executable (0x2)
+
+# PPCBE-NEXT: DataEncoding: BigEndian (0x2)
+# PPCLE-NEXT: DataEncoding: LittleEndian (0x1)
+
+# CHECK-NEXT: FileVersion: 1
+
+# LINUX-NEXT: OS/ABI: SystemV (0x0)
+# FBSD-NEXT: OS/ABI: FreeBSD (0x9)
+
+# CHECK-NEXT: ABIVersion: 0
+# CHECK-NEXT: Unused: (00 00 00 00 00 00 00)
+# CHECK-NEXT: }
+# CHECK-NEXT: Type: Executable (0x2)
+
+# PPC64-NEXT: Machine: EM_PPC64 (0x15)
# PPC32-NEXT: Machine: EM_PPC (0x14)
-# PPC32-NEXT: Version: 1
-# PPC32-NEXT: Entry:
+
+# CHECK-NEXT: Version: 1
+# CHECK-NEXT: Entry:
+# PPC64-NEXT: ProgramHeaderOffset: 0x40
# PPC32-NEXT: ProgramHeaderOffset: 0x34
-# PPC32-NEXT: SectionHeaderOffset:
+# CHECK-NEXT: SectionHeaderOffset:
+# PPC64-NEXT: Flags [ (0x2)
# PPC32-NEXT: Flags [ (0x0)
-# PPC32-NEXT: ]
+# PPC64-NEXT: 0x2
+# CHECK-NEXT: ]
+# PPC64-NEXT: HeaderSize: 64
# PPC32-NEXT: HeaderSize: 52
+# PPC64-NEXT: ProgramHeaderEntrySize: 56
# PPC32-NEXT: ProgramHeaderEntrySize: 32
-# PPC32-NEXT: ProgramHeaderCount:
+# CHECK-NEXT: ProgramHeaderCount:
+# PPC64-NEXT: SectionHeaderEntrySize: 64
# PPC32-NEXT: SectionHeaderEntrySize: 40
-# PPC32-NEXT: SectionHeaderCount:
-# PPC32-NEXT: StringTableSectionIndex:
-# PPC32-NEXT: }
+# CHECK-NEXT: SectionHeaderCount:
+# CHECK-NEXT: StringTableSectionIndex:
+# CHECK-NEXT: }
.globl _start
_start:
diff --git a/test/ELF/ppc32-gnu-ifunc.s b/test/ELF/ppc32-gnu-ifunc.s
index b85b9eb..66efd5e 100644
--- a/test/ELF/ppc32-gnu-ifunc.s
+++ b/test/ELF/ppc32-gnu-ifunc.s
@@ -5,6 +5,12 @@
# RUN: llvm-readelf -S -s %t | FileCheck --check-prefixes=SEC,SYM %s
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple=powerpcle %s -o %t.o
+# RUN: ld.lld %t.o -o %t
+# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
+# RUN: llvm-readelf -S -s %t | FileCheck --check-prefixes=SEC,SYM %s
+# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
+
# RELOC: .rela.dyn {
# RELOC-NEXT: 0x10020118 R_PPC_IRELATIVE - 0x100100E0
# RELOC-NEXT: }
diff --git a/test/ELF/ppc32-reloc-rel.s b/test/ELF/ppc32-reloc-rel.s
index fefeeba..29501fd 100644
--- a/test/ELF/ppc32-reloc-rel.s
+++ b/test/ELF/ppc32-reloc-rel.s
@@ -1,6 +1,10 @@
# REQUIRES: ppc
-# RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.o
-# RUN: ld.lld %t.o -o %t
+# RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.be.o
+# RUN: ld.lld %t.be.o -o %t
+# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
+
+# RUN: llvm-mc -filetype=obj -triple=powerpcle %s -o %t.le.o
+# RUN: ld.lld %t.le.o -o %t
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
.section .R_PPC_REL14,"ax",@progbits
--
2.29.2

View file

@ -1,31 +0,0 @@
--- a/source/Plugins/Process/Linux/Procfs.h
+++ b/source/Plugins/Process/Linux/Procfs.h
@@ -10,21 +10,12 @@
// sys/procfs.h on Android/Linux for all supported architectures.
#include <sys/ptrace.h>
+#include <asm/ptrace.h>
-#ifdef __ANDROID__
-#if defined(__arm64__) || defined(__aarch64__)
-typedef unsigned long elf_greg_t;
-typedef elf_greg_t
- elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
-typedef struct user_fpsimd_state elf_fpregset_t;
-#ifndef NT_FPREGSET
-#define NT_FPREGSET NT_PRFPREG
-#endif // NT_FPREGSET
-#elif defined(__mips__)
-#ifndef NT_FPREGSET
-#define NT_FPREGSET NT_PRFPREG
-#endif // NT_FPREGSET
-#endif
-#else // __ANDROID__
+#if !defined(__GLIBC__) && defined(__powerpc__)
+#define pt_regs musl_pt_regs
+#include <sys/procfs.h>
+#undef pt_regs
+#else
#include <sys/procfs.h>
-#endif // __ANDROID__
+#endif

View file

@ -21,40 +21,12 @@ maintainer="q66 <daniel@octaforce.org>"
license="NCSA"
homepage="https://www.llvm.org"
distfiles="
https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-${version}.src.tar.xz
https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/lldb-${version}.src.tar.xz
https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/lld-${version}.src.tar.xz
https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/clang-${version}.src.tar.xz
https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/clang-tools-extra-${version}.src.tar.xz
https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/compiler-rt-${version}.src.tar.xz"
https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-${version}.src.tar.xz"
checksum="
913f68c898dfb4a03b397c5e11c6a2f39d0f22ed7665c9cefa87a34423a72469
8570c09f57399e21e0eea0dcd66ae0231d47eafc7a04d6fe5c4951b13c4d2c72
efe7be4a7b7cdc6f3bcf222827c6f837439e6e656d12d6c885d5c8a80ff4fd1c
0f96acace1e8326b39f220ba19e055ba99b0ab21c2475042dbc6a482649c5209
fed318f75d560d0e0ae728e2fb8abce71e9d0c60dd120c9baac118522ce76c09
374aff82ff573a449f9aabbd330a5d0a441181c535a3599996127378112db234"
913f68c898dfb4a03b397c5e11c6a2f39d0f22ed7665c9cefa87a34423a72469"
lib32disabled=yes
python_version=3
_lldb_enable=yes
if [ "$CROSS_BUILD" ]; then
_lldb_enable=no
fi
case "$XBPS_TARGET_MACHINE" in
ppc64le*) ;;
ppc*) _lldb_enable=no ;;
esac
subpackages="clang-tools-extra clang clang-analyzer libclang libclang-cpp libllvm11"
if [ "$_lldb_enable" = "yes" ]; then
# XXX fails to cross compile due to python
subpackages+=" lldb lldb-devel"
fi
subpackages+=" lld lld-devel"
post_patch() {
# patches
cd ${XBPS_BUILDDIR}/llvm-${version}.src
@ -63,70 +35,6 @@ post_patch() {
patch -sNp1 -i ${i}
done
cd ${XBPS_BUILDDIR}/clang-${version}.src
for i in ${FILESDIR}/patches/clang/clang-*.patch; do
msg_normal "Applying $i to clang\n"
patch -sNp1 -i ${i}
done
cd ${XBPS_BUILDDIR}/lld-${version}.src
for i in ${FILESDIR}/patches/lld/lld-*.patch; do
msg_normal "Applying $i to lld\n"
patch -sNp1 -i ${i}
done
case "$XBPS_TARGET_MACHINE" in
armv5*)
cd ${XBPS_BUILDDIR}/compiler-rt-${version}.src
for i in ${FILESDIR}/patches/compiler-rt/compiler-rt-*.patch; do
msg_normal "Applying $i to compiler-rt\n"
patch -sNp1 -i ${i}
done
;;
esac
if [ "$_lldb_enable" = "yes" ]; then
cd ${XBPS_BUILDDIR}/lldb-${version}.src
for i in ${FILESDIR}/patches/lldb/*.patch; do
msg_normal "Applying $i to lldb\n"
patch -sNp1 -i ${i}
done
case "$XBPS_TARGET_MACHINE" in
*-musl) sed -i 's|__ptrace_request|int|g' source/Plugins/Process/Linux/NativeProcessLinux.cpp ;;
esac
fi
# Move clang files into the llvm source.
if [ -d ${XBPS_BUILDDIR}/clang-${version}.src ]; then
mv ${XBPS_BUILDDIR}/clang-${version}.src ${wrksrc}/tools/clang
fi
# Move clang-tools-extra files into llvm source.
if [ -d ${XBPS_BUILDDIR}/clang-tools-extra-${version}.src ]; then
mv ${XBPS_BUILDDIR}/clang-tools-extra-${version}.src ${wrksrc}/tools/clang/tools/extra
fi
# Move lld files into the llvm source.
if [ -d ${XBPS_BUILDDIR}/lld-${version}.src ]; then
mv ${XBPS_BUILDDIR}/lld-${version}.src ${wrksrc}/tools/lld
fi
# Move lldb files into the llvm source.
if [ -d ${XBPS_BUILDDIR}/lldb-${version}.src ]; then
if [ "$_lldb_enable" = "yes" ]; then
mv ${XBPS_BUILDDIR}/lldb-${version}.src ${wrksrc}/tools/lldb
else
rm -rf ${XBPS_BUILDDIR}/lldb-${version}.src
fi
fi
# Move compiler-rt files into the llvm source.
if [ -d ${XBPS_BUILDDIR}/compiler-rt-${version}.src ]; then
mv ${XBPS_BUILDDIR}/compiler-rt-${version}.src ${wrksrc}/projects/compiler-rt
fi
case "$XBPS_TARGET_MACHINE" in
*-musl)
# Disable sanitizers
sed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' ${wrksrc}/projects/compiler-rt/cmake/config-ix.cmake
;;
esac
# update config.guess for better platform detection
cp $XBPS_COMMONDIR/environment/configure/automake/config.guess ${wrksrc}/cmake
}
@ -151,9 +59,7 @@ pre_configure() {
CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
cmake ../.. -DCMAKE_BUILD_TYPE=Release
make ${makejobs} -C utils/TableGen
make ${makejobs} -C tools/clang/utils/TableGen
configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/build/HOST/bin/llvm-tblgen"
configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/build/HOST/bin/clang-tblgen"
cd ../..
fi
@ -196,123 +102,6 @@ do_install() {
fi
}
clang-analyzer_package() {
pycompile_dirs="usr/share/scan-view"
depends="clang-${version}_${revision} python3"
short_desc+=" - A source code analysis framework"
homepage="https://clang-analyzer.llvm.org/"
pkg_install() {
vmove usr/share/man/man1/scan-build.1
vmove "/usr/bin/scan-*"
vmove "/usr/share/scan-*"
vmove "/usr/libexec/*analyzer"
}
}
clang-tools-extra_package() {
lib32disabled=yes
depends="clang-${version}_${revision} python3"
short_desc+=" - Extra Clang tools"
homepage="https://clang.llvm.org/extra/"
pkg_install() {
vmove usr/include/clang-tidy
vmove usr/bin/clang-apply-replacements
vmove usr/bin/clang-query
vmove usr/bin/clang-rename
vmove usr/bin/clang-tidy
vmove usr/bin/diagtool
vmove usr/bin/find-all-symbols
vmove usr/bin/hmaptool
vmove usr/bin/modularize
vmove usr/bin/pp-trace
vmove usr/bin/sancov
vmove "usr/lib/libclangApplyReplacements*"
vmove "usr/lib/libclangQuery*"
vmove "usr/lib/libclangTidy*"
vmove "usr/share/clang/*tidy*"
}
}
clang_package() {
lib32disabled=yes
depends="libstdc++-devel libgcc-devel binutils ${XBPS_TARGET_LIBC}-devel
libclang-${version}_${revision}"
short_desc+=" - C language family frontend"
homepage="https://clang.llvm.org/"
pkg_install() {
vmove usr/include/clang
vmove usr/include/clang-c
vmove "usr/bin/*clang*"
vmove usr/bin/c-index-test
vmove usr/lib/clang
vmove usr/lib/cmake/clang
vmove "usr/lib/libclang*.a"
vmove "usr/lib/libclang*.so"
vmove "usr/share/clang"
}
}
libclang_package() {
short_desc+=" - C frontend runtime library"
pkg_install() {
vmove "usr/lib/libclang.so.*"
}
}
libclang-cpp_package() {
short_desc+=" - C frontend runtime library (C++ interface)"
pkg_install() {
vmove "usr/lib/libclang-cpp.so.*"
}
}
lld_package() {
lib32disabled=yes
short_desc+=" - linker"
homepage="https://lld.llvm.org"
pkg_install() {
vmove usr/bin/lld*
vmove usr/bin/wasm-ld
vmove usr/bin/ld.lld*
vmove usr/bin/ld64.lld*
}
}
lld-devel_package() {
lib32disabled=yes
short_desc+=" - linker - development files"
homepage="https://lld.llvm.org"
pkg_install() {
vmove usr/include/lld
vmove usr/lib/cmake/lld
vmove "usr/lib/liblld*a"
}
}
lldb_package() {
lib32disabled=yes
depends+=" python3-six"
short_desc+=" - LLDB debugger"
homepage="https://lldb.llvm.org/"
pkg_install() {
vmove usr/bin/*lldb*
vmove usr/lib/liblldb*so.*
vmove /usr/lib/python*
# Depend on python3-six instead of conflicting
rm ${PKGDESTDIR}/usr/lib/python3*/site-packages/six.py
}
}
lldb-devel_package() {
lib32disabled=yes
depends="lldb>=${version}_${revision}"
short_desc+=" - LLDB debugger - development files"
pkg_install() {
vmove usr/include/lldb
vmove "usr/lib/liblldb*.so"
}
}
libllvm11_package() {
short_desc+=" - runtime library"
pkg_install() {