-
Notifications
You must be signed in to change notification settings - Fork 2
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
Static/Dynamic Linked Libraries (Arch/Ubuntu) #54
Comments
Or, more directly (on Ubuntu 24.04/WSL2), $ make dist
[...]
$ readelf -d dist/jaunch/jaunch-linux-x64
Dynamic section at offset 0x119d70 contains 31 entries:
Tag Type Name/Value
[...]
0x0000000000000001 (NEEDED) Shared library: [libresolv.so.2]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libutil.so.1]
0x0000000000000001 (NEEDED) Shared library: [libcrypt.so.1]
0x0000000000000001 (NEEDED) Shared library: [librt.so.1]
0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000001 (NEEDED) Shared library: [ld-linux-x86-64.so.2]
[...] Searching for why But as best as I can tell
So it might be that the dependency can be dropped by setting the linker flags correctly. The GNU linker has an How to make the Gradle/Kotlin build use that flag I am not sure. |
Thank you @ian-coccimiglio for the detailed writeup, and @marktsuchida for the additional detective work and suggestion on how to fix. I asked an all-knowing LLM (Claude) how to pass |
Tested 95df6e5:
New readelf output from Ubuntu 24.04 build. $ readelf -d jaunch-linux-x64
Dynamic section at offset 0x119da0 contains 28 entries:
Tag Type Name/Value
[...]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [librt.so.1]
0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000001 (NEEDED) Shared library: [ld-linux-x86-64.so.2]
[...] Hooray! |
Glad that worked! As for 3., (assuming that a jaunch built on 20.04 works on 20.04) probably the easiest way to build a binary that works widely is to build using the oldest distribution (docker image) practically possible, selected based on having an older version of glibc (the approach that Python's manylinux takes). |
@marktsuchida Yes, and also |
I wanted to look into one of the questions brought up on image.sc about requiring libcrypt for running Jaunch.
I typically run Manjaro (based on Arch) and I can replicate his problem. Simply installing the libcrypt library solves the issue, but I wanted to do a bit more investigation, so I ran a few VMs to test this.
Tested operating systems:
It seems that all the libraries are .so dynamic libraries. I'm not sure if this is intended behaviour, but it seems very consistent. (Note: I'm realizing that the issue is not that dynamic libraries are used, but rather that they should not be required at run-time).
Some information and straces are below:
Ubuntu 20.04 (failing)
Ubuntu 24.04 (works out of the box)
Manjaro 6.6 (working w/ libcrypt installed via pacman)
The text was updated successfully, but these errors were encountered: