rustc: Switch defaults from libgreen to libnative
The compiler will no longer inject libgreen as the default runtime for rust programs, this commit switches it over to libnative by default. Now that libnative has baked for some time, it is ready enough to start getting more serious usage as the default runtime for rustc generated binaries. We've found that there isn't really a correct decision in choosing a 1:1 or M:N runtime as a default for all applications, but it seems that a larger number of programs today would work more reasonable with a native default rather than a green default. With this commit come a number of bugfixes: * The main native task is now named "<main>" * The main native task has the stack bounds set up properly * #[no_uv] was renamed to #[no_start] * The core-run-destroy test was rewritten for both libnative and libgreen and one of the tests was modified to be more robust. * The process-detach test was locked to libgreen because it uses signal handling
This commit is contained in:
parent
7b957a879b
commit
ab1dd09d73
15 changed files with 130 additions and 84 deletions
|
@ -46,8 +46,8 @@ fn use_std(krate: &ast::Crate) -> bool {
|
|||
!attr::contains_name(krate.attrs.as_slice(), "no_std")
|
||||
}
|
||||
|
||||
fn use_uv(krate: &ast::Crate) -> bool {
|
||||
!attr::contains_name(krate.attrs.as_slice(), "no_uv")
|
||||
fn use_start(krate: &ast::Crate) -> bool {
|
||||
!attr::contains_name(krate.attrs.as_slice(), "no_start")
|
||||
}
|
||||
|
||||
fn no_prelude(attrs: &[ast::Attribute]) -> bool {
|
||||
|
@ -87,18 +87,10 @@ impl<'a> fold::Folder for StandardLibraryInjector<'a> {
|
|||
span: DUMMY_SP
|
||||
});
|
||||
|
||||
if use_uv(&krate) && !self.sess.building_library.get() {
|
||||
if use_start(&krate) && !self.sess.building_library.get() {
|
||||
vis.push(ast::ViewItem {
|
||||
node: ast::ViewItemExternCrate(token::str_to_ident("green"),
|
||||
with_version("green"),
|
||||
ast::DUMMY_NODE_ID),
|
||||
attrs: Vec::new(),
|
||||
vis: ast::Inherited,
|
||||
span: DUMMY_SP
|
||||
});
|
||||
vis.push(ast::ViewItem {
|
||||
node: ast::ViewItemExternCrate(token::str_to_ident("rustuv"),
|
||||
with_version("rustuv"),
|
||||
node: ast::ViewItemExternCrate(token::str_to_ident("native"),
|
||||
with_version("native"),
|
||||
ast::DUMMY_NODE_ID),
|
||||
attrs: Vec::new(),
|
||||
vis: ast::Inherited,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue