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
ocamlc -custom should not link to curses #6735
Comments
Comment author: @damiendoligez AFAIK it links to curses because the standard runtime interfaces with some curses stuff, because the toplevel depends on it. I agree it would be nice to get rid of this dependency. |
Comment author: @whitequark Yes. So if toplevel could Dynlink the curses library, this dependency would be removed. This is another good argument for having Dynlink in stdlib. |
Comment author: Camarade_Tux Dynamic loading would be nice but I think another way would be to move $curseslibs from $BYTECCLIBS and only add it when linking the Terminfo module (which is clearly separated in utils/ btw). Note that this would solve #7164 "missing -ltinfo when linking bytecode with -custom". Also note that doing so would need an update to the manual as a consequence of #4920 |
Comment author: @whitequark @Camarade_Tux That would require making the toplevel, (I think) bytecode compiler, etc, use a custom runtime. I assume there's a reason for them not to, but I don't know for sure. |
Comment author: Camarade_Tux Hmmm, true, that requires some more care than I had thought at first. I'll try to take a look at it, I'm still quite confident it can be done and this dependency is quite annoying. |
Comment author: Camarade_Tux I took a stab at it on yesterday and stopped after it became likely that it would involve bootstrapping the compiler. The idea was to make a separate Terminfo.cma that would pull a .so for the stubs. There would be no more mention of curses in ocamlrun itself. I was able to build the compiler but not the standard library. One issue I met involved the -use-prims flag which is undocumented and I didn't feel like spending a lot of time understanding it. It is indeed fairly annoying. I also noticed that it could creep into files in boot/ so it probably makes sense to build with -no-curses before bootstrapping the compiler. |
Comment author: @xavierleroy Pull request coming soon. |
Comment author: @xavierleroy See pull request at #1431 |
Comment author: @xavierleroy PR merged, will be in 4.07 |
Original bug ID: 6735
Reporter: @whitequark
Assigned to: @xavierleroy
Status: resolved (set by @xavierleroy on 2017-11-26T15:02:43Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.07.0+dev/beta2/rc1/rc2
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: runtime system and C interface
Related to: #6696 #7164
Monitored by: @hcarty
Bug description
Why does it link to curses, actually? That doesn't make sense, and I couldn't find any place this would be explained.
The text was updated successfully, but these errors were encountered: