-
Notifications
You must be signed in to change notification settings - Fork 234
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
ocloc missing symbols from libigc.so #265
Comments
IGC libraries are being loaded by ocloc using dlopen, see
Can you run ocloc manually with LD_DEBUG=libs environment variable set? |
musl does not implement LD_DEBUG. i'll strace ocloc instead and see what libs it loads. |
what's loaded:
strangely libgic gets loaded, but still i get the same error as in the issue indicated above. however if i add an |
it looks like libigc.so is mapped correctly, as seen in strace:
|
"Error loading the Generic builtin resource" this message came from IGC, see line 951 |
when i run ocloc with
looks the same as in #265 (comment) only it is loaded first, not last |
yes, and it is fixed by linking/preloading libigc to ocloc, i traced that. |
Can you verify IGC was built correctly, linked with builtins? I've observed successful IGC builds although there were problems with builtins. |
llvm::LoadBufferFromResource is failing and returning NULL here: https://github.com/intel/intel-graphics-compiler/blob/67351f4e52f52eb2e4d68a9a40599a77733b5603/IGC/AdaptorOCL/OCL/LoadBuffer.cpp#L59 when libigc is not linked/preloaded by only dlopened |
sure, how do i verify builtins? |
On Ubuntu 20.04 system I've such builtins symbols exported by igc 1.0.3390:
|
confirmed, i have this:
|
It's weird, maybe dlopen works differently on mucl. |
after consulting with the fine people of #musl the suggestion was to add RTLD_GLOBAL to this line: and it seems to work. |
Yeah, I've prepared simple reproducer on alpine, and it looks like RTLD_GLOBAL flag is required to load symbol by dlsym in the library loaded by dlopen.
When I remove RTLD_GLOBAL flag in dlopen, there is error in dlsym to load boo.
The same test works correctly on Fedora without RTLD_GLOBAL flag. |
with a few more minor changes i manage to compile most of it now. however at the "end" i get random errors, like:
the patches i applied to get this far can be seen in: aports-ugly/aports@ee97443 |
i'm happy to either elaborate the patches in this the previous comment in this issue (and then we could rename the issue to something like 'porting to alpine linux') or i can open separate issues for these patches, whatever is more convenient for you. |
howdy,
i'm trying to compile this fine project for alpine linux, during that i ran into a bunch of roadblocks with this (and following issues) i'll try to document and validate my fixes to these. first issue:
fixed by adding igc to the target_link_libraries of the offline_compiler (this patch also adds the libs for the symbols - like backtrace et al - that musl does not provide)
it seems that by linking libigc.so this problem is fixed, but i wonder why is libigc missing at all, is it dynamically loaded, but something goes wrong during that? or is it ok to just at libigc as a target_link_library?
thanks for any insights.
The text was updated successfully, but these errors were encountered: