aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2024-05-15 12:43:55 -0400
committerTom Stellard <tstellar@redhat.com>2024-05-17 16:26:37 -0700
commit48c1364200b5649dda2f9ccbe382b0bd908b99de (patch)
tree5301d17d4956e94e5a69932045a9bd281964930a
parent3d0752b9492efd60e85aedec79676596af6fb4f8 (diff)
downloadllvm-upstream-release/18.x.tar.gz
[clang] Don't assume location of compiler-rt for OpenBSD (#92183)upstream-release/18.x
If the `/usr/lib/...` path where compiler-rt is conventionally installed on OpenBSD does not exist, fall back to the regular logic to find it. This is a minimal change to allow OpenBSD cross compilation from a toolchain that doesn't adopt all of OpenBSD's monorepo's conventions. (cherry picked from commit be10746f3a4381456eb5082a968766201c17ab5d)
-rw-r--r--clang/lib/Driver/ToolChains/OpenBSD.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains/OpenBSD.cpp b/clang/lib/Driver/ToolChains/OpenBSD.cpp
index fd6aa4d7e684..00b6c520fcdd 100644
--- a/clang/lib/Driver/ToolChains/OpenBSD.cpp
+++ b/clang/lib/Driver/ToolChains/OpenBSD.cpp
@@ -371,7 +371,8 @@ std::string OpenBSD::getCompilerRT(const ArgList &Args, StringRef Component,
if (Component == "builtins") {
SmallString<128> Path(getDriver().SysRoot);
llvm::sys::path::append(Path, "/usr/lib/libcompiler_rt.a");
- return std::string(Path);
+ if (getVFS().exists(Path))
+ return std::string(Path);
}
SmallString<128> P(getDriver().ResourceDir);
std::string CRTBasename =