Skip to content

Commit 938099a

Browse files
committed
Register new snapshots
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
1 parent 91c618f commit 938099a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+25
-483
lines changed

mk/cfg/i686-pc-windows-msvc.mk

-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,3 @@ CFG_LDPATH_i686-pc-windows-msvc :=
2222
CFG_RUN_i686-pc-windows-msvc=$(2)
2323
CFG_RUN_TARG_i686-pc-windows-msvc=$(call CFG_RUN_i686-pc-windows-msvc,,$(2))
2424
CFG_GNU_TRIPLE_i686-pc-windows-msvc := i686-pc-win32
25-
26-
# All windows nightiles are currently a GNU triple, so this MSVC triple is not
27-
# bootstrapping from itself. This is relevant during stage0, and other parts of
28-
# the build system take this into account.
29-
BOOTSTRAP_FROM_i686-pc-windows-msvc := i686-pc-windows-gnu

mk/cfg/x86_64-pc-windows-msvc.mk

-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,3 @@ CFG_LDPATH_x86_64-pc-windows-msvc :=
2222
CFG_RUN_x86_64-pc-windows-msvc=$(2)
2323
CFG_RUN_TARG_x86_64-pc-windows-msvc=$(call CFG_RUN_x86_64-pc-windows-msvc,,$(2))
2424
CFG_GNU_TRIPLE_x86_64-pc-windows-msvc := x86_64-pc-win32
25-
26-
# All windows nightiles are currently a GNU triple, so this MSVC triple is not
27-
# bootstrapping from itself. This is relevant during stage0, and other parts of
28-
# the build system take this into account.
29-
BOOTSTRAP_FROM_x86_64-pc-windows-msvc := x86_64-pc-windows-gnu

mk/main.mk

-5
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,6 @@ TSREQ$(1)_T_$(2)_H_$(3) = \
400400
$$(foreach obj,$$(INSTALLED_OBJECTS_$(2)),\
401401
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj))
402402

403-
ifeq ($(1),0)
404-
TSREQ$(1)_T_$(2)_H_$(3) += \
405-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(call CFG_STATIC_LIB_NAME_$(2),morestack)
406-
endif
407-
408403
# Prerequisites for a working stageN compiler and libraries, for a specific
409404
# target
410405
SREQ$(1)_T_$(2)_H_$(3) = \

mk/platform.mk

-61
Original file line numberDiff line numberDiff line change
@@ -237,64 +237,3 @@ endef
237237

238238
$(foreach target,$(CFG_TARGET), \
239239
$(eval $(call CFG_MAKE_TOOLCHAIN,$(target))))
240-
241-
# There are more comments about this available in the target specification for
242-
# Windows MSVC in the compiler, but the gist of it is that we use `llvm-ar.exe`
243-
# instead of `lib.exe` for assembling archives, so we need to inject this custom
244-
# dependency here.
245-
#
246-
# FIXME(stage0): remove this and all other relevant support in the makefiles
247-
# after a snapshot is made
248-
define ADD_LLVM_AR_TO_MSVC_DEPS
249-
ifeq ($$(findstring msvc,$(1)),msvc)
250-
NATIVE_TOOL_DEPS_core_T_$(1) += llvm-ar.exe
251-
INSTALLED_BINS_$(1) += llvm-ar.exe
252-
endif
253-
endef
254-
255-
$(foreach target,$(CFG_TARGET), \
256-
$(eval $(call ADD_LLVM_AR_TO_MSVC_DEPS,$(target))))
257-
258-
# When working with MSVC on windows, each DLL needs to explicitly declare its
259-
# interface to the outside world through some means. The options for doing so
260-
# include:
261-
#
262-
# 1. A custom attribute on each function itself
263-
# 2. A linker argument saying what to export
264-
# 3. A file which lists all symbols that need to be exported
265-
#
266-
# The Rust compiler takes care (1) for us for all Rust code by annotating all
267-
# public-facing functions with dllexport, but we have a few native dependencies
268-
# which need to cross the DLL boundary. The most important of these dependencies
269-
# is LLVM which is linked into `rustc_llvm.dll` but primarily used from
270-
# `rustc_trans.dll`. This means that many of LLVM's C API functions need to be
271-
# exposed from `rustc_llvm.dll` to be forwarded over the boundary.
272-
#
273-
# Unfortunately, at this time, LLVM does not handle this sort of exportation on
274-
# Windows for us, so we're forced to do it ourselves if we want it (which seems
275-
# like the path of least resistance right now). To do this we generate a `.DEF`
276-
# file [1] which we then custom-pass to the linker when building the rustc_llvm
277-
# crate. This DEF file list all symbols that are exported from
278-
# `src/librustc_llvm/lib.rs` and is generated by a small python script.
279-
#
280-
# Fun times!
281-
#
282-
# [1]: https://msdn.microsoft.com/en-us/library/28d6s79h.aspx
283-
#
284-
# FIXME(stage0): remove this macro and the usage below (and the commments above)
285-
# when a new snapshot is available. Also remove the
286-
# RUSTFLAGS$(1)_.._T_ variable in mk/target.mk along with
287-
# CUSTOM_DEPS (as they were only added for this)
288-
define ADD_RUSTC_LLVM_DEF_TO_MSVC
289-
ifeq ($$(findstring msvc,$(1)),msvc)
290-
RUSTFLAGS0_rustc_llvm_T_$(1) += -C link-args="-DEF:$(1)/rt/rustc_llvm.def"
291-
CUSTOM_DEPS0_rustc_llvm_T_$(1) += $(1)/rt/rustc_llvm.def
292-
293-
$(1)/rt/rustc_llvm.def: $$(S)src/etc/mklldef.py $$(S)src/librustc_llvm/lib.rs
294-
$$(CFG_PYTHON) $$^ $$@ rustc_llvm-$$(CFG_FILENAME_EXTRA)
295-
endif
296-
endef
297-
298-
$(foreach target,$(CFG_TARGET), \
299-
$(eval $(call ADD_RUSTC_LLVM_DEF_TO_MSVC,$(target))))
300-

mk/rt.mk

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
# that's per-target so you're allowed to conditionally add files based on the
3636
# target.
3737
################################################################################
38-
NATIVE_LIBS := rust_builtin hoedown miniz \
39-
rust_test_helpers morestack
38+
NATIVE_LIBS := rust_builtin hoedown miniz rust_test_helpers
4039

4140
# $(1) is the target triple
4241
define NATIVE_LIBRARIES
@@ -54,7 +53,6 @@ NATIVE_DEPS_miniz_$(1) = miniz.c
5453
NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
5554
rust_android_dummy.c
5655
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c
57-
NATIVE_DEPS_morestack_$(1) := empty.c
5856

5957
################################################################################
6058
# You shouldn't find it that necessary to edit anything below this line.

mk/target.mk

+1-92
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4) := \
3737
$$(foreach dep,$$(NATIVE_DEPS_$(4)), \
3838
$$(RT_OUTPUT_DIR_$(2))/$$(call CFG_STATIC_LIB_NAME_$(2),$$(dep))) \
3939
$$(foreach dep,$$(NATIVE_DEPS_$(4)_T_$(2)), \
40-
$$(RT_OUTPUT_DIR_$(2))/$$(dep)) \
41-
$$(foreach dep,$$(NATIVE_TOOL_DEPS_$(4)_T_$(2)), \
42-
$$(TBIN$(1)_T_$(3)_H_$(3))/$$(dep)) \
43-
$$(CUSTOM_DEPS$(1)_$(4)_T_$(2))
40+
$$(RT_OUTPUT_DIR_$(2))/$$(dep))
4441
endef
4542

4643
$(foreach host,$(CFG_HOST), \
@@ -142,21 +139,13 @@ SNAPSHOT_RUSTC_POST_CLEANUP=$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD))
142139

143140
define TARGET_HOST_RULES
144141

145-
$$(TBIN$(1)_T_$(2)_H_$(3))/:
146-
mkdir -p $$@
147-
148142
$$(TLIB$(1)_T_$(2)_H_$(3))/:
149143
mkdir -p $$@
150144

151145
$$(TLIB$(1)_T_$(2)_H_$(3))/%: $$(RT_OUTPUT_DIR_$(2))/% \
152146
| $$(TLIB$(1)_T_$(2)_H_$(3))/ $$(SNAPSHOT_RUSTC_POST_CLEANUP)
153147
@$$(call E, cp: $$@)
154148
$$(Q)cp $$< $$@
155-
156-
$$(TBIN$(1)_T_$(2)_H_$(3))/%: $$(CFG_LLVM_INST_DIR_$(2))/bin/% \
157-
| $$(TBIN$(1)_T_$(2)_H_$(3))/ $$(SNAPSHOT_RUSTC_POST_CLEANUP)
158-
@$$(call E, cp: $$@)
159-
$$(Q)cp $$< $$@
160149
endef
161150

162151
$(foreach source,$(CFG_HOST), \
@@ -180,83 +169,3 @@ $(foreach host,$(CFG_HOST), \
180169
$(foreach stage,$(STAGES), \
181170
$(foreach tool,$(TOOLS), \
182171
$(eval $(call TARGET_TOOL,$(stage),$(target),$(host),$(tool)))))))
183-
184-
# We have some triples which are bootstrapped from other triples, and this means
185-
# that we need to fixup some of the native tools that a triple depends on.
186-
#
187-
# For example, MSVC requires the llvm-ar.exe executable to manage archives, but
188-
# it bootstraps from the GNU Windows triple. This means that the compiler will
189-
# add this directory to PATH when executing new processes:
190-
#
191-
# $SYSROOT/rustlib/x86_64-pc-windows-gnu/bin
192-
#
193-
# Unfortunately, however, the GNU triple is not known about in stage0, so the
194-
# tools are actually located in:
195-
#
196-
# $SYSROOT/rustlib/x86_64-pc-windows-msvc/bin
197-
#
198-
# To remedy this problem, the rules below copy all native tool dependencies into
199-
# the bootstrap triple's location in stage 0 so the bootstrap compiler can find
200-
# the right sets of tools. Later stages (1+) will have the right host triple for
201-
# the compiler, so there's no need to worry there.
202-
#
203-
# $(1) - stage
204-
# $(2) - triple that's being used as host/target
205-
# $(3) - triple snapshot is built for
206-
# $(4) - crate
207-
# $(5) - tool
208-
#
209-
# FIXME(stage0): remove this and all other relevant support in the makefiles
210-
# after a snapshot is made
211-
define MOVE_TOOLS_TO_SNAPSHOT_HOST_DIR
212-
ifneq (,$(3))
213-
$$(TLIB$(1)_T_$(2)_H_$(2))/stamp.$(4): $$(HLIB$(1)_H_$(2))/rustlib/$(3)/bin/$(5)
214-
215-
$$(HLIB$(1)_H_$(2))/rustlib/$(3)/bin/$(5): $$(TBIN$(1)_T_$(2)_H_$(2))/$(5)
216-
mkdir -p $$(@D)
217-
cp $$< $$@
218-
endif
219-
endef
220-
221-
$(foreach target,$(CFG_TARGET), \
222-
$(foreach crate,$(CRATES), \
223-
$(foreach tool,$(NATIVE_TOOL_DEPS_$(crate)_T_$(target)), \
224-
$(eval $(call MOVE_TOOLS_TO_SNAPSHOT_HOST_DIR,0,$(target),$(BOOTSTRAP_FROM_$(target)),$(crate),$(tool))))))
225-
226-
# For MSVC targets we need to set up some environment variables for the linker
227-
# to work correctly when building Rust crates. These two variables are:
228-
#
229-
# - LIB tells the linker the default search path for finding system libraries,
230-
# for example kernel32.dll
231-
# - PATH needs to be modified to ensure that MSVC's link.exe is first in the
232-
# path instead of MinGW's /usr/bin/link.exe (entirely unrelated)
233-
#
234-
# The values for these variables are detected by the configure script.
235-
#
236-
# FIXME(stage0): remove this and all other relevant support in the makefiles
237-
# after a snapshot is made
238-
define SETUP_LIB_MSVC_ENV_VARS
239-
ifeq ($$(findstring msvc,$(2)),msvc)
240-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
241-
export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(2)))
242-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
243-
export PATH := $$(CFG_MSVC_BINDIR_$$(HOST_$(2))):$$(PATH)
244-
endif
245-
endef
246-
define SETUP_TOOL_MSVC_ENV_VARS
247-
ifeq ($$(findstring msvc,$(2)),msvc)
248-
$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
249-
export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(2)))
250-
$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
251-
export PATH := $$(CFG_MSVC_BINDIR_$$(HOST_$(2))):$$(PATH)
252-
endif
253-
endef
254-
255-
$(foreach host,$(CFG_HOST), \
256-
$(foreach target,$(CFG_TARGET), \
257-
$(foreach crate,$(CRATES), \
258-
$(eval $(call SETUP_LIB_MSVC_ENV_VARS,0,$(target),$(host),$(crate))))))
259-
$(foreach host,$(CFG_HOST), \
260-
$(foreach target,$(CFG_TARGET), \
261-
$(foreach tool,$(TOOLS), \
262-
$(eval $(call SETUP_TOOL_MSVC_ENV_VARS,0,$(target),$(host),$(tool))))))

src/liballoc/arc.rs

-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@
7171
7272
use boxed::Box;
7373

74-
#[cfg(stage0)]
75-
use core::prelude::v1::*;
76-
7774
use core::atomic;
7875
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
7976
use core::fmt;

src/liballoc/boxed.rs

-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
5454
#![stable(feature = "rust1", since = "1.0.0")]
5555

56-
#[cfg(stage0)]
57-
use core::prelude::v1::*;
58-
5956
use heap;
6057
use raw_vec::RawVec;
6158

src/liballoc/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
#![feature(unsize)]
9393
#![feature(core_slice_ext)]
9494
#![feature(core_str_ext)]
95-
#![cfg_attr(stage0, feature(core, core_prelude))]
9695

9796
#![cfg_attr(test, feature(test, alloc, rustc_private, box_raw))]
9897
#![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),
@@ -101,8 +100,6 @@
101100
#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate")))]
102101
extern crate libc;
103102

104-
#[cfg(stage0)] #[macro_use] extern crate core;
105-
106103
// Allow testing this library
107104

108105
#[cfg(test)] #[macro_use] extern crate std;

src/liballoc/rc.rs

-3
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@
150150
151151
#![stable(feature = "rust1", since = "1.0.0")]
152152

153-
#[cfg(stage0)]
154-
use core::prelude::v1::*;
155-
156153
#[cfg(not(test))]
157154
use boxed::Box;
158155
#[cfg(test)]

src/libcollections/binary_heap.rs

-3
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@
151151
#![allow(missing_docs)]
152152
#![stable(feature = "rust1", since = "1.0.0")]
153153

154-
#[cfg(stage0)]
155-
use core::prelude::v1::*;
156-
157154
use core::iter::{FromIterator};
158155
use core::mem::swap;
159156
use core::ptr;

src/libcollections/bit.rs

-3
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@
8686
//! println!("There are {} primes below {}", num_primes, max_prime);
8787
//! ```
8888
89-
#[cfg(stage0)]
90-
use core::prelude::v1::*;
91-
9289
use core::cmp::Ordering;
9390
use core::cmp;
9491
use core::fmt;

src/libcollections/btree/map.rs

-5
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717

1818
use self::Entry::*;
1919

20-
#[cfg(stage0)]
21-
use core::prelude::v1::*;
22-
2320
use core::cmp::Ordering;
2421
use core::fmt::Debug;
2522
use core::hash::{Hash, Hasher};
@@ -531,8 +528,6 @@ enum Continuation<A, B> {
531528
/// to nodes. By using this module much better safety guarantees can be made, and more search
532529
/// boilerplate gets cut out.
533530
mod stack {
534-
#[cfg(stage0)]
535-
use core::prelude::v1::*;
536531
use core::marker;
537532
use core::mem;
538533
use core::ops::{Deref, DerefMut};

src/libcollections/btree/node.rs

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ pub use self::SearchResult::*;
1616
pub use self::ForceResult::*;
1717
pub use self::TraversalItem::*;
1818

19-
#[cfg(stage0)]
20-
use core::prelude::v1::*;
21-
2219
use core::cmp::Ordering::{Greater, Less, Equal};
2320
use core::intrinsics::arith_offset;
2421
use core::iter::Zip;

src/libcollections/btree/set.rs

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
// This is pretty much entirely stolen from TreeSet, since BTreeMap has an identical interface
1212
// to TreeMap
1313

14-
#[cfg(stage0)]
15-
use core::prelude::v1::*;
16-
1714
use core::cmp::Ordering::{self, Less, Greater, Equal};
1815
use core::fmt::Debug;
1916
use core::fmt;

src/libcollections/enum_set.rs

-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
reason = "matches collection reform specification, \
1818
waiting for dust to settle")]
1919

20-
#[cfg(stage0)]
21-
use core::prelude::v1::*;
22-
2320
use core::marker;
2421
use core::fmt;
2522
use core::iter::{FromIterator};

src/libcollections/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,10 @@
5959
#![feature(utf8_error)]
6060
#![cfg_attr(test, feature(rand, test))]
6161
#![cfg_attr(not(test), feature(str_words))]
62-
#![cfg_attr(stage0, feature(core, core_prelude))]
6362

6463
#![feature(no_std)]
6564
#![no_std]
6665

67-
#[cfg(stage0)] #[macro_use] extern crate core;
68-
6966
extern crate rustc_unicode;
7067
extern crate alloc;
7168

src/libcollections/linked_list.rs

-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121

2222
#![stable(feature = "rust1", since = "1.0.0")]
2323

24-
#[cfg(stage0)]
25-
use core::prelude::v1::*;
26-
2724
use alloc::boxed::Box;
2825
use core::cmp::Ordering;
2926
use core::fmt;

src/libcollections/string.rs

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
1313
#![stable(feature = "rust1", since = "1.0.0")]
1414

15-
#[cfg(stage0)]
16-
use core::prelude::v1::*;
17-
1815
use core::fmt;
1916
use core::hash;
2017
use core::iter::FromIterator;

src/libcollections/vec.rs

-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@
5858
5959
#![stable(feature = "rust1", since = "1.0.0")]
6060

61-
#[cfg(stage0)]
62-
use core::prelude::v1::*;
63-
6461
use alloc::raw_vec::RawVec;
6562
use alloc::boxed::Box;
6663
use alloc::heap::EMPTY;

0 commit comments

Comments
 (0)