-
Notifications
You must be signed in to change notification settings - Fork 1k
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 build warning: Is the compiled binary truly statically linked? #7938
Comments
@xuegege5290 you're right. We require a runtime glibc because of some cgo related dependencies. Alternatively we could build using musl libc, but that's something we decided against a few years ago. |
|
Can you please provide detailed information on the discussion about compiling with musl-libc? I still want to give it a try. |
Unfortunately not, but you can try it by using the nix musl cross compilation like: rec {
pkgs = (import <nixpkgs> {}).pkgsMusl;
# ...
} |
A friendly reminder that this issue had no activity for 30 days. |
What happened?
I want to compile cri-o into a statically linked binary, but there are some warnings. The resulting statically linked binary still depends on the glibc library on the host side.
When compiling a program or project into a statically linked binary, the goal is typically to include all dependencies within the binary itself, thereby eliminating the need for external dependencies on the host system. However, in my case, it appears that despite the attempt to build a statically linked binary, there are still dependencies on the glibc library from the host system.
the way use the nix build:
the warning like below:
i try to build by myself,it still has the warning:
warning:
What did you expect to happen?
Is there a way to eliminate these warnings, and if a statically compiled binary has these warnings, it is not truly statically linked, right?
How can we reproduce it (as minimally and precisely as possible)?
The issue can be reproduced in any environment.
Anything else we need to know?
the moby project long before has the problem ,bu it can choose to ignore
https://github.com/moby/moby/blob/ceb9e244d934d87104b7e4e0032f1d389e47fd64/hack/make/.binary#L30
CRI-O and Kubernetes version
OS version
Additional environment details (AWS, VirtualBox, physical, etc.)
The text was updated successfully, but these errors were encountered: