Skip to content

Commit 48c1364

Browse files
Ericson2314tstellar
authored andcommitted
[clang] Don't assume location of compiler-rt for OpenBSD (#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. (cherry picked from commit be10746)
1 parent 3d0752b commit 48c1364

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/Driver/ToolChains/OpenBSD.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ std::string OpenBSD::getCompilerRT(const ArgList &Args, StringRef Component,
371371
if (Component == "builtins") {
372372
SmallString<128> Path(getDriver().SysRoot);
373373
llvm::sys::path::append(Path, "/usr/lib/libcompiler_rt.a");
374-
return std::string(Path);
374+
if (getVFS().exists(Path))
375+
return std::string(Path);
375376
}
376377
SmallString<128> P(getDriver().ResourceDir);
377378
std::string CRTBasename =

0 commit comments

Comments
 (0)