quic-garvgupt wrote:
I have divided this PR into three separate PRs to streamline the review process
and ensured that ARM and RISCV tests are not modified in the same PR. Please
review them and provide any feedback or comments. Thanks!
[RISCV] Teach Barmetal toolchain about GCC installation(1/
petrhosek wrote:
> > I think this change could be made a lot smaller by doing a clean up first,
> > bringing the BareMetal driver closer to other drivers, before attempting to
> > merge the RISCVToolChain driver into it.
>
> Could you describe in a bit more detail which bits you think need to
kito-cheng wrote:
I would suggest to break this PR into several small pieces, the clang/test
folder should not having too much change during the merging, especially I feel
not conformable changing the non-RISC-V file within this PR, I expect those
change should happened in a separated patch.
@@ -78,8 +86,9 @@ class LLVM_LIBRARY_VISIBILITY BareMetal : public ToolChain {
using OrderedMultilibs =
llvm::iterator_range::const_reverse_iterator>;
OrderedMultilibs getOrderedMultilibs() const;
-
+ bool UseLD;
quic-garvgupt wrote:
please see my
@@ -110,20 +111,95 @@ static std::string computeBaseSysRoot(const Driver &D,
bool IncludeTriple) {
return std::string(SysRootDir);
}
+// GCC sysroot here means form sysroot from either --gcc-install-dir, or from
+// --gcc-toolchain or if the toolchain is installed alongside
@@ -6521,11 +6521,7 @@ const ToolChain &Driver::getToolChain(const ArgList
&Args,
break;
case llvm::Triple::riscv32:
case llvm::Triple::riscv64:
-if (toolchains::RISCVToolChain::hasGCCToolchain(*this, Args))
- TC =
- std::make_
https://github.com/quic-garvgupt updated
https://github.com/llvm/llvm-project/pull/118809
>From b58f9dd197c78b1e39676022a421ca0e6d5552a5 Mon Sep 17 00:00:00 2001
From: Garvit Gupta
Date: Wed, 13 Nov 2024 02:45:51 -0800
Subject: [PATCH] [WIP] Merging RISCVToolChain and BareMetal toolchains
Curr
https://github.com/quic-garvgupt updated
https://github.com/llvm/llvm-project/pull/118809
>From 569feb86c654be044781aa5968907a72ea882e88 Mon Sep 17 00:00:00 2001
From: Garvit Gupta
Date: Wed, 13 Nov 2024 02:45:51 -0800
Subject: [PATCH] [WIP] Merging RISCVToolChain and BareMetal toolchains
Curr
efriedma-quic wrote:
> I think this change could be made a lot smaller by doing a clean up first,
> bringing the BareMetal driver closer to other drivers, before attempting to
> merge the RISCVToolChain driver into it.
Could you describe in a bit more detail which bits you think need to be cle
petrhosek wrote:
The `BareMetal` driver currently isn't very idiomatic (compared to other
drivers like `Generic_GCC`) and duplicates a lot of the logic that has been
already factored out in other drivers. I think this change could be made a lot
smaller by doing a clean up first, bringing the `
@@ -291,6 +365,36 @@ BareMetal::OrderedMultilibs
BareMetal::getOrderedMultilibs() const {
return llvm::reverse(Default);
}
+ToolChain::CXXStdlibType BareMetal::GetDefaultCXXStdlibType() const {
+ if (getTriple().isRISCV()) {
+return GCCInstallation.isValid() ? ToolChai
@@ -110,20 +111,95 @@ static std::string computeBaseSysRoot(const Driver &D,
bool IncludeTriple) {
return std::string(SysRootDir);
}
+// GCC sysroot here means form sysroot from either --gcc-install-dir, or from
+// --gcc-toolchain or if the toolchain is installed alongside
@@ -503,12 +624,22 @@ void baremetal::Linker::ConstructJob(Compilation &C,
const JobAction &JA,
const llvm::Triple::ArchType Arch = TC.getArch();
const llvm::Triple &Triple = getToolChain().getEffectiveTriple();
- AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA);
+ if (!D
@@ -503,12 +624,22 @@ void baremetal::Linker::ConstructJob(Compilation &C,
const JobAction &JA,
const llvm::Triple::ArchType Arch = TC.getArch();
const llvm::Triple &Triple = getToolChain().getEffectiveTriple();
- AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA);
+ if (!D
@@ -519,9 +650,24 @@ void baremetal::Linker::ConstructJob(Compilation &C, const
JobAction &JA,
CmdArgs.push_back(Arch == llvm::Triple::aarch64_be ? "-EB" : "-EL");
}
- if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
- options::OPT_r
@@ -103,7 +112,12 @@ class LLVM_LIBRARY_VISIBILITY StaticLibTool : public Tool {
class LLVM_LIBRARY_VISIBILITY Linker final : public Tool {
public:
- Linker(const ToolChain &TC) : Tool("baremetal::Linker", "ld.lld", TC) {}
+ Linker(const ToolChain &TC)
toppe
@@ -103,7 +112,12 @@ class LLVM_LIBRARY_VISIBILITY StaticLibTool : public Tool {
class LLVM_LIBRARY_VISIBILITY Linker final : public Tool {
public:
- Linker(const ToolChain &TC) : Tool("baremetal::Linker", "ld.lld", TC) {}
+ Linker(const ToolChain &TC)
+ : Tool("baremet
@@ -503,12 +624,22 @@ void baremetal::Linker::ConstructJob(Compilation &C,
const JobAction &JA,
const llvm::Triple::ArchType Arch = TC.getArch();
const llvm::Triple &Triple = getToolChain().getEffectiveTriple();
- AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA);
+ if (!D
@@ -503,12 +624,22 @@ void baremetal::Linker::ConstructJob(Compilation &C,
const JobAction &JA,
const llvm::Triple::ArchType Arch = TC.getArch();
const llvm::Triple &Triple = getToolChain().getEffectiveTriple();
- AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA);
+ if (!D
@@ -325,6 +429,19 @@ void BareMetal::addClangTargetOptions(const ArgList
&DriverArgs,
CC1Args.push_back("-nostdsysteminc");
}
+void BareMetal::addLibStdCxxIncludePaths(
+const llvm::opt::ArgList &DriverArgs,
+llvm::opt::ArgStringList &CC1Args) const {
+ if (GCCInst
@@ -291,6 +365,36 @@ BareMetal::OrderedMultilibs
BareMetal::getOrderedMultilibs() const {
return llvm::reverse(Default);
}
+ToolChain::CXXStdlibType BareMetal::GetDefaultCXXStdlibType() const {
+ if (getTriple().isRISCV()) {
topperc wrote:
Could this be s
https://github.com/quic-garvgupt updated
https://github.com/llvm/llvm-project/pull/118809
>From b74795d44846b79252bd3fb1f1e8179311725c74 Mon Sep 17 00:00:00 2001
From: Garvit Gupta
Date: Wed, 13 Nov 2024 02:45:51 -0800
Subject: [PATCH] [RISCV] Merging RISCVToolChain and BareMetal toolchains
Cu
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 3740fac0d4640c05ba960be97d14cbd375a7c733
b1bd1ee4f3a4966b50e0b35fd349091660e84576 --e
llvmbot wrote:
@llvm/pr-subscribers-backend-risc-v
Author: Garvit Gupta (quic-garvgupt)
Changes
Currently, LLVM has two RISC-V toolchain classes in Clang for baremetal
development, creating unnecessary maintenance overhead. This patch extends the
BareMetal toolchain to support an existin
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Garvit Gupta (quic-garvgupt)
Changes
Currently, LLVM has two RISC-V toolchain classes in Clang for baremetal
development, creating unnecessary maintenance overhead. This patch extends the
BareMetal toolchain to support an existing GCC ins
llvmbot wrote:
@llvm/pr-subscribers-clang-driver
Author: Garvit Gupta (quic-garvgupt)
Changes
Currently, LLVM has two RISC-V toolchain classes in Clang for baremetal
development, creating unnecessary maintenance overhead. This patch extends the
BareMetal toolchain to support an existing
https://github.com/quic-garvgupt created
https://github.com/llvm/llvm-project/pull/118809
Currently, LLVM has two RISC-V toolchain classes in Clang for baremetal
development, creating unnecessary maintenance overhead. This patch extends the
BareMetal toolchain to support an existing GCC instal
27 matches
Mail list logo