Skip to content

Commit b62ac28

Browse files
committed
---
yaml --- r: 96247 b: refs/heads/dist-snap c: 6725493 h: refs/heads/master i: 96245: bf257fd 96243: 9b76eec 96239: 1c238b8 v: v3
1 parent 12b8201 commit b62ac28

39 files changed

+833
-1251
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 9ba473f86f900bf5a5009bf0695b6d9618df83ca
9+
refs/heads/dist-snap: 672549372c428a6b5f513d6d5b007cfcd6a468cf
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/tutorial.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,8 +1320,7 @@ let z = x; // this moves `x` into `z`, rather than creating a new owner
13201320

13211321
assert_eq!(*z.borrow(), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
13221322

1323-
// the variable is mutable, but not the contents of the box
1324-
let mut a = Rc::new([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]);
1323+
let mut a = Rc::new([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]); // the variable is mutable, but not the box
13251324
a = z;
13261325
~~~
13271326

branches/dist-snap/mk/platform.mk

Lines changed: 21 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,12 @@ CFG_LDPATH_arm-linux-androideabi :=
300300
CFG_RUN_arm-linux-androideabi=
301301
CFG_RUN_TARG_arm-linux-androideabi=
302302
RUSTC_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
303-
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
304303

305304
# arm-unknown-linux-gnueabihf configuration
306-
CROSS_PREFIX_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-
307-
CC_arm-unknown-linux-gnueabihf=gcc
308-
CXX_arm-unknown-linux-gnueabihf=g++
309-
CPP_arm-unknown-linux-gnueabihf=gcc -E
310-
AR_arm-unknown-linux-gnueabihf=ar
305+
CC_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-gcc
306+
CXX_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-g++
307+
CPP_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-gcc -E
308+
AR_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-ar
311309
CFG_LIB_NAME_arm-unknown-linux-gnueabihf=lib$(1).so
312310
CFG_STATIC_LIB_NAME_arm-unknown-linux-gnueabihf=lib$(1).a
313311
CFG_LIB_GLOB_arm-unknown-linux-gnueabihf=lib$(1)-*.so
@@ -326,17 +324,15 @@ CFG_WINDOWSY_arm-unknown-linux-gnueabihf :=
326324
CFG_UNIXY_arm-unknown-linux-gnueabihf := 1
327325
CFG_PATH_MUNGE_arm-unknown-linux-gnueabihf := true
328326
CFG_LDPATH_arm-unknown-linux-gnueabihf :=
329-
CFG_RUN_arm-unknown-linux-gnueabihf=$(2)
330-
CFG_RUN_TARG_arm-unknown-linux-gnueabihf=$(call CFG_RUN_arm-unknown-linux-gnueabihf,,$(2))
331-
RUSTC_FLAGS_arm-unknown-linux-gnueabihf :=
332-
RUSTC_CROSS_FLAGS_arm-unknown-linux-gnueabihf := --linker=$(CROSS_PREFIX_arm-unknown-linux-gnueabihf)$(CXX_arm-unknown-linux-gnueabihf)
327+
CFG_RUN_arm-unknown-linux-gnueabihf=
328+
CFG_RUN_TARG_arm-unknown-linux-gnueabihf=
329+
RUSTC_FLAGS_arm-unknown-linux-gnueabihf := --linker=$(CC_arm-unknown-linux-gnueabihf)
333330

334331
# arm-unknown-linux-gnueabi configuration
335-
CROSS_PREFIX_arm-unknown-linux-gnueabi=arm-linux-gnueabi-
336-
CC_arm-unknown-linux-gnueabi=gcc
337-
CXX_arm-unknown-linux-gnueabi=g++
338-
CPP_arm-unknown-linux-gnueabi=gcc -E
339-
AR_arm-unknown-linux-gnueabi=ar
332+
CC_arm-unknown-linux-gnueabi=arm-linux-gnueabi-gcc
333+
CXX_arm-unknown-linux-gnueabi=arm-linux-gnueabi-g++
334+
CPP_arm-unknown-linux-gnueabi=arm-linux-gnueabi-gcc -E
335+
AR_arm-unknown-linux-gnueabi=arm-linux-gnueabi-ar
340336
CFG_LIB_NAME_arm-unknown-linux-gnueabi=lib$(1).so
341337
CFG_STATIC_LIB_NAME_arm-unknown-linux-gnueabi=lib$(1).a
342338
CFG_LIB_GLOB_arm-unknown-linux-gnueabi=lib$(1)-*.so
@@ -355,10 +351,9 @@ CFG_WINDOWSY_arm-unknown-linux-gnueabi :=
355351
CFG_UNIXY_arm-unknown-linux-gnueabi := 1
356352
CFG_PATH_MUNGE_arm-unknown-linux-gnueabi := true
357353
CFG_LDPATH_arm-unknown-linux-gnueabi :=
358-
CFG_RUN_arm-unknown-linux-gnueabi=$(2)
359-
CFG_RUN_TARG_arm-unknown-linux-gnueabi=$(call CFG_RUN_arm-unknown-linux-gnueabi,,$(2))
360-
RUSTC_FLAGS_arm-unknown-linux-gnueabi :=
361-
RUSTC_CROSS_FLAGS_arm-unknown-linux-gnueabi := --linker=$(CROSS_PREFIX_arm-unknown-linux-gnueabi)$(CXX_arm-unknown-linux-gnueabi)
354+
CFG_RUN_arm-unknown-linux-gnueabi=
355+
CFG_RUN_TARG_arm-unknown-linux-gnueabi=
356+
RUSTC_FLAGS_arm-unknown-linux-gnueabi := --linker=$(CC_arm-unknown-linux-gnueabi)
362357

363358
# mips-unknown-linux-gnu configuration
364359
CC_mips-unknown-linux-gnu=mips-linux-gnu-gcc
@@ -404,7 +399,7 @@ CFG_GCCISH_PRE_LIB_FLAGS_i686-pc-mingw32 :=
404399
CFG_GCCISH_POST_LIB_FLAGS_i686-pc-mingw32 :=
405400
CFG_DEF_SUFFIX_i686-pc-mingw32 := .mingw32.def
406401
CFG_INSTALL_NAME_i686-pc-mingw32 =
407-
CFG_LIBUV_LINK_FLAGS_i686-pc-mingw32 := -lws2_32 -lpsapi -liphlpapi
402+
CFG_LIBUV_LINK_FLAGS_i686-pc-mingw32 := -lWs2_32 -lpsapi -liphlpapi
408403
CFG_LLVM_BUILD_ENV_i686-pc-mingw32 := CPATH=$(CFG_SRC_DIR)src/etc/mingw-fix-include
409404
CFG_EXE_SUFFIX_i686-pc-mingw32 := .exe
410405
CFG_WINDOWSY_i686-pc-mingw32 := 1
@@ -442,61 +437,31 @@ CFG_LDPATH_i586-mingw32msvc :=
442437
CFG_RUN_i586-mingw32msvc=
443438
CFG_RUN_TARG_i586-mingw32msvc=
444439

445-
# i686-w64-mingw32 configuration
446-
CROSS_PREFIX_i686-w64-mingw32=i686-w64-mingw32-
447-
CC_i686-w64-mingw32=gcc
448-
CXX_i686-w64-mingw32=g++
449-
CPP_i686-w64-mingw32=gcc -E
450-
AR_i686-w64-mingw32=ar
451-
CFG_LIB_NAME_i686-w64-mingw32=$(1).dll
452-
CFG_STATIC_LIB_NAME_i686-w64-mingw32=$(1).lib
453-
CFG_LIB_GLOB_i686-w64-mingw32=$(1)-*.dll
454-
CFG_LIB_DSYM_GLOB_i686-w64-mingw32=$(1)-*.dylib.dSYM
455-
CFG_GCCISH_CFLAGS_i686-w64-mingw32 := -Wall -Werror -g -m32 -D_WIN32_WINNT=0x0600
456-
CFG_GCCISH_CXXFLAGS_i686-w64-mingw32 := -fno-rtti
457-
CFG_GCCISH_LINK_FLAGS_i686-w64-mingw32 := -shared -g -m32
458-
CFG_GCCISH_DEF_FLAG_i686-w64-mingw32 :=
459-
CFG_GCCISH_PRE_LIB_FLAGS_i686-w64-mingw32 :=
460-
CFG_GCCISH_POST_LIB_FLAGS_i686-w64-mingw32 :=
461-
CFG_DEF_SUFFIX_i686-w64-mingw32 := .mingw32.def
462-
CFG_INSTALL_NAME_i686-w64-mingw32 =
463-
CFG_LIBUV_LINK_FLAGS_i686-w64-mingw32 := -lws2_32 -lpsapi -liphlpapi
464-
CFG_EXE_SUFFIX_i686-w64-mingw32 := .exe
465-
CFG_WINDOWSY_i686-w64-mingw32 := 1
466-
CFG_UNIXY_i686-w64-mingw32 :=
467-
CFG_PATH_MUNGE_i686-w64-mingw32 :=
468-
CFG_LDPATH_i686-w64-mingw32 :=$(CFG_LDPATH_i686-w64-mingw32):$(PATH)
469-
CFG_RUN_i686-w64-mingw32=PATH="$(CFG_LDPATH_i686-w64-mingw32):$(1)" $(2)
470-
CFG_RUN_TARG_i686-w64-mingw32=$(call CFG_RUN_i686-w64-mingw32,$(HLIB$(1)_H_$(CFG_BUILD)),$(2))
471-
RUSTC_CROSS_FLAGS_i686-w64-mingw32 := --linker=$(CROSS_PREFIX_i686-w64-mingw32)$(CXX_i686-w64-mingw32)
472-
473440
# x86_64-w64-mingw32 configuration
474-
CROSS_PREFIX_x86_64-w64-mingw32=x86_64-w64-mingw32-
475-
CC_x86_64-w64-mingw32=gcc
476-
CXX_x86_64-w64-mingw32=g++
477-
CPP_x86_64-w64-mingw32=gcc -E
478-
AR_x86_64-w64-mingw32=ar
441+
CC_x86_64-w64-mingw32=$(CC)
442+
CXX_x86_64-w64-mingw32=$(CXX)
443+
CPP_x86_64-w64-mingw32=$(CPP)
444+
AR_x86_64-w64-mingw32=$(AR)
479445
CFG_LIB_NAME_x86_64-w64-mingw32=$(1).dll
480446
CFG_STATIC_LIB_NAME_x86_64-w64-mingw32=$(1).lib
481447
CFG_LIB_GLOB_x86_64-w64-mingw32=$(1)-*.dll
482448
CFG_LIB_DSYM_GLOB_x86_64-w64-mingw32=$(1)-*.dylib.dSYM
483449
CFG_GCCISH_CFLAGS_x86_64-w64-mingw32 := -Wall -Werror -g -m64 -D_WIN32_WINNT=0x0600
484450
CFG_GCCISH_CXXFLAGS_x86_64-w64-mingw32 := -fno-rtti
485-
CFG_GCCISH_LINK_FLAGS_x86_64-w64-mingw32 := -shared -g -m64
451+
CFG_GCCISH_LINK_FLAGS_x86_64-w64-mingw32 := -shared -fPIC -g -m64
486452
CFG_GCCISH_DEF_FLAG_x86_64-w64-mingw32 :=
487453
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-w64-mingw32 :=
488454
CFG_GCCISH_POST_LIB_FLAGS_x86_64-w64-mingw32 :=
489455
CFG_DEF_SUFFIX_x86_64-w64-mingw32 := .mingw32.def
490456
CFG_INSTALL_NAME_x86_64-w64-mingw32 =
491-
CFG_LIBUV_LINK_FLAGS_x86_64-w64-mingw32 := -lws2_32 -lpsapi -liphlpapi
457+
CFG_LIBUV_LINK_FLAGS_x86_64-w64-mingw32 := -lWs2_32 -lpsapi -liphlpapi
492458
CFG_EXE_SUFFIX_x86_64-w64-mingw32 := .exe
493459
CFG_WINDOWSY_x86_64-w64-mingw32 := 1
494460
CFG_UNIXY_x86_64-w64-mingw32 :=
495461
CFG_PATH_MUNGE_x86_64-w64-mingw32 :=
496462
CFG_LDPATH_x86_64-w64-mingw32 :=$(CFG_LDPATH_x86_64-w64-mingw32):$(PATH)
497463
CFG_RUN_x86_64-w64-mingw32=PATH="$(CFG_LDPATH_x86_64-w64-mingw32):$(1)" $(2)
498464
CFG_RUN_TARG_x86_64-w64-mingw32=$(call CFG_RUN_x86_64-w64-mingw32,$(HLIB$(1)_H_$(CFG_BUILD)),$(2))
499-
RUSTC_CROSS_FLAGS_x86_64-w64-mingw32 := --linker=$(CROSS_PREFIX_x86_64-w64-mingw32)$(CXX_x86_64-w64-mingw32)
500465

501466
# x86_64-unknown-freebsd configuration
502467
CC_x86_64-unknown-freebsd=$(CC)
@@ -534,16 +499,6 @@ ifdef CFG_CCACHE_BASEDIR
534499
endif
535500

536501
define CFG_MAKE_TOOLCHAIN
537-
# Prepend the tools with their prefix if cross compiling
538-
ifneq ($(CFG_BUILD),$(1))
539-
CC_$(1)=$(CROSS_PREFIX_$(1))$(CC_$(1))
540-
CXX_$(1)=$(CROSS_PREFIX_$(1))$(CXX_$(1))
541-
CPP_$(1)=$(CROSS_PREFIX_$(1))$(CPP_$(1))
542-
AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1))
543-
544-
RUSTC_FLAGS_$(1)=$(RUSTC_CROSS_FLAGS_$(1))
545-
endif
546-
547502
CFG_COMPILE_C_$(1) = $$(CC_$(1)) \
548503
$$(CFG_GCCISH_CFLAGS) \
549504
$$(CFG_GCCISH_CFLAGS_$(1)) \

branches/dist-snap/mk/rt.mk

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@
2323
# fit the experimental data (i.e., I was able to get the system
2424
# working under these assumptions).
2525

26+
# Hack for passing flags into LIBUV, see below.
27+
LIBUV_FLAGS_i386 = -m32 -fPIC -I$(S)src/etc/mingw-fix-include
28+
LIBUV_FLAGS_x86_64 = -m64 -fPIC
29+
ifeq ($(OSTYPE_$(1)), linux-androideabi)
30+
LIBUV_FLAGS_arm = -fPIC -DANDROID -std=gnu99
31+
else ifeq ($(OSTYPE_$(1)), apple-darwin)
32+
ifeq ($(HOST_$(1)), arm)
33+
IOS_SDK := $(shell xcrun --show-sdk-path -sdk iphoneos 2>/dev/null)
34+
LIBUV_FLAGS_arm := -fPIC -std=gnu99 -I$(IOS_SDK)/usr/include -I$(IOS_SDK)/usr/include/c++/4.2.1
35+
else
36+
LIBUV_FLAGS_arm := -fPIC -std=gnu99
37+
endif
38+
else
39+
LIBUV_FLAGS_arm = -fPIC -std=gnu99
40+
endif
41+
LIBUV_FLAGS_mips = -fPIC -mips32r2 -msoft-float -mabi=32
42+
2643
# when we're doing a snapshot build, we intentionally degrade as many
2744
# features in libuv and the runtime as possible, to ease portability.
2845

@@ -192,9 +209,6 @@ LIBUV_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/libuv/$$(LIBUV_NAME_$(1))
192209

193210
LIBUV_MAKEFILE_$(1) := $$(CFG_BUILD_DIR)$$(RT_OUTPUT_DIR_$(1))/libuv/Makefile
194211

195-
# libuv triggers a few warnings on some platforms
196-
LIBUV_CFLAGS_$(1) := $(subst -Werror,,$(CFG_GCCISH_CFLAGS_$(1)))
197-
198212
$$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS)
199213
(cd $(S)src/libuv/ && \
200214
$$(CFG_PYTHON) ./gyp_uv.py -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) \
@@ -208,17 +222,15 @@ $$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS)
208222
ifdef CFG_WINDOWSY_$(1)
209223
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
210224
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
211-
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
212-
CC="$$(CC_$(1)) $$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
213-
CXX="$$(CXX_$(1))" \
225+
CC="$$(CC) $$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
214226
AR="$$(AR_$(1))" \
215227
V=$$(VERBOSE)
216228
$$(Q)cp $$(S)src/libuv/libuv.a $$@
217229
else
218230
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1))
219231
$$(Q)$$(MAKE) -C $$(@D) \
220-
CFLAGS="$$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
221-
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
232+
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
233+
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
222234
CC="$$(CC_$(1))" \
223235
CXX="$$(CXX_$(1))" \
224236
AR="$$(AR_$(1))" \

branches/dist-snap/src/librustc/back/link.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,13 @@ pub fn link_args(sess: Session,
10721072
args.push("-L" + path.as_str().unwrap().to_owned());
10731073
}
10741074

1075+
if sess.targ_cfg.os == abi::OsLinux {
1076+
// GNU-style linkers will use this to omit linking to libraries which don't actually fulfill
1077+
// any relocations, but only for libraries which follow this flag. Thus, use it before
1078+
// specifing libraries to link to.
1079+
args.push(~"-Wl,--as-needed");
1080+
}
1081+
10751082
// The names of the extern libraries
10761083
let used_libs = cstore::get_used_libraries(cstore);
10771084
for l in used_libs.iter() { args.push(~"-l" + *l); }
@@ -1091,6 +1098,12 @@ pub fn link_args(sess: Session,
10911098
// On linux librt and libdl are an indirect dependencies via rustrt,
10921099
// and binutils 2.22+ won't add them automatically
10931100
if sess.targ_cfg.os == abi::OsLinux {
1101+
// GNU-style linkers supports optimization with -O. --gc-sections removes metadata and
1102+
// potentially other useful things, so don't include it.
1103+
if sess.opts.optimize == session::Default || sess.opts.optimize == session::Aggressive {
1104+
args.push(~"-Wl,-O");
1105+
}
1106+
10941107
args.push_all([~"-lrt", ~"-ldl"]);
10951108

10961109
// LLVM implements the `frem` instruction as a call to `fmod`,

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,11 @@ pub fn default_configuration(sess: Session) ->
8585
abi::Mips => (@"big", @"mips", @"32")
8686
};
8787

88-
let fam = match sess.targ_cfg.os {
89-
abi::OsWin32 => @"windows",
90-
_ => @"unix"
91-
};
92-
9388
let mk = attr::mk_name_value_item_str;
9489
return ~[ // Target bindings.
95-
attr::mk_word_item(fam),
90+
attr::mk_word_item(os::FAMILY.to_managed()),
9691
mk(@"target_os", tos),
97-
mk(@"target_family", fam),
92+
mk(@"target_family", os::FAMILY.to_managed()),
9893
mk(@"target_arch", arch),
9994
mk(@"target_endian", end),
10095
mk(@"target_word_size", wordsz),

branches/dist-snap/src/librustc/front/feature_gate.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use syntax::attr::AttrMetaMethods;
2323
use syntax::codemap::Span;
2424
use syntax::visit;
2525
use syntax::visit::Visitor;
26-
use syntax::parse::token;
2726

2827
use driver::session::Session;
2928

@@ -37,7 +36,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
3736
("once_fns", Active),
3837
("asm", Active),
3938
("managed_boxes", Active),
40-
("non_ascii_idents", Active),
4139

4240
// These are used to test this portion of the compiler, they don't actually
4341
// mean anything
@@ -78,15 +76,6 @@ impl Context {
7876
}
7977

8078
impl Visitor<()> for Context {
81-
fn visit_ident(&mut self, sp: Span, id: ast::Ident, _: ()) {
82-
let s = token::ident_to_str(&id);
83-
84-
if !s.is_ascii() {
85-
self.gate_feature("non_ascii_idents", sp,
86-
"non-ascii idents are not fully supported.");
87-
}
88-
}
89-
9079
fn visit_view_item(&mut self, i: &ast::view_item, _: ()) {
9180
match i.node {
9281
ast::view_item_use(ref paths) => {
@@ -152,9 +141,11 @@ impl Visitor<()> for Context {
152141
},
153142
ast::ty_box(_) => {
154143
self.gate_feature("managed_boxes", t.span,
155-
"The managed box syntax is being replaced by the `std::gc::Gc`
156-
and `std::rc::Rc` types. Equivalent functionality to managed
157-
trait objects will be implemented but is currently missing.");
144+
"The managed box syntax will be replaced \
145+
by a library type, and a garbage \
146+
collector is not yet implemented. \
147+
Consider using the `std::rc::Rc` type \
148+
for reference counted pointers.");
158149
}
159150
_ => {}
160151
}

0 commit comments

Comments
 (0)