-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support -static
and -dynamic
.lib
suffixes on Windows
#13473
Support -static
and -dynamic
.lib
suffixes on Windows
#13473
Conversation
Some symbols from
This reveals a bug where a Also note that in this case the executable does not know about the names of the symbols imported using ordinals (e.g. 115 is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have a small suggestion for a little optimization.
But it's optional. I'm approving either way.
As described in #11575 (comment), this PR makes the Crystal compiler look for
foo-static.lib
beforefoo.lib
in each library search directory on Windows, andfoo-dynamic.lib
beforefoo.lib
if-Dpreview_dll
is specified. Onlyfoo
is affected; any path separator (/
or\
) will disable the extra suffix behavior.This will allow us to finally distribute static and DLL import libraries side-by-side in
CRYSTAL_LIBRARY_PATH
. The next step would be having CI collect the import libraries into$ORIGIN/lib/*-dynamic.lib
, and the DLLs themselves into$ORIGIN/*.dll
. The DLLs do not have their own directory since Crystal itself might look them up in the same directory as the executable.This PR also enables delay-loading for all DLLs, even when
-Dpreview_dll
is not used. This is not a problem for static libraries because they simply do not import DLLs (this is already the case when the Crystal interpreter loads those .lib files).