Skip to content
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

Add note about cross compiling via nightly #45

Closed
Noxsios opened this issue Oct 20, 2022 · 2 comments
Closed

Add note about cross compiling via nightly #45

Noxsios opened this issue Oct 20, 2022 · 2 comments

Comments

@Noxsios
Copy link

Noxsios commented Oct 20, 2022

It is possible to cross compile w/ the +nightly targets.

ex.

rustup +nightly target add x86_64-unknown-linux-musl
cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort \
    --target x86_64-unknown-linux-musl --release

Will work, this can be added as an addendum to the Optimize libstd and Remove Panic String sections.

Discovered from: rust-lang/wg-cargo-std-aware#76

@johnthagen
Copy link
Owner

Thanks for the post.

Does cross compiling in some way reduce the final binary size? While a great feature, my goal is to keep min-sized-rust focused exclusively on binary size reduction techniques rather than trying to mention all possible Rust features.

@Noxsios
Copy link
Author

Noxsios commented Oct 20, 2022

AFAIK, compiling for aarch64-apple-darwin (M1 Mac) binaries are slightly smaller, but not by a substantial amount. Just wanted to add this addendum for people looking to cross compile while also running your provided flags.

@Noxsios Noxsios closed this as completed Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants