Skip to content

Conversation

@kikairoya
Copy link
Contributor

Linking for Cygwin target always needs -lcygwin but should not auto-exported from it, same as -lmingw for MinGW target.

@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2025

@llvm/pr-subscribers-platform-windows
@llvm/pr-subscribers-lld-coff

@llvm/pr-subscribers-lld

Author: Tomohiro Kashiwada (kikairoya)

Changes

Linking for Cygwin target always needs -lcygwin but should not auto-exported from it, same as -lmingw for MinGW target.


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

1 Files Affected:

  • (modified) lld/COFF/MinGW.cpp (+1)
diff --git a/lld/COFF/MinGW.cpp b/lld/COFF/MinGW.cpp
index ca9ae403f181b..4f31ad36f025d 100644
--- a/lld/COFF/MinGW.cpp
+++ b/lld/COFF/MinGW.cpp
@@ -46,6 +46,7 @@ AutoExporter::AutoExporter(
       "libclang_rt.profile-arm",
       "libclang_rt.profile-i386",
       "libclang_rt.profile-x86_64",
+      "libcygwin",
       "libc++",
       "libc++abi",
       "libflang_rt.runtime",

Copy link
Member

@mstorsjo mstorsjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeremyd2019
Copy link
Contributor

Maybe add libmsys-2.0 at the same time?

…rt library list

Linking for Cygwin target always needs -lcygwin (and, -lmsys-2.0
instead for MSYS2 target) but should not auto-export from
them, same as -lmingw32 for MinGW target.
@kikairoya
Copy link
Contributor Author

Copy link
Member

@mstorsjo mstorsjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

When updating the intended commit message, it's recommended that you update the PR subject/description accordingly as well. When merging (with "squash and merge" as is the only alternative in llvm-project), the default commit message is based on the PR subject/description, not the individual commit messages. In this case I can take care to update it manually when merging though.

@mstorsjo mstorsjo merged commit 89aef7e into llvm:main Jun 8, 2025
7 checks passed
@kikairoya
Copy link
Contributor Author

Sorry for the extra work, and I really appreciate your help.

@kikairoya kikairoya deleted the lld-libcygwin branch June 9, 2025 09:57
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
…rt library list (llvm#143118)

Linking for Cygwin target always needs -lcygwin (and, -lmsys-2.0
instead for MSYS2 target) but should not auto-export from
them, same as -lmingw32 for MinGW target.
jeremyd2019 pushed a commit to jeremyd2019/llvm-project that referenced this pull request Aug 9, 2025
…rt library list (llvm#143118)

Linking for Cygwin target always needs -lcygwin (and, -lmsys-2.0
instead for MSYS2 target) but should not auto-export from
them, same as -lmingw32 for MinGW target.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants