llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: tyan0

<details>
<summary>Changes</summary>

If compiler-rt is built with `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF`, its 
search directory is incorrect.

Specifically, `ToolChain::getOSLibName()` returns `windows` instead of `cygwin` 
in a Cygwin environment, due to falling back to getOS(). This results in a link 
error against compiler-rt.

This patch makes `getOSLibName()` return `cygwin`, ensuring that compiler-rt is 
linked correctly.

---
Full diff: https://github.com/llvm/llvm-project/pull/208925.diff


1 Files Affected:

- (modified) clang/lib/Driver/ToolChain.cpp (+2) 


``````````diff
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index 3f9b808b2722e..745275a236ed3 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -684,6 +684,8 @@ static StringRef getArchNameForCompilerRTLib(const 
ToolChain &TC,
 StringRef ToolChain::getOSLibName() const {
   if (Triple.isOSDarwin())
     return "darwin";
+  if (Triple.isWindowsCygwinEnvironment())
+    return "cygwin";
 
   switch (Triple.getOS()) {
   case llvm::Triple::FreeBSD:

``````````

</details>


https://github.com/llvm/llvm-project/pull/208925
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to