-
Notifications
You must be signed in to change notification settings - Fork 36
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
Allow absolute path for library files. #16
Comments
Hmm, seems to work for me:
|
@hexagonal-sun, when I try the example you provided it works fine. When I try it on one of my own shared libs it doesn't: The file is there, but for some reason it wants to search for it as if I typed |
Which, by the way, |
|
Very strange. Looking at the code it first attempts to open the file as written on the command line here and I would have expected this to work. If you could maybe debug this on your end that would be great.
bic doesn't look for libraries in Ideally I need to find out how the system does proper library resolution and follow that. It seems as though |
I'll take a look and get back to you. If I could load a local library file |
@hexagonal-sun, I figured out what the problem is, and it's related to issue #17. I don't have a fix for it right now, but let me tell you what I've found. The library I am testing with, I made a little program that calls bic -l /lib/x86_64-linux-gnu/libm.so.6 -l ./libcolr.so It's a workaround. I wish
This issue, and #17, led me to a couple other features that would be really useful to me, and if I'm able to, I will try to help and make a pull request:
That last feature would enable "startup scripts" for These two things probably need a new issue, but I've already made two in one day and I don't want to flood you with feature requests (especially with no pull-requests to go with them). The thing is, I have been looking for something like TLDR: Issue could probably be renamed: |
Oh yeh, and I was wrong about the |
I just found this, which could possibly help #include <dlfcn.h>
#include <gnu/lib-names.h>
int open_library(char* libname) {
if (strcmp(libname, "m") == 0) {
if (dlopen(LIBM_SO, RTLD_NOW | RTLD_GLOBAL)) {
printf("Loaded libm from lib-names.h: %s\n", LIBM_SO);
return 1;
}
}
// ...fallback to normal behavior.
return 0;
} The It turns out that the linker-script stuff is specific to the linker program, not |
Many thanks for looking at this. I would have thought that
So not too sure exactly what is going on.
I really like this idea and it's a proper fix for #17. I'll cobble something together and push it today. I'm not too sure if this will help opening In regards to the other points you've raised, please feel free to raise issues for them. I think they're great ideas and the ability for Thanks! |
As suggested by @cjwelborn in #16 the above header defines LIBM_SO which is what we should be using when opening -lm. Fixes: #17
I noticed that any library file I use has to be located in the system/global directory. Things like
-l ./libforme.so
are not allowed.-l forme
is not allowed either if the file is in the current directory. It would be nice to at least allow an absolute path to the libraries that are loaded.I'm having other issues with libraries. I'll probably post another report for those.
The text was updated successfully, but these errors were encountered: