Closed
Description
I'm trying to create a program without std and without libc. Based on this page: http://doc.rust-lang.org/guide-unsafe.html (and elsewhere). I still cannot get a minimal program to work. It compiles, but the binary segmentation faults (on x86_64 linux).
Compiled with: rustc --crate-type=bin -C link-args="-nostdlib" -C relocation-model=static start.rs
Program is:
#![feature(lang_items)]
#![no_std]
extern crate core;
extern crate rlibc;
#[lang = "stack_exhausted"]
extern fn stack_exhausted() {}
#[lang = "eh_personality" ]
extern fn eh_personality() {}
#[lang = "begin_unwind" ]
unsafe extern fn begin_unwind(args: &core::fmt::Arguments,
file: &str,
line: uint) -> ! {
loop {}
}
#[start]
fn main(argc: int, argv: *const *const u8) -> int
{
0
}
Metadata
Metadata
Assignees
Labels
No labels