Incorrect passing of linker options from pkg-config to ocamlmklib
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
This issue is probably similar to #2977, it just adds that the problem may easily arise when using pkg-config.
Expected Behavior
I follow the documentation to compile code with foreign C libraries using pkg-config for options.
Actual Behavior
ocamlmklib emits warnings about link options returned by pkg-config, such as -Wl,--export-dynamic or -fopenmp. I'm not sure about the actual consequences of omitting these options, but I'm guessing the problem I encounter is recurrent when using pkg-config.
Reproduction
pveber/ocaml-r#14 provides more details and a way to reproduce the problem.
Specifications
- Version of
dune(output ofdune --version):
2.7.1
- Version of
ocaml(output ofocamlc --version)
4.11.1
- Operating system (distribution and version):
Ubuntu focal
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ocamlmklib handling described in the issue and reproduce the warning using the pveber/ocaml-r#14 example with pkg-config. Compare the linker options returned by pkg-config, including -Wl,--export-dynamic and -fopenmp, with the options ocamlmklib accepts. Done means the options are passed correctly without warnings and the reproduction works on the stated Dune and OCaml versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100