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

link: windows-gnu: look for Unix-style static library names #9771

Closed
wants to merge 1 commit into from

Conversation

Kha
Copy link
Contributor

@Kha Kha commented Sep 15, 2021

Zig already looks for MinGW-style import library names lib${name}.dll.a, so this feels only consistent and simplifies porting existing MinGW projects.

@Kha Kha changed the title link: windows-gnu: look for Unix-style library names link: windows-gnu: look for Unix-style static library names Sep 15, 2021
@rohlem
Copy link
Contributor

rohlem commented Sep 15, 2021

IIUC (and I might be uninformed), when both static library .a and dynamic import library .dll.a are present, this change will prioritize the static library, changing current behaviour.

Is that intentional/desirable? From the little I know, some licenses are more strict when statically linking.
Also unintentional dynamic linking (-> missing DLL) seems easier to spot than unintentional static linking (-> DLL shipped but unused).

@Kha
Copy link
Contributor Author

Kha commented Sep 15, 2021

Well, I'd be happy to swap the two. But the current behavior is that first Windows-style .lib static libraries are searched first, which could reasonably be either "true" static libraries or import libraries, so the search order isn't clear to begin with.

Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

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

Needs a test.

Note also this relevant commit: ba12705

These are supposed to be dynamic libraries in this for loop, not static libraries.

@andrewrk
Copy link
Member

Thanks for the patch. I am sorry I did not get around to reviewing it for many months.

I am closing this because it is not merge-ready and it is very old. However, you are welcome to open a new PR if you wish to continue this effort. I think you should first start with an issue to track the use case this is trying to address. This way if the PR is not merged (as in this one) the issue will persist.

@andrewrk andrewrk closed this May 10, 2022
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.

3 participants