Skip to content

Commit 20f080f

Browse files
committed
---
yaml --- r: 90535 b: refs/heads/master c: c11f290 h: refs/heads/master i: 90533: 4c87fbe 90531: 530fc19 90527: 2869811 v: v3
1 parent b44b75e commit 20f080f

File tree

3 files changed

+10
-29
lines changed

3 files changed

+10
-29
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e2fa3c3af79df48776dabcdf9291534822e6f874
2+
refs/heads/master: c11f29019995a16c702111d0cfb927c795720fc0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/src/librustc/middle/entry.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use driver::session;
1313
use driver::session::Session;
14-
use syntax::abi;
1514
use syntax::ast::{Crate, NodeId, item, item_fn};
1615
use syntax::ast_map;
1716
use syntax::attr;
@@ -46,10 +45,7 @@ impl Visitor<()> for EntryContext {
4645
}
4746

4847
pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map) {
49-
50-
// FIXME #4404 android JNI hacks
51-
if *session.building_library &&
52-
session.targ_cfg.os != abi::OsAndroid {
48+
if *session.building_library {
5349
// No need to find a main function
5450
return;
5551
}
@@ -149,10 +145,6 @@ fn configure_main(this: &mut EntryContext) {
149145
}
150146
}
151147
this.session.abort_if_errors();
152-
} else {
153-
// If we *are* building a library, then we're on android where we still might
154-
// optionally want to translate main $4404
155-
assert_eq!(this.session.targ_cfg.os, abi::OsAndroid);
156148
}
157149
}
158150
}

trunk/src/librustc/middle/trans/base.rs

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ use syntax::parse::token::{special_idents};
8585
use syntax::print::pprust::stmt_to_str;
8686
use syntax::{ast, ast_util, codemap, ast_map};
8787
use syntax::attr::AttrMetaMethods;
88-
use syntax::abi::{X86, X86_64, Arm, Mips, Rust, RustIntrinsic, OsWin32, OsAndroid};
88+
use syntax::abi::{X86, X86_64, Arm, Mips, Rust, RustIntrinsic, OsWin32};
8989
use syntax::visit;
9090
use syntax::visit::Visitor;
9191

@@ -2268,11 +2268,7 @@ fn finish_register_fn(ccx: @mut CrateContext, sp: Span, sym: ~str, node_id: ast:
22682268
lib::llvm::SetLinkage(llfn, lib::llvm::InternalLinkage);
22692269
}
22702270

2271-
// FIXME #4404 android JNI hacks
2272-
let is_entry = is_entry_fn(&ccx.sess, node_id) && (!*ccx.sess.building_library ||
2273-
(*ccx.sess.building_library &&
2274-
ccx.sess.targ_cfg.os == OsAndroid));
2275-
if is_entry {
2271+
if is_entry_fn(&ccx.sess, node_id) && !*ccx.sess.building_library {
22762272
create_entry_wrapper(ccx, sp, llfn);
22772273
}
22782274
}
@@ -2340,13 +2336,7 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
23402336
let llfty = Type::func([ccx.int_type, Type::i8().ptr_to().ptr_to()],
23412337
&ccx.int_type);
23422338

2343-
// FIXME #4404 android JNI hacks
2344-
let main_name = if *ccx.sess.building_library {
2345-
"amain"
2346-
} else {
2347-
"main"
2348-
};
2349-
let llfn = decl_cdecl_fn(ccx.llmod, main_name, llfty);
2339+
let llfn = decl_cdecl_fn(ccx.llmod, "main", llfty);
23502340
let llbb = "top".with_c_str(|buf| {
23512341
unsafe {
23522342
llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)
@@ -3178,14 +3168,13 @@ pub fn trans_crate(sess: session::Session,
31783168
}).to_owned_vec();
31793169

31803170
// Make sure that some other crucial symbols are not eliminated from the
3181-
// module. This includes the main function (main/amain elsewhere), the crate
3182-
// map (used for debug log settings and I/O), and finally the curious
3183-
// rust_stack_exhausted symbol. This symbol is required for use by the
3184-
// libmorestack library that we link in, so we must ensure that this symbol
3185-
// is not internalized (if defined in the crate).
3171+
// module. This includes the main function, the crate map (used for debug
3172+
// log settings and I/O), and finally the curious rust_stack_exhausted
3173+
// symbol. This symbol is required for use by the libmorestack library that
3174+
// we link in, so we must ensure that this symbol is not internalized (if
3175+
// defined in the crate).
31863176
reachable.push(ccx.crate_map_name.to_owned());
31873177
reachable.push(~"main");
3188-
reachable.push(~"amain");
31893178
reachable.push(~"rust_stack_exhausted");
31903179

31913180
return CrateTranslation {

0 commit comments

Comments
 (0)