Skip to content

Commit c68f42d

Browse files
committed
---
yaml --- r: 141213 b: refs/heads/try2 c: e69e809 h: refs/heads/master i: 141211: 495f5c9 v: v3
1 parent 83c7c38 commit c68f42d

File tree

17 files changed

+230
-295
lines changed

17 files changed

+230
-295
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b5ab1012f1f5786f550e511ba1302a22c85fcd71
8+
refs/heads/try2: e69e80938bd000611ec17c3c23606e060f9b660a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -665,12 +665,16 @@ make_dir rt
665665
for t in $CFG_TARGET_TRIPLES
666666
do
667667
make_dir rt/$t
668-
for i in \
669-
isaac linenoise sync test \
670-
arch/i386 arch/x86_64 arch/arm arch/mips \
671-
libuv libuv/src/ares libuv/src/eio libuv/src/ev
668+
for s in 0 1 2 3
672669
do
673-
make_dir rt/$t/$i
670+
make_dir rt/$t/stage$s
671+
for i in \
672+
isaac linenoise sync test \
673+
arch/i386 arch/x86_64 arch/arm arch/mips \
674+
libuv libuv/src/ares libuv/src/eio libuv/src/ev
675+
do
676+
make_dir rt/$t/stage$s/$i
677+
done
674678
done
675679
done
676680

branches/try2/doc/rust.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,11 +2435,10 @@ match x {
24352435
}
24362436
~~~~
24372437

2438-
Patterns that bind variables default to binding to a copy or move of the matched value
2439-
(depending on the matched value's type).
2440-
This can be made explicit using the ```copy``` keyword,
2441-
changed to bind to a borrowed pointer by using the ```ref``` keyword,
2442-
or to a mutable borrowed pointer using ```ref mut```.
2438+
Patterns that bind variables default to binding to a copy of the matched value. This can be made
2439+
explicit using the ```copy``` keyword, changed to bind to a borrowed pointer by using the ```ref```
2440+
keyword, or to a mutable borrowed pointer using ```ref mut```, or the value can be moved into
2441+
the new binding using ```move```.
24432442

24442443
A pattern that's just an identifier,
24452444
like `Nil` in the previous answer,

branches/try2/mk/rt.mk

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,19 @@ ifneq ($(strip $(findstring snap,$(MAKECMDGOALS))),)
4141
SNAP_DEFINES=-DRUST_SNAPSHOT
4242
endif
4343

44-
4544
define DEF_RUNTIME_TARGETS
4645

4746
######################################################################
4847
# Runtime (C++) library variables
4948
######################################################################
5049

51-
RUNTIME_CXXS_$(1) := \
50+
# $(1) is the target triple
51+
# $(2) is the stage number
52+
53+
RUNTIME_CFLAGS_$(1)_$(2) = -D_RUST_STAGE$(2)
54+
RUNTIME_CXXFLAGS_$(1)_$(2) = -D_RUST_STAGE$(2)
55+
56+
RUNTIME_CXXS_$(1)_$(2) := \
5257
rt/sync/timer.cpp \
5358
rt/sync/lock_and_signal.cpp \
5459
rt/sync/rust_thread.cpp \
@@ -83,70 +88,70 @@ RUNTIME_CXXS_$(1) := \
8388
rt/rust_android_dummy.cpp \
8489
rt/rust_test_helpers.cpp
8590

86-
RUNTIME_CS_$(1) := rt/linenoise/linenoise.c rt/linenoise/utf8.c
91+
RUNTIME_CS_$(1)_$(2) := rt/linenoise/linenoise.c rt/linenoise/utf8.c
8792

88-
RUNTIME_S_$(1) := rt/arch/$$(HOST_$(1))/_context.S \
89-
rt/arch/$$(HOST_$(1))/ccall.S \
90-
rt/arch/$$(HOST_$(1))/record_sp.S
93+
RUNTIME_S_$(1)_$(2) := rt/arch/$$(HOST_$(1))/_context.S \
94+
rt/arch/$$(HOST_$(1))/ccall.S \
95+
rt/arch/$$(HOST_$(1))/record_sp.S
9196

9297
ifeq ($$(CFG_WINDOWSY_$(1)), 1)
93-
LIBUV_OSTYPE_$(1) := win
94-
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
98+
LIBUV_OSTYPE_$(1)_$(2) := win
99+
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
95100
else ifeq ($(OSTYPE_$(1)), apple-darwin)
96-
LIBUV_OSTYPE_$(1) := mac
97-
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
101+
LIBUV_OSTYPE_$(1)_$(2) := mac
102+
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
98103
else ifeq ($(OSTYPE_$(1)), unknown-freebsd)
99-
LIBUV_OSTYPE_$(1) := unix/freebsd
100-
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
104+
LIBUV_OSTYPE_$(1)_$(2) := unix/freebsd
105+
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
101106
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
102-
LIBUV_OSTYPE_$(1) := unix/android
103-
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
107+
LIBUV_OSTYPE_$(1)_$(2) := unix/android
108+
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
104109
else
105-
LIBUV_OSTYPE_$(1) := unix/linux
106-
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
110+
LIBUV_OSTYPE_$(1)_$(2) := unix/linux
111+
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
107112
endif
108113

109-
RUNTIME_DEF_$(1) := rt/rustrt$(CFG_DEF_SUFFIX_$(1))
110-
RUNTIME_INCS_$(1) := -I $$(S)src/rt -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \
114+
RUNTIME_DEF_$(1)_$(2) := rt/rustrt$(CFG_DEF_SUFFIX_$(1))
115+
RUNTIME_INCS_$(1)_$(2) := -I $$(S)src/rt -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \
111116
-I $$(S)src/rt/arch/$$(HOST_$(1)) \
112117
-I $$(S)src/rt/linenoise \
113118
-I $$(S)src/libuv/include
114-
RUNTIME_OBJS_$(1) := $$(RUNTIME_CXXS_$(1):rt/%.cpp=rt/$(1)/%.o) \
115-
$$(RUNTIME_CS_$(1):rt/%.c=rt/$(1)/%.o) \
116-
$$(RUNTIME_S_$(1):rt/%.S=rt/$(1)/%.o)
117-
ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1))
119+
RUNTIME_OBJS_$(1)_$(2) := $$(RUNTIME_CXXS_$(1)_$(2):rt/%.cpp=rt/$(1)/stage$(2)/%.o) \
120+
$$(RUNTIME_CS_$(1)_$(2):rt/%.c=rt/$(1)/stage$(2)/%.o) \
121+
$$(RUNTIME_S_$(1)_$(2):rt/%.S=rt/$(1)/stage$(2)/%.o)
122+
ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1)_$(2))
118123

119-
MORESTACK_OBJ_$(1) := rt/$(1)/arch/$$(HOST_$(1))/morestack.o
120-
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1))
124+
MORESTACK_OBJ_$(1)_$(2) := rt/$(1)/stage$(2)/arch/$$(HOST_$(1))/morestack.o
125+
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1)_$(2))
121126

122-
RUNTIME_LIBS_$(1) := $$(LIBUV_LIB_$(1))
127+
RUNTIME_LIBS_$(1)_$(2) := $$(LIBUV_LIB_$(1)_$(2))
123128

124-
rt/$(1)/%.o: rt/%.cpp $$(MKFILE_DEPS)
129+
rt/$(1)/stage$(2)/%.o: rt/%.cpp $$(MKFILE_DEPS)
125130
@$$(call E, compile: $$@)
126-
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)) \
127-
$$(SNAP_DEFINES)) $$<
131+
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
132+
$$(SNAP_DEFINES) $$(RUNTIME_CXXFLAGS_$(1)_$(2))) $$<
128133

129-
rt/$(1)/%.o: rt/%.c $$(MKFILE_DEPS)
134+
rt/$(1)/stage$(2)/%.o: rt/%.c $$(MKFILE_DEPS)
130135
@$$(call E, compile: $$@)
131-
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1)) \
132-
$$(SNAP_DEFINES)) $$<
136+
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
137+
$$(SNAP_DEFINES) $$(RUNTIME_CFLAGS_$(1)_$(2))) $$<
133138

134-
rt/$(1)/%.o: rt/%.S $$(MKFILE_DEPS) \
139+
rt/$(1)/stage$(2)/%.o: rt/%.S $$(MKFILE_DEPS) \
135140
$$(LLVM_CONFIG_$$(CFG_BUILD_TRIPLE))
136141
@$$(call E, compile: $$@)
137142
$$(Q)$$(call CFG_ASSEMBLE_$(1),$$@,$$<)
138143

139-
rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$(1))
144+
rt/$(1)/stage$(2)/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$(1)_$(2))
140145
@$$(call E, link: $$@)
141146
$$(Q)$(AR_$(1)) rcs $$@ $$<
142147

143-
rt/$(1)/$(CFG_RUNTIME_$(1)): $$(RUNTIME_OBJS_$(1)) $$(MKFILE_DEPS) \
144-
$$(RUNTIME_DEF_$(1)) \
145-
$$(RUNTIME_LIBS_$(1))
148+
rt/$(1)/stage$(2)/$(CFG_RUNTIME_$(1)): $$(RUNTIME_OBJS_$(1)_$(2)) $$(MKFILE_DEPS) \
149+
$$(RUNTIME_DEF_$(1)_$(2)) \
150+
$$(RUNTIME_LIBS_$(1)_$(2))
146151
@$$(call E, link: $$@)
147-
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@, $$(RUNTIME_OBJS_$(1)) \
148-
$$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(RUNTIME_LIBS_$(1)) \
149-
$$(CFG_LIBUV_LINK_FLAGS_$(1)),$$(RUNTIME_DEF_$(1)),$$(CFG_RUNTIME_$(1)))
152+
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@, $$(RUNTIME_OBJS_$(1)_$(2)) \
153+
$$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(RUNTIME_LIBS_$(1)_$(2)) \
154+
$$(CFG_LIBUV_LINK_FLAGS_$(1)),$$(RUNTIME_DEF_$(1)_$(2)),$$(CFG_RUNTIME_$(1)))
150155

151156
# FIXME: For some reason libuv's makefiles can't figure out the
152157
# correct definition of CC on the mingw I'm using, so we are
@@ -165,32 +170,32 @@ endif
165170

166171
# XXX: Shouldn't need platform-specific conditions here
167172
ifdef CFG_WINDOWSY_$(1)
168-
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
173+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
169174
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
170-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
175+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
171176
OS=mingw \
172177
V=$$(VERBOSE)
173178
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
174-
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
179+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
175180
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
176181
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
177182
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
178183
CC="$$(CC_$(1))" \
179184
CXX="$$(CXX_$(1))" \
180185
AR="$$(AR_$(1))" \
181186
BUILDTYPE=Release \
182-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
187+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
183188
host=android OS=linux \
184189
V=$$(VERBOSE)
185190
else
186-
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
191+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
187192
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
188193
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
189194
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
190195
CC="$$(CC_$(1))" \
191196
CXX="$$(CXX_$(1))" \
192197
AR="$$(AR_$(1))" \
193-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
198+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
194199
V=$$(VERBOSE)
195200
endif
196201

@@ -229,5 +234,6 @@ endif
229234
endef
230235

231236
# Instantiate template for all stages
232-
$(foreach target,$(CFG_TARGET_TRIPLES), \
233-
$(eval $(call DEF_RUNTIME_TARGETS,$(target))))
237+
$(foreach stage,$(STAGES), \
238+
$(foreach target,$(CFG_TARGET_TRIPLES), \
239+
$(eval $(call DEF_RUNTIME_TARGETS,$(target),$(stage)))))

branches/try2/mk/target.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
define TARGET_STAGE_N
1919

2020
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
21-
rt/$(2)/arch/$$(HOST_$(2))/libmorestack.a \
21+
rt/$(2)/stage$(1)/arch/$$(HOST_$(2))/libmorestack.a \
2222
| $$(TLIB$(1)_T_$(2)_H_$(3))/
2323
@$$(call E, cp: $$@)
2424
$$(Q)cp $$< $$@
2525

2626
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME_$(2)): \
27-
rt/$(2)/$(CFG_RUNTIME_$(2)) \
27+
rt/$(2)/stage$(1)/$(CFG_RUNTIME_$(2)) \
2828
| $$(TLIB$(1)_T_$(2)_H_$(3))/
2929
@$$(call E, cp: $$@)
3030
$$(Q)cp $$< $$@

branches/try2/src/librustc/back/link.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -727,17 +727,6 @@ pub fn mangle_internal_name_by_type_only(ccx: @CrateContext,
727727
path_name(ccx.sess.ident_of(hash))]);
728728
}
729729

730-
pub fn mangle_internal_name_by_type_and_seq(ccx: @CrateContext,
731-
t: ty::t,
732-
name: &str) -> ~str {
733-
let s = ppaux::ty_to_str(ccx.tcx, t);
734-
let hash = get_symbol_hash(ccx, t);
735-
return mangle(ccx.sess,
736-
~[path_name(ccx.sess.ident_of(s)),
737-
path_name(ccx.sess.ident_of(hash)),
738-
path_name((ccx.names)(name))]);
739-
}
740-
741730
pub fn mangle_internal_name_by_path_and_seq(ccx: @CrateContext,
742731
path: path,
743732
flav: &str) -> ~str {

branches/try2/src/librustc/middle/trans/foreign.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -845,26 +845,6 @@ pub fn trans_intrinsic(ccx: @CrateContext,
845845
T_ptr(T_nil()));
846846
Store(bcx, morestack_addr, fcx.llretptr.get());
847847
}
848-
~"memcpy32" => {
849-
let dst_ptr = get_param(decl, first_real_arg);
850-
let src_ptr = get_param(decl, first_real_arg + 1);
851-
let size = get_param(decl, first_real_arg + 2);
852-
let align = C_i32(1);
853-
let volatile = C_i1(false);
854-
let llfn = *bcx.ccx().intrinsics.get(
855-
&~"llvm.memcpy.p0i8.p0i8.i32");
856-
Call(bcx, llfn, [dst_ptr, src_ptr, size, align, volatile]);
857-
}
858-
~"memcpy64" => {
859-
let dst_ptr = get_param(decl, first_real_arg);
860-
let src_ptr = get_param(decl, first_real_arg + 1);
861-
let size = get_param(decl, first_real_arg + 2);
862-
let align = C_i32(1);
863-
let volatile = C_i1(false);
864-
let llfn = *bcx.ccx().intrinsics.get(
865-
&~"llvm.memcpy.p0i8.p0i8.i64");
866-
Call(bcx, llfn, [dst_ptr, src_ptr, size, align, volatile]);
867-
}
868848
~"memmove32" => {
869849
let dst_ptr = get_param(decl, first_real_arg);
870850
let src_ptr = get_param(decl, first_real_arg + 1);

branches/try2/src/librustc/middle/trans/glue.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,12 @@ pub fn declare_tydesc(ccx: @CrateContext, t: ty::t) -> @mut tydesc_info {
683683
let llsize = llsize_of(ccx, llty);
684684
let llalign = llalign_of(ccx, llty);
685685
let addrspace = declare_tydesc_addrspace(ccx, t);
686-
let name = @mangle_internal_name_by_type_and_seq(ccx, t, "tydesc");
686+
// FIXME #6574: this triggers duplicate LLVM symbols
687+
let name = @(if false /*ccx.sess.opts.debuginfo*/ {
688+
mangle_internal_name_by_type_only(ccx, t, "tydesc")
689+
} else {
690+
mangle_internal_name_by_seq(ccx, "tydesc")
691+
});
687692
note_unique_llvm_symbol(ccx, name);
688693
debug!("+++ declare_tydesc %s %s", ppaux::ty_to_str(ccx.tcx, t), *name);
689694
let gvar = str::as_c_str(*name, |buf| {
@@ -712,7 +717,12 @@ pub fn declare_generic_glue(ccx: @CrateContext, t: ty::t, llfnty: TypeRef,
712717
name: ~str) -> ValueRef {
713718
let _icx = ccx.insn_ctxt("declare_generic_glue");
714719
let name = name;
715-
let fn_nm = @mangle_internal_name_by_type_and_seq(ccx, t, (~"glue_" + name));
720+
// FIXME #6574 this triggers duplicate LLVM symbols
721+
let fn_nm = @(if false /*ccx.sess.opts.debuginfo*/ {
722+
mangle_internal_name_by_type_only(ccx, t, (~"glue_" + name))
723+
} else {
724+
mangle_internal_name_by_seq(ccx, (~"glue_" + name))
725+
});
716726
debug!("%s is for type %s", *fn_nm, ppaux::ty_to_str(ccx.tcx, t));
717727
note_unique_llvm_symbol(ccx, fn_nm);
718728
let llfn = decl_cdecl_fn(ccx.llmod, *fn_nm, llfnty);

branches/try2/src/librustc/middle/trans/type_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn type_uses_for(ccx: @CrateContext, fn_id: def_id, n_tps: uint)
135135
~"visit_tydesc" | ~"forget" | ~"frame_address" |
136136
~"morestack_addr" => 0,
137137

138-
~"memcpy32" | ~"memcpy64" | ~"memmove32" | ~"memmove64" => 0,
138+
~"memmove32" | ~"memmove64" => 0,
139139

140140
~"sqrtf32" | ~"sqrtf64" | ~"powif32" | ~"powif64" |
141141
~"sinf32" | ~"sinf64" | ~"cosf32" | ~"cosf64" |

0 commit comments

Comments
 (0)