-
Notifications
You must be signed in to change notification settings - Fork 12
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
Missing symbols: dlopen
, dlclose
, posix_fallocate
#44
Comments
Yes; C-style dynamic linking is indeed missing. It's not something I need for my own current projects, so I haven't mapped out what an implementation would look like. @bjorn3 recently added startup support, but full C-style dynamic linking support would also involve ELF file parsing and loading, relocations processing, dynamic thread-local storage, and possibly more. |
I've been chipping away at getting musl's dynamic linker work with eyra. I've got a working prototype of it already. (see the dynlink branches on my forks of eyra, origin and c-ward. be aware that I force push to them frequently.) There are still several issues with it though. Most of the changes I have done/need to do are things that are almost certainly necessary for a pure rust dynamic linker too. |
@bjorn3 wow that's actually pretty nice! You're doing a lot of useful work; hopefully I might get involved too. @sunfishcode As for elf parsing and storing, there are actually a lot of libraries dedicated to just that. |
Hi sunfish!
After all the fixes I proposed to get eyra and mustang to work, my tiny miniquad project is still incapable of compiling because
dlopen
,dlclose
andposix_fallocate
are all missing. Unfortunately after careful reading I've noticed that dynamic linking is still completely unsupported, so the chance of getting any project involving miniquad or similar crates that bind to system libraries is very minimal. That said,posix_fallocate
doesn't seem related to dynamic linking at all, so at least that could be a starting point.If I get time, I might look onto the dynamic linking implementation and see what can I do, but until then my most useful contribution will be this issue.
Notes
posix_fallocate
is defined infcntl.h
dlopen
,dlclose
and all the otherdlfcn.h
functions are already defined in rust insiderelibc
.Unfrotunately, I haven't studied the project enough, and something tells me that dynamic linking is quite a bit more challenging to implement than just those functions (I would really love to know what's missing to actually make dynamic linking work), but at least we have a publicly available pure rust implementation as a starting point.
The text was updated successfully, but these errors were encountered: