Giter Club home page Giter Club logo

Comments (7)

huonw avatar huonw commented on May 20, 2024 3

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.

Arcterus avatar Arcterus commented on May 20, 2024

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.

hexsel avatar hexsel commented on May 20, 2024

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.

nightmared avatar nightmared commented on May 20, 2024

What about shipping a standard library for OS not having rust library and using dynamic linking ?

from coreutils.

nathanross avatar nathanross commented on May 20, 2024

see the issue above for more details on this issue, dynamic linking.

from coreutils.

abique avatar abique commented on May 20, 2024

I like the busybox idea.

from coreutils.

knight42 avatar knight42 commented on May 20, 2024

duplicated #747

from coreutils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.