Skip to content

Commit b3c8bad

Browse files
damienmgacmcarther
authored andcommitted
Set the target triplet when invoking rustc (#136)
The target triplet is coming from the toolchain and should be passed along to rustc.
1 parent ab32ede commit b3c8bad

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

rust/private/rustc.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def rustc_compile_action(
229229
output_dir,
230230
"--emit=dep-info,link",
231231
"--color always",
232+
"--target=" + toolchain.target_triple,
232233
] +
233234
["--codegen link-arg='-Wl,-rpath={}'".format(rpath) for rpath in rpaths] +
234235
features_flags +

rust/toolchain.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def _rust_toolchain_impl(ctx):
2222
rust_lib = _get_files(ctx.attr.rust_lib),
2323
staticlib_ext = ctx.attr.staticlib_ext,
2424
dylib_ext = ctx.attr.dylib_ext,
25+
target_triple = ctx.attr.target_triple,
26+
exec_triple = ctx.attr.exec_triple,
2527
os = ctx.attr.os,
2628
compilation_mode_opts = compilation_mode_opts,
2729
crosstool_files = ctx.files._crosstool,

0 commit comments

Comments
 (0)