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

Make -lgcc_eh on mingw-w64 optional #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Nov 22, 2024

Should fix #133. As noted in ocaml/ocaml#12996, there are configurations where -lgcc_eh isn't available (and therefore required). The change is simply to resolve -lgcc_eh and only add it to default_libs if it's actually found - although it's a slightly noisier change than that simplicity implies!

Some configurations of mingw-w64 gcc don't use -lgcc_eh - treat it as an
optional library.
@dra27
Copy link
Member Author

dra27 commented Nov 22, 2024

@toots - no particular rush, but if you have a chance to confirm that this allows the patch you carry in opam-cross-windows to be removed, that'd be great.

@toots
Copy link
Contributor

toots commented Nov 22, 2024

Hi @dra27. The changes in ocaml/ocaml#12996 are actually the patch used by the cross-compiler so it can already be dropped.

I'm not sure that I understand the difference with this PR or what additional change this PR is doing? gcc_eh was still mentioned in the compilation workflow somehow?

@dra27
Copy link
Member Author

dra27 commented Nov 22, 2024

Ah, have I misunderstood the problem - I thought the issue was that there wasn't any libgcc_eh.a at all, so -lgcc_eh was failing. The change here is that it tries to see if there is an -lgcc_eh. Am I missing something about the failure mode that was being detected before?

@dra27
Copy link
Member Author

dra27 commented Nov 22, 2024

@toots
Copy link
Contributor

toots commented Nov 22, 2024

Isn't this patch https://github.com/ocaml-cross/opam-cross-windows/blob/main/packages/flexdll-windows/flexdll-windows.0.42/files/patches/no-gcc_eh.patch still in use, though?

Ho, different one! I was looking at the patch on OCaml: https://github.com/ocaml-cross/opam-cross-windows/blob/main/packages/ocaml-windows64/ocaml-windows64.5.1.1/files/patches/configure.patch

Then, yes, this looks like it will allow us to remove the patch on flexdll. I should be able to test this soon, thanks!

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.

Conditionally link with gcc_eh
2 participants