-
Notifications
You must be signed in to change notification settings - Fork 414
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
Using findlib.dynload
shouldn't imply -linkall
for executables.
#4957
Comments
It is true, but it is more general than
My reason is that I don't know how to give the possibility to load any library reliably without using (In the readme of the project as example the last line |
NB: ocamlfind adds |
Maybe we can discuss this in the call, or sorry if I'm slow, but where is linkall needed exactly? Is it because you need to initialize the table with modules present in the executable? The way I understand it, an executable with plugins will call cc: @gerdstolpmann as per the -linkall comment for ocamlfind. |
You should define the "what":
Currently we have |
I see thanks, so that's the (only) reason then we need to use |
Yes, but still finding which modules are really linked is not trivial either, just less impossible currently. On the non technical part, I mentioned previously that linking part of a library later can create subtile bugs because the developers of a library would have to take into account different execution order of its module units. |
I guess if the library does support that, they authors will have to provide some kind of commutativity. That's actually the reason I was trying to get rid of linkall in all my developments [in particular for Coq] because it is pretty fragile as of today. I will upstream the discussion to see what happens, but my feeling is that likely this will end on a documentation issue. |
Can you elaborate why it is fragile? For me, using linkall for plugins makes things more robust because we are using them in only one way, not many. |
Is there a way to disable the auto linkall? For instance |
We could add that, but can you explain a bit more what you are trying to do @SkySkimmer ? Note that if you don't use The problem comes because findlib / the build system won't understand what modules were effectively linked into an executable. Thus imagine, you have library Then you have plugin |
Dropping dynload only works if you have sufficiently fine grained libraries. |
Yes, the more knowledge you have the more precise you can be with dependencies. In this all build systems are always over-approximations. I think the solution we did for coq/coq#16678 is much better than hacking the flags in this way which requires manual code inspection and maintenance. |
This is a follow up from #4348
Take the project at https://github.com/ejgallego/dune-bug-dynload
I see no reason why adding
findlib.dynload
to the(libraries ...)
field should imply-linkall
. Moreover, this can be problematic for some libraries, and tends to create huge executables.cc: @bobot
The text was updated successfully, but these errors were encountered: