Closed slashbeast closed 1 year ago
Looks like it can be quick hacked after all, by passing 'LDFLAGS="-all-static" as make's argv rather than setting LDFLAGS as environmental variable, as this would break configure tests, and '-all-static' is libtool flag.
./configure
make LDFLAGS="-all-static"
Seems to work just fine.
Thank you for the report, can you provide a PR to get this info documented?
I am closing the issue, in case you decide to provide a PR, that will be welcomed
I have a really niche use case where I need udev inside initramfs, that does not came with libc or really much else. For that I build and link everything statically against musl libc using Alpine Linux as build root.
I did a quick check on it and while building with LDFLAGS='-static' I see that it kind of work like I wanted it to, but not really.
taking udevd as example:
It does link with static libudev-core, which is good, but the binary itself remain dynamic. if I drop 'udevd' and manually execute the gcc at linking phase adding '-static'
I do indeed get fully statically linked executable that I can transfer to glibc system and have it run there
Would that be possible for you to add '--enable-static_link' or another option that would produce all the executables really static?