Skip to content

Commit

Permalink
Merge pull request #1526 from mbrubeck/lto
Browse files Browse the repository at this point in the history
Size optimizations: Build with LTO and alloc_system
  • Loading branch information
alexcrichton authored Nov 5, 2018
2 parents c637d44 + 8ac86d9 commit 75213a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@ test = false # no unit tests
name = "rustup-init"
path = "src/rustup-cli/main.rs"
test = false # no unit tests

[profile.release]
lto = true
codegen-units = 1
5 changes: 5 additions & 0 deletions src/rustup-cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,17 @@ mod term2;
mod errors;
mod help;

use std::alloc::System;
use std::env;
use std::path::PathBuf;
use errors::*;
use rustup_dist::dist::TargetTriple;
use rustup::env_var::RUST_RECURSION_COUNT_MAX;

// Always use the system allocator, to reduce binary size.
#[global_allocator]
static _ALLOCATOR: System = System;

fn main() {
if let Err(ref e) = run_rustup() {
common::report_error(e);
Expand Down

0 comments on commit 75213a2

Please sign in to comment.