Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Lifted from https://news.ycombinator.com/item?id=14305084
% cat test.rs
fn main() {
println!("Hello, world!");
}
% rustc --emit llvm-bc -C lto test.rs
% LIB=$HOME/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib
% xcrun --toolchain XcodeDefault clang -o test test.bc ~/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-ea49ffd3fee5264c.rlib
warning: overriding the module target triple with x86_64-apple-macosx10.12.0 [-Woverride-module]
1 warning generated.
% ./test
Hello, world!
% rustc --version
rustc 1.18.0-nightly (91ae22a01 2017-04-05)
% xcrun --toolchain XcodeDefault clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.