abidh added a comment.
If gcc and clang based toolchains are installed in the same prefix then having
sysroot at same location can cause one installation to overwrite parts of other.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92677/new/
https:/
phosek added inline comments.
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:102
+ SmallString<128> SysRootDir;
+ llvm::sys::path::append(SysRootDir, getDriver().Dir, "../lib/clang-runtimes",
+ getDriver().getTargetTriple());
I a
This revision was automatically updated to reflect the committed changes.
Closed by commit rG275592e71413: Provide default location of sysroot for
Baremetal toolchain. (authored by abidh).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92677/new/
ht
jroelofs added inline comments.
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:108
+
+ return std::string(SysRootDir.str());
+}
abidh wrote:
> jroelofs wrote:
> > Small string has an implicit conversion to std::string, so you can just
> > `return SysRoot
jroelofs added inline comments.
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:105
+
+ return std::string(SysRootDir);
+}
did `return SysRootDir;` not work? Why do you need the explicit std::string
ctor call?
CHANGES SINCE LAST ACTION
https://reviews
abidh marked an inline comment as done.
abidh added inline comments.
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:108
+
+ return std::string(SysRootDir.str());
+}
jroelofs wrote:
> Small string has an implicit conversion to std::string, so you can just
abidh updated this revision to Diff 309637.
abidh added a comment.
Handled review comments.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92677/new/
https://reviews.llvm.org/D92677
Files:
clang/lib/Driver/ToolChains/BareMetal.cpp
clang/lib/Driver/ToolChains/BareMetal.h
clang/test
jroelofs accepted this revision.
jroelofs added a comment.
This revision is now accepted and ready to land.
LGTM
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:105
+
+ if (!llvm::sys::fs::exists(SysRootDir))
+return std::string();
Why not always add
abidh created this revision.
abidh added reviewers: mcarrasco, jroelofs.
abidh added a project: clang.
Herald added subscribers: s.egerton, PkmX, simoncook, kristof.beyls.
abidh requested review of this revision.
Herald added a subscriber: cfe-commits.
Currently, Baremetal toolchain requires user