Skip to content

Commit 693ec73

Browse files
committed
auto merge of #10747 : alexcrichton/rust/snapshots, r=cmr
This registers new snapshots after the landing of #10528, and then goes on to tweak the build process to build a monolithic `rustc` binary for use in future snapshots. This mainly involved dropping the dynamic dependency on `librustllvm`, so that's now built as a static library (with a dynamically generated rust file listing LLVM dependencies). This currently doesn't actually make the snapshot any smaller (24MB => 23MB), but I noticed that the executable has 11MB of metadata so once progress is made on #10740 we should have a much smaller snapshot. There's not really a super-compelling reason to distribute just a binary because we have all the infrastructure for dealing with a directory structure, but to me it seems "more correct" that a snapshot compiler is just a `rustc` binary.
2 parents 69186ef + acc5e32 commit 693ec73

File tree

18 files changed

+23
-94
lines changed

18 files changed

+23
-94
lines changed

Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ endif
134134
# static copies of libstd and libextra. We also generate dynamic versions of all
135135
# libraries, so in the interest of space, prefer dynamic linking throughout the
136136
# compilation process.
137+
RUSTFLAGS_STAGE0 += -Z prefer-dynamic
137138
RUSTFLAGS_STAGE1 += -Z prefer-dynamic
138139
RUSTFLAGS_STAGE2 += -Z prefer-dynamic
139140
RUSTFLAGS_STAGE3 += -Z prefer-dynamic

src/libextra/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ Rust extras are part of the standard Rust distribution.
3232

3333
#[comment = "Rust extras"];
3434
#[license = "MIT/ASL2"];
35-
#[crate_type = "lib"]; // NOTE: remove after stage0 snapshot
3635
#[crate_type = "rlib"];
3736
#[crate_type = "dylib"];
3837

3938
#[feature(macro_rules, globs, managed_boxes)];
4039

4140
#[deny(non_camel_case_types)];
4241
#[deny(missing_doc)];
43-
#[allow(attribute_usage)]; // NOTE: remove after the next snapshot
4442

4543
use std::str::{StrSlice, OwnedStr};
4644

src/libextra/unicode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub mod icu {
161161
use unicode::icu::*;
162162

163163
// #[link_name = "icuuc"]
164-
#[link_args = "-licuuc"]
164+
#[link(name = "icuuc")]
165165
extern {
166166
pub fn u_hasBinaryProperty(c: UChar32, which: UProperty) -> UBool;
167167
pub fn u_isdigit(c: UChar32) -> UBool;

src/librustc/front/feature_gate.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ impl Visitor<()> for Context {
113113

114114
fn visit_item(&mut self, i: @ast::item, _:()) {
115115
for attr in i.attrs.iter() {
116-
if "thread_local" == attr.name() &&
117-
cfg!(stage0, remove_this_on_next_snapshot) { // NOTE: snap rem
116+
if "thread_local" == attr.name() {
118117
self.gate_feature("thread_local", i.span,
119118
"`#[thread_local]` is an experimental feature, and does not \
120119
currently handle destructors. There is no corresponding \
@@ -136,8 +135,7 @@ impl Visitor<()> for Context {
136135
}
137136

138137
ast::item_foreign_mod(..) => {
139-
if attr::contains_name(i.attrs, "link_args") &&
140-
cfg!(stage0, remove_this_on_next_snapshot) { // NOTE: snap
138+
if attr::contains_name(i.attrs, "link_args") {
141139
self.gate_feature("link_args", i.span,
142140
"the `link_args` attribute is not portable \
143141
across platforms, it is recommended to \

src/librustc/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616

1717
#[comment = "The Rust compiler"];
1818
#[license = "MIT/ASL2"];
19-
#[crate_type = "lib"]; // NOTE: remove after stage0 snapshot
2019
#[crate_type = "dylib"];
2120

2221
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
23-
#[allow(attribute_usage)]; // NOTE: remove after the next snapshot
2422

2523
extern mod extra;
2624
extern mod syntax;

src/librustc/lib/llvm.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,7 @@ pub mod llvm {
306306
use std::libc::{c_char, c_int, c_longlong, c_ushort, c_uint, c_ulonglong,
307307
size_t};
308308

309-
#[cfg(stage0)]
310-
#[link_args = "-lrustllvm"]
311-
extern {}
312-
#[cfg(not(stage0))] // if you're deleting this, put this on the block below
313309
#[link(name = "rustllvm")]
314-
extern {}
315-
316310
extern {
317311
/* Create and destroy contexts. */
318312
pub fn LLVMContextCreate() -> ContextRef;

src/librustdoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#[desc = "rustdoc, the Rust documentation extractor"];
1818
#[license = "MIT/ASL2"];
19-
#[crate_type = "lib"]; // NOTE: remove after stage0 snapshot
2019
#[crate_type = "dylib"];
2120

2221
#[feature(globs, struct_variant, managed_boxes)];

src/librustpkg/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
url = "https://github.com/mozilla/rust/tree/master/src/librustpkg")];
1818

1919
#[license = "MIT/ASL2"];
20-
#[crate_type = "lib"]; // NOTE: remove after stage0 snapshot
2120
#[crate_type = "dylib"];
2221

2322
#[feature(globs, managed_boxes)];

src/librustuv/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ via `close` and `delete` methods.
4141
url = "https://github.com/mozilla/rust/tree/master/src/librustuv")];
4242

4343
#[license = "MIT/ASL2"];
44-
#[crate_type = "lib"]; // NOTE: remove after stage0 snapshot
4544
#[crate_type = "rlib"];
4645
#[crate_type = "dylib"];
4746

4847
#[feature(macro_rules, globs)];
49-
#[allow(attribute_usage)]; // NOTE: remove after the next snapshot
5048

5149
use std::cast::transmute;
5250
use std::cast;

src/librustuv/uvll.rs

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -524,15 +524,11 @@ pub unsafe fn guess_handle(handle: c_int) -> c_int {
524524
// second copies of everything. We obviously don't want this, so instead of
525525
// dying horribly during testing, we allow all of the test rustuv's references
526526
// to get resolved to the original rustuv crate.
527-
#[cfg(not(test), not(stage0))]
527+
#[cfg(not(test))]
528528
#[link(name = "uv_support", kind = "static")]
529529
#[link(name = "uv", kind = "static")]
530530
extern {}
531531

532-
#[cfg(not(test), stage0)]
533-
#[link_args = "-luv -luv_support"]
534-
extern {}
535-
536532
extern {
537533
fn rust_uv_loop_new() -> *c_void;
538534

@@ -722,26 +718,19 @@ extern {
722718
pub fn uv_signal_stop(handle: *uv_signal_t) -> c_int;
723719
}
724720

725-
// various platform libraries required by libuv
726-
#[cfg(not(stage0), not(target_os = "android"))]
721+
// libuv requires other native libraries on various platforms. These are all
722+
// listed here (for each platform)
723+
724+
#[cfg(not(target_os = "android"))] // apparently pthreads isn't on android?
727725
#[link(name = "pthread")]
728726
extern {}
729-
#[cfg(stage0)]
730-
#[link_args = "-lpthread"]
731-
extern {}
732727

733-
#[cfg(target_os = "win32", not(stage0))]
728+
#[cfg(target_os = "win32")]
734729
#[link(name = "ws2_32")]
735730
#[link(name = "psapi")]
736731
#[link(name = "iphlpapi")]
737732
extern {}
738-
#[cfg(target_os = "win32", stage0)]
739-
#[link_args = "-lws2_32 -lpsapi -liphlpapi"]
740-
extern {}
741733

742-
#[cfg(target_os = "freebsd", not(stage0))]
734+
#[cfg(target_os = "freebsd")]
743735
#[link(name = "kvm")]
744736
extern {}
745-
#[cfg(target_os = "freebsd", stage0)]
746-
#[link_args = "-lkvm"]
747-
extern {}

0 commit comments

Comments
 (0)