Skip to content
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

(byte shared_object) linking mode does not allow linking C stubs #7800

Open
nojb opened this issue May 24, 2023 · 0 comments
Open

(byte shared_object) linking mode does not allow linking C stubs #7800

nojb opened this issue May 24, 2023 · 0 comments

Comments

@nojb
Copy link
Collaborator

nojb commented May 24, 2023

From #7789 (comment):

Actually, I misremembered: it is possible to build a shared_object out of bytecode by using (modes (byte shared_object)), sorry for the confusion (this is explained in the manual: https://dune.readthedocs.io/en/latest/dune-files.html#linking-modes

Not exactly. (byte shared_object) doesn't allow to link C stubs:

74 | (executable
75 |  (name xxx)
76 |  (modes (byte shared_object))
....
95 |  )
96 |  (flags)
97 | )
Error: Pure bytecode executables cannot contain foreign stubs.
Hint: If you only need to build a native executable use "(modes exe)".

Interestingly, (modes shared_object) works with ocamlc for an executable with C stubs (when ocamlopt is not available). Maybe the error above is just a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant