-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang] Don't assume location of compiler-rt for OpenBSD #92183
[clang] Don't assume location of compiler-rt for OpenBSD #92183
Conversation
If the `/usr/lib/...` path one expects is not that, fall back to the regular logic. This is a minimal change to allow OpenBSD cross compilation from a toolchain that doesn't adopt all of OpenBSD's monorepo's conventions.
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: John Ericson (Ericson2314) ChangesIf the This is a minimal change to allow OpenBSD cross compilation from a toolchain that doesn't adopt all of OpenBSD's monorepo's conventions. Full diff: https://github.com/llvm/llvm-project/pull/92183.diff 1 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/OpenBSD.cpp b/clang/lib/Driver/ToolChains/OpenBSD.cpp
index e20d9fb1cfc41..3770471bae7c0 100644
--- a/clang/lib/Driver/ToolChains/OpenBSD.cpp
+++ b/clang/lib/Driver/ToolChains/OpenBSD.cpp
@@ -375,7 +375,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 =
|
Looks good - aisha@openbsd.org |
This is a very simple thing. I am quite sure it is fine from an LLVM perspective; I wanted to make sure it was fine from a BSD perspective, and @epsilon-0 confirmed it (thank you!). Will thus merge shortly. |
/cherry-pick be10746 |
Error: Command failed due to missing milestone. |
/cherry-pick be10746 |
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)
/pull-request #92293 |
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.
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)
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.