auto merge of #13117 : alexcrichton/rust/no-crate-map, r=brson

This can be done now that logging has been moved out and libnative is the default (not libgreen)
This commit is contained in:
bors 2014-03-26 01:41:57 -07:00
commit de85948ac0
30 changed files with 116 additions and 338 deletions

View file

@ -1,7 +1,7 @@
-include ../tools.mk
all:
$(RUSTC) lib.rs -C gen-crate-map
$(RUSTC) lib.rs
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
$(CC) main.c -o $(call RUN,main) -lboot
$(call RUN,main)

View file

@ -16,7 +16,7 @@ extern crate green;
#[no_mangle] // this needs to get called from C
pub extern "C" fn foo(argc: int, argv: **u8) -> int {
green::start(argc, argv, proc() {
green::start(argc, argv, rustuv::event_loop, proc() {
spawn(proc() {
println!("hello");
});

View file

@ -1,7 +1,7 @@
-include ../tools.mk
all:
$(RUSTC) lib.rs -C gen-crate-map
$(RUSTC) lib.rs
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
$(CC) main.c -o $(call RUN,main) -lboot
$(call RUN,main)

View file

@ -5,7 +5,7 @@ ifneq ($(shell uname),Darwin)
endif
all:
$(RUSTC) foo.rs -C gen-crate-map
$(RUSTC) foo.rs
ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
$(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++
$(call RUN,bar)

View file

@ -1,7 +0,0 @@
-include ../tools.mk
all:
$(RUSTC) lib.rs -C gen-crate-map
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
$(CC) main.c -o $(call RUN,main) -lboot -Wl,-rpath,$(TMPDIR)
RUST_LOG=boot $(call RUN,main)

View file

@ -1,32 +0,0 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[crate_id="boot#0.1"];
#[crate_type="dylib"];
#[no_uv];
#[feature(phase)];
extern crate rustuv;
extern crate green;
#[phase(syntax, link)] extern crate log;
use std::rt::crate_map::{CrateMap, rust_set_crate_map};
// pull in this symbol from libstd into this crate (for convenience)
#[no_mangle]
pub static set_crate_map: extern "C" fn(*CrateMap<'static>) = rust_set_crate_map;
#[no_mangle] // this needs to get called from C
pub extern "C" fn foo(argc: int, argv: **u8) -> int {
green::start(argc, argv, proc() {
if log_enabled!(log::DEBUG) { return }
fail!()
})
}

View file

@ -1,20 +0,0 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// this is the rust entry point that we're going to call.
int foo(int argc, char *argv[]);
extern void (*set_crate_map)(void *map);
extern int _rust_crate_map_toplevel;
int main(int argc, char *argv[]) {
set_crate_map(&_rust_crate_map_toplevel);
return foo(argc, argv);
}

View file

@ -5,7 +5,7 @@ ifneq ($(shell uname),Darwin)
endif
all:
$(RUSTC) foo.rs -C gen-crate-map -Z lto
$(RUSTC) foo.rs -Z lto
ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
$(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++
$(call RUN,bar)

View file

@ -49,7 +49,7 @@ macro_rules! iotest (
#[cfg(test)] #[start]
fn start(argc: int, argv: **u8) -> int {
green::start(argc, argv, __test::main)
green::start(argc, argv, rustuv::event_loop, __test::main)
}
iotest!(fn test_destroy_once() {

View file

@ -15,7 +15,9 @@ extern crate green;
extern crate rustuv;
#[start]
fn start(argc: int, argv: **u8) -> int { green::start(argc, argv, main) }
fn start(argc: int, argv: **u8) -> int {
green::start(argc, argv, rustuv::event_loop, main)
}
fn main() {
native::task::spawn(proc() customtask());

View file

@ -18,7 +18,7 @@ static mut DROP_T: int = 0i;
#[start]
fn start(argc: int, argv: **u8) -> int {
let ret = green::start(argc, argv, main);
let ret = green::start(argc, argv, green::basic::event_loop, main);
unsafe {
assert_eq!(2, DROP);
assert_eq!(1, DROP_S);

View file

@ -28,7 +28,9 @@ use std::io::process;
use std::io::signal::{Listener, Interrupt};
#[start]
fn start(argc: int, argv: **u8) -> int { green::start(argc, argv, main) }
fn start(argc: int, argv: **u8) -> int {
green::start(argc, argv, rustuv::event_loop, main)
}
fn main() {
unsafe { libc::setsid(); }