How to build small "native binaries without any dependencies"? #19792
Replies: 8 comments 6 replies
-
V compiles to small binaries effectively "without dependencies" by default, though that's not entirely accurate as they still depend on libc (which is already installed on 99.9% of operating systems). If you want an entirely statically linked binary that can run without even libc, you can pass |
Beta Was this translation helpful? Give feedback.
-
What size are you getting? Did you compile with -prod and -d use_openssl? |
Beta Was this translation helpful? Give feedback.
-
libc is not really a dependency, it's a system API only linux supports binaries that are not linked to libc, you can use |
Beta Was this translation helpful? Give feedback.
-
I don't think the homepage should claim that by default (e.g. just compiling with
Because by default, binaries are dynamically linked. It is a fair point that |
Beta Was this translation helpful? Give feedback.
-
I took "Compiles to native binaries without any dependencies" literally, until I read a good answer: "Libc is not a Libc is not a dependency on anything but Linux", which showed me how badly I misunderstood "without any dependencies". Yes, programs running on Windows do not depend on anything Linux, and programs running on Linux do not depend on anything plan9 ... ... It's great that there are no dependencies in the world, let alone "hellish dependencies", and now I feel very relieved. Thanks to the author of this reply. BTW I always thought that the author of the odin language was too far from the truth about v. Now I agree with him, but not with his point of view. |
Beta Was this translation helpful? Give feedback.
-
Oh, why is an http.get request over 4MB?
|
Beta Was this translation helpful? Give feedback.
-
How to compile small, independent (no dependencies) native binaries? |
Beta Was this translation helpful? Give feedback.
-
build 979KB
|
Beta Was this translation helpful? Give feedback.
-
The V homepage says: "Performance - [V] Compiles to native binaries without any dependencies: a simple web server is only about 250 KB"
Are there instructions that explain how to build this 250 KB simple web server?
Or, more generally, are there instructions that explain how to build (hopefully small) native binaries without any dependencies?
Beta Was this translation helpful? Give feedback.
All reactions