alan-j-hu / llvm-dune

The official LLVM OCaml binding but built using dune
Other
26 stars 3 forks source link

ocamlmklib can be passed unknown flags #5

Open jberdine opened 3 years ago

jberdine commented 3 years ago

The setup.sh script uses llvm-config --ldflags to populate the c_library_flags fields of the generated dune files. These flags then make their way eventually to ocamlmklib.

It is a minor point, but llvm-config --ldflags can include flags such as -Wl,-search_paths_first -Wl,-headerpad_max_install_names which ocamlmklib complains about:

  ocamlmklib llvm-dune/src/linker/shared/dllllvm_linker_shared_stubs.so,llvm-dune/src/linker/shared/libllvm_linker_shared_stubs.a [debug]
Unknown option -Wl,-search_paths_first
Unknown option -Wl,-headerpad_max_install_names

Should the result of llvm-config --ldflags be filtered to keep only the flags that ocamlmklib understands?