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

Add lgamma_r and lgammaf_r to MinGW #546

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

ankane
Copy link
Contributor

@ankane ankane commented Jul 31, 2023

Sorry for the many PRs. Looks like it's missing from MinGW (*-pc-windows-gnu and *-pc-windows-gnullvm) as well (rust-lang/rust#99747 (comment)).

Another source

@workingjubilee
Copy link
Member

workingjubilee commented Jul 31, 2023

Can't we redesign this cfg so that it is available by default and then rearrange it to used an "optimized" form on some platforms instead?

@ankane
Copy link
Contributor Author

ankane commented Jul 31, 2023

I'm not exactly sure how it would work (would need to prevent duplicate symbol errors), but maybe others have ideas

@workingjubilee
Copy link
Member

Mmm, something something weak linking?

@Amanieu
Copy link
Member

Amanieu commented Aug 1, 2023

We have support for generating weak symbols (via -Z build-std-features=compiler-builtins-weak-intrinsics), but it seems to be broken on mingw: rust-lang/rust#113822

@Amanieu Amanieu merged commit 9b4c16d into rust-lang:master Aug 7, 2023
21 checks passed
@ankane
Copy link
Contributor Author

ankane commented Aug 7, 2023

Thanks @Amanieu!

@mati865
Copy link

mati865 commented Aug 8, 2023

Weak symbols on Windows with ld.bfd are a can of worms.
Generally you can expect them to rather work as long as you are combining static archives with weak symbols into one final binary/library. Trying to do the same with shared libraries might work for simplest cases but generally think of it as broken.
You may have more luck with __declspec(selectany) but it will use more COMDATs which Windows limits to 2^16.

LLD is has working weak symbols (in both static and shared cases) but we cannot use it because of another Binutils bug import libraries created by LLD break symbol table with Binutils <2.40.

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.

4 participants