Build as static binary? #527
-
|
Is it possible to build tinyproxy in an all-static way, so that it can run without OS (only kernel)? If so, how? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
an OS is a kernel, basically. so your question doesnt make sense. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, that worked. ("OS" also contains all the dynamic libraries and much more, so what I meant was "run on an otherwise empty (read-only) filesystem". In Docker lingo, this would be |
Beta Was this translation helpful? Give feedback.
an OS is a kernel, basically. so your question doesnt make sense.
if you have a linux kernel, and a libc other than glibc, you can statically link and run tinyproxy just fine.
for example on my musl-based distro, i just need
LDFLAGS=-static ./configure ; makeand the tinyproxy binary produced will be completely independant of any installed libraries and work on any machine with a recent enough linux kernel and same CPU architecture.if you want to run it on bare metal instead, there's a thing called "root kernel" which you can link into your executable, but i never tried that out.