Open rofl0r opened 4 years ago
Thank you. I changed libs in c2mir-driver.c and l2mir-driver.c.
thank you, but i don't think the solution is good. afaik musl libc is the only libc which has libm integrated in libc.so. the following works for me:
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>
int main(int a, char**b) {
Dl_info dli;
void *printf_ptr = dlsym(RTLD_NEXT, "printf");
dladdr(printf_ptr, &dli);
printf("%s\n", dli.dli_fname);
void *sinf_ptr = dlsym(RTLD_NEXT, "sinf");
dladdr(sinf_ptr, &dli);
printf("%s\n", dli.dli_fname);
}
in my case it prints /lib/ld-musl-x86_64.so.1
twice. (ld-musl.....so is a symlink to /lib/libc.so, so that's ok)
on ubuntu 16.04. it prints:
/lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libc.so.6
it seems there libc.so contains libm as well.
currently i use the following hack so mir works on my musl-libc based linux distro:
not trying to push for anything, just raising this for consideration purposes.
unrelated, the following hunk removes dependency on LLVM