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 default cxx link flags to ocamlmklib and ocamlc calls #5185

Merged
merged 4 commits into from
Nov 23, 2021

Conversation

voodoos
Copy link
Collaborator

@voodoos voodoos commented Nov 17, 2021

In Dune 3.0 the option use_standard_c_and_cxx_flags will be enabled by default.
However an issue exist with the current implementations: all the default flags were provided at compile time and none during the link. Discussion about that issue can be found in PR #4846.

This PR fixes that by adding link time flags like -lstdc++ or -shared-libgcc (depending on the detected compiler) to
ocamlmklib and ocamlc/opt invocations when one or more stubs is in C++.

CC @recoules

@voodoos voodoos requested review from rgrinberg and a user November 17, 2021 15:25
@voodoos
Copy link
Collaborator Author

voodoos commented Nov 17, 2021

I feel like this should ship with 3.0. I add the milestone.

@voodoos voodoos added this to the 3.0.0 milestone Nov 17, 2021
src/dune_rules/cxx_flags.ml Outdated Show resolved Hide resolved
@voodoos voodoos force-pushed the cxx-link-flags branch 2 times, most recently from 2156361 to 2f00ba6 Compare November 19, 2021 09:33
@voodoos
Copy link
Collaborator Author

voodoos commented Nov 19, 2021

@jeremiedimino I think this is now ready for review

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM.

src/dune_rules/exe_rules.ml Outdated Show resolved Hide resolved
@voodoos voodoos merged commit 855b085 into ocaml:main Nov 23, 2021
@hhugo hhugo mentioned this pull request Dec 2, 2021
2 tasks
hhugo added a commit to hhugo/dune that referenced this pull request Dec 14, 2021
Signed-off-by: Hugo Heuzard <[email protected]>
hhugo added a commit to hhugo/dune that referenced this pull request Dec 14, 2021
Signed-off-by: Hugo Heuzard <[email protected]>
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.

1 participant