-
Notifications
You must be signed in to change notification settings - Fork 526
Closed
Labels
Description
I'm having difficulty using bazel with a custom target based on x86_64-unknown-linux-gnu. In theory, given a simple library:
#![no_std]
#[no_mangle]
pub extern "C" fn rust_function() {}After bootstrapping libcore and friends I can now build the library for my new target:
rustc --crate-type=lib foo.rs --target x86_64-unknown-none.json \
-L dependency=~/rust_libs/ \
--extern 'noprelude:core=~/rust_libs/libcore-7363d577ba15c1d7.rmeta' \
--extern 'noprelude:compiler_builtins=~/rust_libs/libcompiler_builtins-b774e5dde03423fb.rmeta' \
-Z unstable-optionsI'm aware of how to accomplish the cross build with cargo, but I'm not sure how to do this with bazel. There doesn't seem to be a way for me to pass my target JSON through a new rust_toolchain definition.