Skip to content

Add default cxx link flags to ocamlmklib and ocamlc calls#5185

Merged
voodoos merged 4 commits intoocaml:mainfrom
voodoos:cxx-link-flags
Nov 23, 2021
Merged

Add default cxx link flags to ocamlmklib and ocamlc calls#5185
voodoos merged 4 commits intoocaml:mainfrom
voodoos:cxx-link-flags

Conversation

@voodoos
Copy link
Copy Markdown
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 a user and rgrinberg November 17, 2021 15:25
@voodoos
Copy link
Copy Markdown
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
@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
Copy Markdown
Collaborator Author

voodoos commented Nov 19, 2021

@jeremiedimino I think this is now ready for review

Copy link
Copy Markdown

@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.

Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
@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 <hugo.heuzard@gmail.com>
hhugo added a commit to hhugo/dune that referenced this pull request Dec 14, 2021
Signed-off-by: Hugo Heuzard <hugo.heuzard@gmail.com>
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