Skip to content
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

Build lib Files with gcc on Windows #6753

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CoolSpy3
Copy link
Contributor

@CoolSpy3 CoolSpy3 commented Jan 8, 2025

Description
This PR supersedes #6740.

Currently, Windows import libraries (.lib files) are only being generated for some binaries. This makes it difficult to link to these binaries with the MSVC toolchain. This was previously done because generating these files requires listing all of there exports in a file, which had to be done by hand. This PR updates the relevant Makefiles to use MinGW's dlltool to generate these export listings. These can then be compiled to import libraries by MSVC.

This PR updates the relevant Makefiles to generate the libraries with gcc. (Thanks to @Kreijstal for the suggestion!) From my understanding, these should provide the same functionality as the visual-cpp-generated files, but with two added benefits:

  1. The generation is now fully automatic. This means that there is no need for new contributors to remember to export new symbols. This is especially helpful for the cpp library variants, which have name-mangled symbols. Atm, these have no explicit symbol listing, and thus, no generated import libraries.
  2. As far as I can tell, the generation of import libraries was the build process's only dependency on the visual-cpp build tools. This means that after this change, the Visual Studio dependencies can be removed from the Makefiles and GitHub Actions scripts.

Combined with #6752, this makes the def files throughout the repo completely obsolete. I've deleted them in this PR, however, because of their additional use in the Matlab sources test, this will make the sources tests fail until #6752 is merged.

Related Issues
This pull-request fixes issue #6434.

Tasks
Add the list of tasks of this PR.

  • Rewrite the existing builds to generate their import libraries with gcc
  • Remove the outdated parts of the build (visual-cpp and *.def files)
  • Check the symbols exported by the new files against the old ones and note any significant changes in this PR.
  • Update the changelog

@CoolSpy3 CoolSpy3 added test distribution Start the distribution test test suite Start the test suite labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test distribution Start the distribution test test suite Start the test suite
Development

Successfully merging this pull request may close these issues.

1 participant