-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[OCaml] Build OCaml bindings using Dune #67272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
I realized that when I nuked the build directory and tried again, I can't get the build to work again. The reason is that for each backend, there is some implicit dependency on some other e.g.
Edit: However, building a second time always succeeds. It seems that Dune just ignores the failure to generate a |
Fixed the issue. |
This PR still needs some cleanup. Problems of note:
llvm_diagnostic_handler_trampoline
inllvm_ocaml.c
needs to be marked asstatic
or else the linker will produce an error about non-relocatable code. Even though the error message suggests adding-fPIC
, adding this flag doesn't seem to fix the issue. This issue does not happen with the current CMake+OCamlfind build system.if(FALSE) endif()
. What should I do with this?The OCaml unit tests currently pass on my computer (if you build
ocaml_all
and thencheck-llvm-bindings-ocaml
). Therefore, the PR is in a state in which I would appreciate other pairs of eyes to see if this work is on the right track, and if there is possibility that the OCaml bindings could use Dune.