Comments (7)
This is 100% a compiler & standard library issue; the smallest one can get a statically linked executable that uses std
is basically 700KB, even with optimisations on, LTO and stripping.
Work-arounds include:
- dynamic linking (compile with
-C prefer-dynamic
), - a busybox-style unified binary that includes all the tools internally, and dispatches based on the name with which it was called, to amortize the overhead across everything,
- not using the standard library.
from coreutils.
I don't think there's a whole lot we can do. I mean, we could strip unneeded symbols after compilation, but that doesn't really solve the problem (the binaries would still be huge). IMO, the best we can hope for is the Rust compiler eventually generating smaller binaries.
from coreutils.
On the current version of the project, most binaries end up between 271kB - 471kB (stripping on, LTO off due to this bug).
Is there a need to make this any smaller?
rustc 1.4.0-nightly (63ba780fd 2015-08-23)
OSX 10.10.4
from coreutils.
What about shipping a standard library for OS not having rust library and using dynamic linking ?
from coreutils.
see the issue above for more details on this issue, dynamic linking.
from coreutils.
I like the busybox idea.
from coreutils.
duplicated #747
from coreutils.
Related Issues (20)
- seq: different output when comparing with GNU HOT 1
- seq: different output for `seq --format=d%030g 12` HOT 1
- fuzzing/printf: exit code differs HOT 2
- `tests`: Provide a way to run tests with PTY stdout
- `cksum -a blake2b .` should generate an error
- cut: different output with -d
- Useless GH actions for cache in FreeBSD workflow HOT 2
- cksum: show error if a directory is specified HOT 4
- `printf`: use correct octal prefix
- cksum: stops when one of given files doesn't exist HOT 4
- Printf: Alternative hex fails with a 0 value
- printf: infinite loop
- Failed to run `cargo build --release` on Termux HOT 1
- `coreutils rm -f` fails with read-only files on Windows HOT 1
- `printf` should print a byte instead of a char HOT 1
- Cannot recognize `~` in Windows HOT 6
- Discrepancy in output length with special characters HOT 3
- uucore: warning for clippy::if_not_else in features/format/num_format.rs HOT 4
- echo is ignoring -- char HOT 1
- unexpand: show error message if a directory is specified HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coreutils.