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

Remove __declspec(dllimport) from Windows libiconv build #13219

Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Mar 23, 2023

The libiconv static library we build for our Windows packages apparently tries to import libiconv_version from the libiconv DLL, so almost every program built on Windows behaves like a DLL that depends on libiconv, producing messages similar to the following during compilation:

Creating library C:\Users\runneradmin\AppData\Local\crystal\cache\D-a-crystal-crystal-src-ecr-process.cr\macro_run.lib and object C:\Users\runneradmin\AppData\Local\crystal\cache\D-a-crystal-crystal-src-ecr-process.cr\macro_run.exp
Creating library D:\a\crystal\crystal\.build\crystal-next.lib and object D:\a\crystal\crystal\.build\crystal-next.exp

This PR fixes it by removing this hardcoded __declspec(dllimport) added when that third-party repository upgraded libiconv from 1.16 to 1.17, introduced via #12745. (This __declspec is never a good idea in the first place because MSVC would warn about conflicting keywords when building a libiconv DLL.)

@HertzDevil HertzDevil added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler platform:windows Windows support based on the MSVC toolchain / Win32 API labels Mar 23, 2023
@straight-shoota straight-shoota added this to the 1.8.0 milestone Mar 23, 2023
@straight-shoota straight-shoota merged commit 018bfba into crystal-lang:master Mar 25, 2023
@HertzDevil HertzDevil deleted the bug/windows-libiconv-dllimport branch March 27, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. platform:windows Windows support based on the MSVC toolchain / Win32 API topic:infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants