-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
zig cc: Cannot load shared library cross-compiled to arm-linux-gnueabihf #11471
Comments
please include text of program in issue instead of the gist |
This issue seems very related: https://youtrack.jetbrains.com/issue/KT-41725 I tried to collect information about the ABI headers for things compiled by zig and it seems to be exactly the same situation as in that ticket.
Also as in that ticket the culprit seems to be
|
I do not really understand the compilation process, but this might be related to #10411, since I also found out that
This doesn't seem to be enough, though, as the library still cannot be loaded. |
Some more cases with the same(?) problem:
These suggest that the problem is an incompatibility between LLVM tools and
I am indeed trying to run the library on an old Ubuntu 16.04 system, but did not have a chance yet to check if the problem disappears with a newer system. |
Zig Version
0.9.1
Steps to Reproduce
Compile the program in this gist: https://gist.github.com/saierd/3ee0a898ae7fa5b469e53536851cb39c
lib.cpp
:main.cpp
:Build:
Expected Behavior
Program should run on an ARM device.
Actual Behavior
Without the dynamic library
If I remove the dynamic library from the test program (just a hello world) everything works fine. The program runs in QEMU as well as on the actual device, even though there are some strange things happening on the device:
ldd a.out
outputsnot a dynamic executable
./lib/ld-linux-armhf.so.3 --verify a.out
returns 1.With the dynamic library
ldd
andld --verify
are the same as above for botha.out
andlibtest.so
.I tried to debug what happens with
LD_DEBUG
andstrace
and this is what I found out:libtest.so
and tries to open it.strace
shows that some parts of the file get read:/etc/ld.so.nohwcap
exists, this removes some of the paths that were searched previously and theaccess
no longer fails:I know that this is probably difficult to debug without actual hardware. Do you have any idea for how I could investigate this further?
The text was updated successfully, but these errors were encountered: