Thank you for sharing your solutions.
Despite those scary PIC/PIE related linker errors, my problem was of a completely different nature and I was way, way off-track. My global (env (_ (ocamlopt_flags (:standard -ccopt -static))))
was applied to (executable)
and (library)
items by Dune. Building the libraries in my project is what failed; the executables were fine the whole time as it turns out, and my musl.cc
installation was fine as well.
The solution was thus to remove my global (env)
and to copy the -ccopt -static
boilerplate into each individual (executable)
. And thanks to the full Musl GCC installation, my final switch is merely a “vanilla” +flambda
, no need to edit compiler build flags or any notion of PIC/PIE at all.
Talk about searching in the wrong direction… Now I can finally start the work I wanted to tackle Monday morning.