Skip to content
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

Statically link executables #186

Open
Familex opened this issue Aug 13, 2024 · 0 comments
Open

Statically link executables #186

Familex opened this issue Aug 13, 2024 · 0 comments

Comments

@Familex
Copy link

Familex commented Aug 13, 2024

Here is ldd ./client_backend of version 0.1.0 on my machine:

$ ldd ./client_backend
	linux-vdso.so.1 (0x00007f7de8fe9000)
	libssl.so.3 => not found
	libcrypto.so.3 => not found
	libgcc_s.so.1 => /nix/store/dffyikn59cy7fff2qd60gs9jl63szqnh-xgcc-13.3.0-libgcc/lib/libgcc_s.so.1 (0x00007f7de8fbe000)
	libm.so.6 => /nix/store/0wydilnf1c9vznywsvxqnaing4wraaxp-glibc-2.39-52/lib/libm.so.6 (0x00007f7de8ed8000)
	libc.so.6 => /nix/store/0wydilnf1c9vznywsvxqnaing4wraaxp-glibc-2.39-52/lib/libc.so.6 (0x00007f7de7e09000)
	/lib64/ld-linux-x86-64.so.2 => /nix/store/0wydilnf1c9vznywsvxqnaing4wraaxp-glibc-2.39-52/lib64/ld-linux-x86-64.so.2 (0x00007f7de8feb000)

Such undocumented and unbundled dependencies could lead to unexpected results (e.g. systems old glibc can throw version errors).

Usually such standalone binaries or links statically or packaged as AppImage.

And my NixOs can't run it out of the box for the same reasons (solvable, but requires setup):

$ ./client_backend
Could not start dynamically linked executable: ./client_backend
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant