ocaml / ocaml/dune

Incorrect passing of linker options from pkg-config to ocamlmklib

Open
#3,868 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

acknowledged
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 of dune --version):
2.7.1
  • Version of ocaml (output of ocamlc --version)
4.11.1
  • Operating system (distribution and version):
    Ubuntu focal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.