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

Support linking crates in JIT #3331

Closed
z0w0 opened this issue Sep 1, 2012 · 4 comments
Closed

Support linking crates in JIT #3331

z0w0 opened this issue Sep 1, 2012 · 4 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@z0w0
Copy link
Contributor

z0w0 commented Sep 1, 2012

LLVM's dynamic library API is giving hassles, so it might come down to using libuv's dynamic library API. @brson said it would be OK to use libuv, but preferably try and get LLVM's API working first.

The code that should work is commented out in rustc/back/link.rs and RustWrapper.cpp if anyone wants to help debug what's going wrong.

@brson
Copy link
Contributor

brson commented Sep 1, 2012

Does the version of libuv we currently have in the tree have the dynamic linking features you need, or do we need to upgrade? If we use libuv, let's expose the dynamic linking bindings in std, then use them in rustc (vs linking rustllvm to uv).

@z0w0
Copy link
Contributor Author

z0w0 commented Sep 2, 2012

Although it turns out that the issue wasn't with LLVM's API but rather libdl, I'd suggest bumping up libuv, because the version in the tree doesn't support getting an error message (so if you wanted to have an API around it in std, it couldn't have error messages).

@z0w0
Copy link
Contributor Author

z0w0 commented Sep 11, 2012

I recently got a new x86_64 computer (my old laptop was x86). Seems to link crates fine now with this commit, but I'm getting an assertion about x86_64 addresses. Not sure if it's related, but I'll look into it.

@brson
Copy link
Contributor

brson commented Sep 27, 2012

This is the assert it's tripping: http://llvm.org/docs/doxygen/html/RuntimeDyldELF_8cpp_source.html#l00221
And this is the stack trace: http://pastebin.com/raw.php?i=MUEJfx5a

Thanks to z0w0

@z0w0 z0w0 closed this as completed Oct 3, 2012
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this issue Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

2 participants