Skip to content

Commit f7e5f99

Browse files
committed
---
yaml --- r: 147436 b: refs/heads/try2 c: e3b3715 h: refs/heads/master v: v3
1 parent 3bf33e7 commit f7e5f99

Some content is hidden

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

60 files changed

+460
-185
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: b8c87fd9fe649d3211bb53754fb692a825ecfdff
8+
refs/heads/try2: e3b37154b0f321ad74f293d98d9be2ae512c2ec7
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/rt.mk

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ RUNTIME_CXXFLAGS_$(1)_$(2) = -D_RUST_STAGE1
7272
endif
7373
endif
7474

75-
RUNTIME_CXXS_$(1)_$(2) := \
76-
rt/rust_cxx_glue.cpp
77-
7875
RUNTIME_CS_$(1)_$(2) := \
7976
rt/rust_builtin.c \
8077
rt/rust_upcall.c \
8178
rt/miniz.c \
8279
rt/rust_android_dummy.c \
8380
rt/rust_test_helpers.c
8481

82+
RUNTIME_LL_$(1)_$(2) := \
83+
rt/rust_try.ll
84+
8585
# stage0 remove this after the next snapshot
8686
%.cpp:
8787
@touch tmp/foo.o
@@ -94,19 +94,16 @@ RT_BUILD_DIR_$(1)_$(2) := $$(RT_OUTPUT_DIR_$(1))/stage$(2)
9494
RUNTIME_DEF_$(1)_$(2) := $$(RT_OUTPUT_DIR_$(1))/rustrt$$(CFG_DEF_SUFFIX_$(1))
9595
RUNTIME_INCS_$(1)_$(2) := -I $$(S)src/rt -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \
9696
-I $$(S)src/rt/arch/$$(HOST_$(1))
97-
RUNTIME_OBJS_$(1)_$(2) := $$(RUNTIME_CXXS_$(1)_$(2):rt/%.cpp=$$(RT_BUILD_DIR_$(1)_$(2))/%.o) \
97+
RUNTIME_OBJS_$(1)_$(2) := \
9898
$$(RUNTIME_CS_$(1)_$(2):rt/%.c=$$(RT_BUILD_DIR_$(1)_$(2))/%.o) \
99-
$$(RUNTIME_S_$(1)_$(2):rt/%.S=$$(RT_BUILD_DIR_$(1)_$(2))/%.o)
99+
$$(RUNTIME_S_$(1)_$(2):rt/%.S=$$(RT_BUILD_DIR_$(1)_$(2))/%.o) \
100+
$$(RUNTIME_LL_$(1)_$(2):rt/%.ll=$$(RT_BUILD_DIR_$(1)_$(2))/%.o)
101+
100102
ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1)_$(2))
101103

102104
MORESTACK_OBJS_$(1)_$(2) := $$(RT_BUILD_DIR_$(1)_$(2))/arch/$$(HOST_$(1))/morestack.o
103105
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1)_$(2))
104106

105-
$$(RT_BUILD_DIR_$(1)_$(2))/rust_cxx_glue.o: rt/rust_cxx_glue.cpp $$(MKFILE_DEPS)
106-
@$$(call E, compile: $$@)
107-
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
108-
$$(SNAP_DEFINES) $$(RUNTIME_CXXFLAGS_$(1)_$(2))) $$<
109-
110107
$$(RT_BUILD_DIR_$(1)_$(2))/%.o: rt/%.c $$(MKFILE_DEPS)
111108
@$$(call E, compile: $$@)
112109
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
@@ -117,6 +114,11 @@ $$(RT_BUILD_DIR_$(1)_$(2))/%.o: rt/%.S $$(MKFILE_DEPS) \
117114
@$$(call E, compile: $$@)
118115
$$(Q)$$(call CFG_ASSEMBLE_$(1),$$@,$$<)
119116

117+
$$(RT_BUILD_DIR_$(1)_$(2))/%.o: rt/%.ll $$(MKFILE_DEPS) \
118+
$$(LLVM_CONFIG_$$(CFG_BUILD))
119+
@$$(call E, compile: $$@)
120+
$$(Q)$(LLC_$(CFG_BUILD)) -filetype=obj -mtriple=$(1) -relocation-model=pic -o $$@ $$<
121+
120122
$$(RT_BUILD_DIR_$(1)_$(2))/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJS_$(1)_$(2))
121123
@$$(call E, link: $$@)
122124
$$(Q)$(AR_$(1)) rcs $$@ $$^

branches/try2/src/etc/combine-tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def scrub(b):
4646
// AUTO-GENERATED FILE: DO NOT EDIT
4747
#[crate_id=\"run_pass_stage2#0.1\"];
4848
#[pkgid=\"run_pass_stage2#0.1\"];
49+
#[link(name=\"run_pass_stage2\", vers=\"0.1\")];
4950
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
5051
#[allow(warnings)];
5152
"""

branches/try2/src/etc/mklldeps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
for lib in out.strip().split(' '):
6060
lib = lib[2:] # chop of the leading '-l'
6161
f.write("#[link(name = \"" + lib + "\", kind = \"static\")]\n")
62+
f.write("#[link(name = \"stdc++\")]\n")
6263
if os == 'win32':
6364
f.write("#[link(name = \"imagehlp\")]\n")
6465
f.write("extern {}\n")

branches/try2/src/libextra/uuid.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ use std::rand;
6565
use std::rand::Rng;
6666
use std::cmp::Eq;
6767
use std::cast::{transmute,transmute_copy};
68-
use std::to_bytes::{IterBytes, Cb};
6968

7069
use serialize::{Encoder, Encodable, Decoder, Decodable};
7170

@@ -105,11 +104,6 @@ pub struct Uuid {
105104
/// The 128-bit number stored in 16 bytes
106105
bytes: UuidBytes
107106
}
108-
impl IterBytes for Uuid {
109-
fn iter_bytes(&self, _: bool, f: Cb) -> bool {
110-
f(self.bytes.slice_from(0))
111-
}
112-
}
113107

114108
/// A UUID stored as fields (identical to UUID, used only for conversions)
115109
struct UuidFields {
@@ -802,17 +796,6 @@ mod test {
802796
let u2 = Decodable::decode(&mut ebml::reader::Decoder(doc));
803797
assert_eq!(u, u2);
804798
}
805-
806-
#[test]
807-
fn test_iterbytes_impl_for_uuid() {
808-
use std::hashmap::HashSet;
809-
let mut set = HashSet::new();
810-
let id1 = Uuid::new_v4();
811-
let id2 = Uuid::new_v4();
812-
set.insert(id1);
813-
assert!(set.contains(&id1));
814-
assert!(!set.contains(&id2));
815-
}
816799
}
817800

818801
#[cfg(test)]

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
708708
// In the future, FreeBSD will use clang as default compiler.
709709
// It would be flexible to use cc (system's default C compiler)
710710
// instead of hard-coded gcc.
711-
// For win32, there is no cc command, so we add a condition to make it use
712-
// g++. We use g++ rather than gcc because it automatically adds linker
713-
// options required for generation of dll modules that correctly register
714-
// stack unwind tables.
711+
// For win32, there is no cc command, so we add a condition to make it use gcc.
715712
match sess.targ_cfg.os {
716713
abi::OsAndroid => match sess.opts.android_cross_path {
717714
Some(ref path) => format!("{}/bin/arm-linux-androideabi-gcc", *path),
@@ -720,7 +717,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
720717
(--android-cross-path)")
721718
}
722719
},
723-
abi::OsWin32 => ~"g++",
720+
abi::OsWin32 => ~"gcc",
724721
_ => ~"cc",
725722
}
726723
}
@@ -1032,6 +1029,13 @@ fn link_args(sess: Session,
10321029
}
10331030
}
10341031

1032+
if sess.targ_cfg.os == abi::OsWin32 {
1033+
// Make sure that we link to the dynamic libgcc, otherwise cross-module
1034+
// DWARF stack unwinding will not work.
1035+
// This behavior may be overriden by --link-args "-static-libgcc"
1036+
args.push(~"-shared-libgcc");
1037+
}
1038+
10351039
add_local_native_libraries(&mut args, sess);
10361040
add_upstream_rust_crates(&mut args, sess, dylib, tmpdir);
10371041
add_upstream_native_libraries(&mut args, sess);

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

Lines changed: 0 additions & 35 deletions
This file was deleted.

branches/try2/src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ pub mod back {
9292
pub mod link;
9393
pub mod manifest;
9494
pub mod abi;
95-
pub mod upcall;
9695
pub mod arm;
9796
pub mod mips;
9897
pub mod x86;

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ pub mod llvm {
319319
// automatically updated whenever LLVM is updated to include an up-to-date
320320
// set of the libraries we need to link to LLVM for.
321321
#[link(name = "rustllvm", kind = "static")]
322-
#[link(name = "stdc++")]
323322
extern {
324323
/* Create and destroy contexts. */
325324
pub fn LLVMContextCreate() -> ContextRef;

branches/try2/src/librustc/middle/lang_items.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ pub fn collect_language_items(crate: &ast::Crate,
208208
}
209209

210210
lets_do_this! {
211-
There are 42 lang items.
211+
There are 43 lang items.
212212

213213
// ID, Variant name, Name, Method name;
214214
0, FreezeTraitLangItem, "freeze", freeze_trait;
@@ -261,5 +261,7 @@ lets_do_this! {
261261
40, EventLoopFactoryLangItem, "event_loop_factory", event_loop_factory;
262262

263263
41, TypeIdLangItem, "type_id", type_id;
264+
265+
42, EhPersonalityLangItem, "eh_personality", eh_personality_fn;
264266
}
265267

branches/try2/src/librustc/middle/lint.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -872,12 +872,6 @@ fn check_crate_attrs_usage(cx: &Context, attrs: &[ast::Attribute]) {
872872
if !iter.any(|other_attr| { name.equiv(other_attr) }) {
873873
cx.span_lint(attribute_usage, attr.span, "unknown crate attribute");
874874
}
875-
if name.equiv(& &"link") {
876-
cx.tcx.sess.span_err(attr.span,
877-
"obsolete crate `link` attribute");
878-
cx.tcx.sess.note("the link attribute has been superceded by the crate_id \
879-
attribute, which has the format `#[crate_id = \"name#version\"]`");
880-
}
881875
}
882876
}
883877

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use metadata::{csearch, cstore, encoder};
3737
use middle::astencode;
3838
use middle::lang_items::{LangItem, ExchangeMallocFnLangItem, StartFnLangItem};
3939
use middle::lang_items::{MallocFnLangItem, ClosureExchangeMallocFnLangItem};
40+
use middle::lang_items::{EhPersonalityLangItem};
4041
use middle::trans::_match;
4142
use middle::trans::adt;
4243
use middle::trans::base;
@@ -1027,10 +1028,10 @@ pub fn get_landing_pad(bcx: @mut Block) -> BasicBlockRef {
10271028
// this represents but it's determined by the personality function and
10281029
// this is what the EH proposal example uses.
10291030
let llretty = Type::struct_([Type::i8p(), Type::i32()], false);
1030-
// The exception handling personality function. This is the C++
1031-
// personality function __gxx_personality_v0, wrapped in our naming
1032-
// convention.
1033-
let personality = bcx.ccx().upcalls.rust_personality;
1031+
// The exception handling personality function.
1032+
let personality = callee::trans_fn_ref(bcx,
1033+
langcall(bcx, None, "", EhPersonalityLangItem),
1034+
0).llfn;
10341035
// The only landing pad clause will be 'cleanup'
10351036
let llretval = LandingPad(pad_bcx, llretty, personality, 1u);
10361037
// The landing pad block is a cleanup
@@ -3195,6 +3196,8 @@ pub fn trans_crate(sess: session::Session,
31953196
reachable.push(ccx.crate_map_name.to_owned());
31963197
reachable.push(~"main");
31973198
reachable.push(~"rust_stack_exhausted");
3199+
reachable.push(~"rust_eh_personality"); // referenced from .eh_frame section on some platforms
3200+
reachable.push(~"rust_eh_personality_catch"); // referenced from rt/rust_try.ll
31983201

31993202
return CrateTranslation {
32003203
context: llcx,

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111

12-
use back::{upcall};
1312
use driver::session;
1413
use lib::llvm::{ContextRef, ModuleRef, ValueRef};
1514
use lib::llvm::{llvm, TargetData, TypeNames};
@@ -105,7 +104,6 @@ pub struct CrateContext {
105104
tcx: ty::ctxt,
106105
maps: astencode::Maps,
107106
stats: @mut Stats,
108-
upcalls: @upcall::Upcalls,
109107
tydesc_type: Type,
110108
int_type: Type,
111109
opaque_vec_type: Type,
@@ -233,7 +231,6 @@ impl CrateContext {
233231
llvm_insns: HashMap::new(),
234232
fn_stats: ~[]
235233
},
236-
upcalls: upcall::declare_upcalls(targ_cfg, llmod),
237234
tydesc_type: tydesc_type,
238235
int_type: int_type,
239236
opaque_vec_type: opaque_vec_type,

branches/try2/src/libstd/rt/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ mod local_ptr;
173173
/// Bindings to pthread/windows thread-local storage.
174174
mod thread_local_storage;
175175

176+
/// Stack unwinding
177+
pub mod unwind;
178+
176179
/// Just stuff
177180
mod util;
178181

0 commit comments

Comments
 (0)