Linker flags vs. libraries
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
I am trying to build a couple of projects for the Fedora Linux distribution. These projects use dune to build. Fedora mandates that certain flags be passed to the linker (e.g., -Wl,-z,relro and -Wl,--as-needed). I cannot seem to find the correct way to do this. If I pass these flags along with the libraries to be linked with in c_library_flags, then the cmxs files are appropriately linked, but the stub libraries generated with ocamlmklib are not. In fact, ocamlmklib emits "Unknown option" warnings. What I need is some way to specify linker flags, which have to be guarded with -ldopt when passed to ocamlmklib, separately from the libraries to be used for linking. Does dune provide some way of doing this?
This seems to be related to #119.
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 by reading how dune handles c_library_flags and how ocamlmklib receives options, then review the related discussion in issue #119. The change is complete when linker flags such as -Wl,-z,relro can be specified separately from libraries and are passed correctly to both cmxs linking and generated stub libraries without Unknown option warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100