This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[cfg(unix)] | |
fn trace(n_frames: uint) -> ~[~str] { | |
use std::libc::{c_void, c_int, c_char}; | |
use std::libc; | |
use std::c_str; | |
use std::ptr; | |
use std::vec; | |
extern { | |
fn backtrace(buffer: *mut *mut c_void, size: c_int) -> c_int; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[feature(managed_boxes)]; | |
extern mod extra; | |
extern mod syntax; | |
extern mod rustc; | |
use std::os::args; | |
use std::hashmap::{HashMap, HashSet}; | |
use syntax::ast; | |
use syntax::ast_map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: c.dll rs.exe cl.exe hand.exe | |
c.dll: c.c | |
gcc -shared -o $@ $< | |
rs.exe: rs.rs | |
rustc --opt-level=0 -Z no-opt -L . $< -o rs.ll --emit ir | |
rustc --opt-level=0 -Z no-opt -L . $< -o rs.s --emit asm | |
rustc --opt-level=0 -Z no-opt -L . $< -o $@ -C save-temps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: a | |
a: a.rs libda.so | |
rustc a.rs -o $@ -L . | |
libda.so: da.cpp | |
clang++ $< -fPIC -shared -o $@ | |
run: a libda.so | |
LD_LIBRARY_PATH=. ./a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// let's build rust program with msvc linker! | |
#![feature(intrinsics, lang_items)] | |
#![no_std] | |
#![no_main] | |
// (this is not required for msvc, but for "standard" build.) | |
#[no_mangle] | |
pub extern "C" fn rust_stack_exhausted() {} |
OlderNewer