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
// 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() {} |
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
extern mod syntax; | |
extern mod rustc; | |
pub use syntax::ast; | |
pub use rustc::middle::ty; | |
pub use rustc::middle::ty::t; | |
fn cpp_arg_mangle(arg: t) -> ~str { | |
let arg = ty::get(arg); | |
match arg.sty { |
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
// test code for mingw / libuv / _CRT_NON_CONFORMING_SWPRINTFS | |
// compare result with libuv built with different configurations: | |
// $ make | |
// $ make CFLAGS="-D_CRT_NON_CONFORMING_SWPRINTFS" | |
#include <stdio.h> | |
#include <io.h> | |
#include <fcntl.h> | |
#include "uv.h" |
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
#-*- encoding: utf8 -*- | |
import os | |
import shutil | |
from lxml import html | |
def parse(text): | |
h = html.fromstring(text) | |
content = h.get_element_by_id('content') | |
ret = u'' |
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
$ make check | |
... | |
failures: | |
[run-pass] run-pass/extern-pass-TwoU64s-ref.rs | |
[run-pass] run-pass/extern-pass-TwoU64s.rs | |
[run-pass] run-pass/extern-return-TwoU64s.rs | |
[run-pass] run-pass/glob-std.rs | |
[run-pass] run-pass/linkage-visibility.rs |
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
use std::os; | |
use std::io; | |
use std::io::fs; | |
fn main() { | |
let tmp_path = os::tmpdir(); | |
for i in range(0u, 20u) { | |
let path = tmp_path.join(i.to_str()); | |
do spawn { | |
io::result(|| fs::mkdir(&path, io::UserRWX)); |
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
$ make check-stage2-T-i686-pc-mingw32-H-i686-pc-mingw32-rustpkg | |
cfg: build triple i686-pc-mingw32 | |
cfg: host triples i686-pc-mingw32 | |
cfg: target triples i686-pc-mingw32 | |
cfg: enabling more debugging (CFG_ENABLE_DEBUG) | |
cfg: host for i686-pc-mingw32 is i386 | |
cfg: os for i686-pc-mingw32 is pc-mingw32 | |
cfg: using gcc | |
cfg: disabling valgrind due to its unreliability on this platform |
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
# win64; host = target = x86_64-w64-mingw32 | |
$ rustc.exe ~/stone/rust/src/libstd/lib.rs -Z time-passes | |
time: 25.673 s parsing | |
time: 0.136 s gated feature checking | |
time: 0.051 s std macros injection | |
time: 0.209 s configuration 1 | |
time: 17.854 s expansion | |
time: 0.322 s configuration 2 | |
time: 0.304 s maybe building test harness | |
time: 0.000 s std injection |
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
// From rust get `libstd/libc.rs` to the working dir. | |
// From rust-windows <https://github.com/klutzy/rust-windows> | |
// copy whole `ll/` dir to the working dir and | |
// patch some code: (TODO) | |
// From win32.js <https://github.com/klutzy/win32.js>, copy | |
// `library_win32.js` and `window.js` to working dir. | |
// | |
// emscripten uses le32-unknown-nacl triple but rustc doesn't know it now. | |
// So just use similar target instead. | |
// Here I use `win32` because libc.rs needs it. |
OlderNewer