Created
April 28, 2017 00:59
-
-
Save mbrubeck/8f9b933a4ffb62c243d4d36655ef419b to your computer and use it in GitHub Desktop.
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
#![no_std] | |
#![feature(alloc_system, lang_items)] | |
extern crate alloc_system; | |
pub fn foo() -> u32 { | |
42 | |
} | |
#[lang = "eh_personality"] extern fn eh_personality() {} | |
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} } |
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
mbrubeck@p50:~/src/test$ rustc -V | |
rustc 1.18.0-nightly (2bd4b5c6d 2017-04-23) | |
mbrubeck@p50:~/src/test$ rustc -C lto --crate-type=staticlib -C opt-level=z -C panic=abort lib.rs && strip liblib.a | |
note: link against the following native artifacts when linking against this static library | |
note: the order and any duplication can be significant on some platforms, and so may need to be preserved | |
note: library: c | |
note: library: m | |
note: library: rt | |
note: library: pthread | |
note: library: util | |
mbrubeck@p50:~/src/test$ ls -lh liblib.a | |
-rw-r--r-- 1 mbrubeck mbrubeck 428 Apr 27 17:58 liblib.a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment