Skip to content

Commit be10746

Browse files
authored
[clang] Don't assume location of compiler-rt for OpenBSD (llvm#92183)
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.
1 parent 332de4b commit be10746

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/Driver/ToolChains/OpenBSD.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ std::string OpenBSD::getCompilerRT(const ArgList &Args, StringRef Component,
375375
if (Component == "builtins") {
376376
SmallString<128> Path(getDriver().SysRoot);
377377
llvm::sys::path::append(Path, "/usr/lib/libcompiler_rt.a");
378-
return std::string(Path);
378+
if (getVFS().exists(Path))
379+
return std::string(Path);
379380
}
380381
SmallString<128> P(getDriver().ResourceDir);
381382
std::string CRTBasename =

0 commit comments

Comments
 (0)