-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Reduce stub-ld build time closure #373776
Comments
There's no particularly compelling reason why it's I agree that for this, it makes sense to do something more basic to reduce the build closure, but it's outside my expertise to do so. |
Old version of nix-ld where using nolibc before it was switch to the rust code base, if you need inspiration. glibcStatic might produce a bigger binary also not quite sure if it would be truly static after that (i.e. there glibc likes to load nss modules in some cases). |
What is the reason for needing it to be statically linked actually? |
Seems like the kernel (I think it's the kernel? My understanding of the roles in this space is hazy) doesn't support chaining ELF interpreters, from what I could tell. I did test if you could use a dynamic binary pointing at a loader in the store, and it didn't work. |
They also need to be relocatable on top of statically linked because the actual elf binary is already mapped when the link-loader is executed. Chaining elf interpreter would be quite difficult to implement since it's unclear what state the first link-loader would left behind before entering the second one. |
@vcunat pointed out in #269551 that due to stub-ld's build-time dependency on pkgsStatic for both 64bit and 32bit, there is a large build-time closure for NixOS tests which is painful for bisecting NixOS tests in staging.
stub-ld is a very simple c-program whose entire purpose it is to print a user-friendly error message when the global dynamic is attempted to be invoked.
I see a few options:
Regardless of these closure minimisations, we should look into disabling stub-ld for every NixOS test but the one which tests stub-ld itself. This really doesn't need to be tested in those as this is only ever invoked with binaries that assume a FHS which you should never find inside a NixOS test and even if you do, this is just a nicer error message.
The text was updated successfully, but these errors were encountered: