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

ocamlc -custom should not link to curses #6735

Closed
vicuna opened this issue Dec 28, 2014 · 9 comments
Closed

ocamlc -custom should not link to curses #6735

vicuna opened this issue Dec 28, 2014 · 9 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Dec 28, 2014

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.

@vicuna
Copy link
Author

vicuna commented Jan 6, 2015

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.

@vicuna
Copy link
Author

vicuna commented Jan 13, 2015

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.

@vicuna
Copy link
Author

vicuna commented Nov 11, 2016

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

@vicuna
Copy link
Author

vicuna commented Nov 11, 2016

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.

@vicuna
Copy link
Author

vicuna commented Nov 11, 2016

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.

@vicuna
Copy link
Author

vicuna commented Nov 13, 2016

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.

@vicuna
Copy link
Author

vicuna commented Oct 15, 2017

Comment author: @xavierleroy

Pull request coming soon.

@vicuna
Copy link
Author

vicuna commented Oct 16, 2017

Comment author: @xavierleroy

See pull request at #1431

@vicuna
Copy link
Author

vicuna commented Nov 26, 2017

Comment author: @xavierleroy

PR merged, will be in 4.07

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

No branches or pull requests

2 participants