-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Build: "--fully-static" configure option is broken #41497
Comments
FWIW if you're using glibc, you'll never get a truly fully static build. You will need to build against a different libc like musl to get that. I've cross compiled a fully static node with musl in the past with success, but I have not tried with recent node branches. |
That's not correct. I have managed to build fully static binaries with glibc using v11.15.0, for instance:
Apparently this feature broke on v12 and was never really fixed since then. |
What does |
|
There's probably a second issue with the |
current workaround: cd to |
Thanks for the suggestion! Now I am facing another (3rd!?) issue, probably related to the static-pie feature present on glibc versions => 2.27.
|
yes, you also need to fix |
and the manual run has no drawbacks since it just builds |
Thanks!!! I have then written a scripted workaround for this build, which works for v16 and v17:
Which did result in a fully-static binary:
Since as you mentioned, these programs are only built to generate another .cpp file, therefore are not part of the actual build, there shouldn't be any drawbacks, however, I am not sure what could be a definitive fix to this. Perhaps the build system needs to be patched in order not to pass "-static" (or any other 'runtime' flags) to the helper programs. The other approach would be to investigate the segfault on such binaries when they are built with -static. |
Thank you very much for the script @emerzon ! |
* fix: fix static build of node See: nodejs/node#41497 (comment) * chore: make apt-get quiet
Closing, bug report against EOL version. |
Version
Affects all versions from 12.x to 17.3.1
The test below was done with 16.13.2.
Platform
Linux sagan-02 5.13.0-23-generic #23-Ubuntu SMP Fri Nov 26 11:41:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
./configure --fully-static; make -j8
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
No response
What do you see instead?
Additional information
Somehow seems that the "-shared" flag gets out to the above line when it shouldn't.
The text was updated successfully, but these errors were encountered: