Skip to content

MinGW DLL improvements#44

Open
slipher wants to merge 3 commits into
Unvanquished:masterfrom
slipher:find-dll
Open

MinGW DLL improvements#44
slipher wants to merge 3 commits into
Unvanquished:masterfrom
slipher:find-dll

Conversation

@slipher

@slipher slipher commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
  • Make sure that DLLs are located in files belonging to the specific toolchain, instead of searching everything in /usr.
  • Don't add libssp-0.dll if it is not depended upon. The latest toolchains no longer emit this dependency.

Tested on Debian, Arch, Fedora, and MSYS. Well, the build doesn't complete on Arch because its toolchains have an incompatible CRT flavor, but at least it gets past the DLL finding part.

slipher added 3 commits June 8, 2026 11:45
The exact same code is there 80 lines up.
Use the --print-file-name option with MinGW GCC to get the locations of
its DLLs, instead of searching for them in the filesystem. Well, this
only actually works directly with Debian's packaging. On other distros,
--print-file-name doesn't work on DLLs. For those we use it to locate
a random static library, then hope that the DLL is in a `bin` directory
which is a sibling of a `lib` directory containing the static lib.

The method of getting the path to the compiler (via grepping in the
CMake cache) is ugly, but overall it seems better than scanning the
filesystem (which may have multiple toolchains installed) for DLLs and
hoping we got the right one.
Starting with GCC 15 or 16, the compiler no longer emits libssp
dependencies.

Fixes build-release on MSYS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant