/// user-defined libraries.
pub post_link_args: LinkArgs,
+ /// Environment variables to be set before invoking the linker.
+ pub link_env: Vec<(String, String)>,
+
/// Extra arguments to pass to the external assembler (when used)
pub asm_args: Vec<String>,
pre_link_objects_dll: Vec::new(),
post_link_objects: Vec::new(),
late_link_args: LinkArgs::new(),
+ link_env: Vec::new(),
archive_format: "gnu".to_string(),
custom_unwind_resume: false,
lib_allocation_crate: "alloc_system".to_string(),
// possibly interpret the wasm, and a .wasm file
exe_suffix: ".js".to_string(),
linker_is_gnu: true,
+ link_env: vec![("EMCC_WASM_BACKEND".to_string(), "1".to_string())],
allow_asm: false,
obj_is_bitcode: true,
is_like_emscripten: true,
if let Some(args) = sess.target.target.options.post_link_args.get(&flavor) {
cmd.args(args);
}
+ for &(ref k, ref v) in &sess.target.target.options.link_env {
+ cmd.env(k, v);
+ }
if sess.opts.debugging_opts.print_link_args {
println!("{:?}", &cmd);
let extra_link_args = vec!["-L".to_owned(),
aux_dir.to_str().unwrap().to_owned()];
- let mut env = self.props.rustc_env.clone();
- // Tell emscripten to link using libc produced with LLVM backend
- if self.config.target.contains("wasm32") && self.config.target.contains("experimental") {
- env.push(("EMCC_WASM_BACKEND".to_string(), "1".to_string()));
- }
-
for rel_ab in &self.props.aux_builds {
let aux_testpaths = self.compute_aux_test_paths(rel_ab);
let aux_props = self.props.from_aux_file(&aux_testpaths.file,
};
let aux_args = aux_cx.make_compile_args(crate_type, &aux_testpaths.file, aux_output);
let auxres = aux_cx.compose_and_run(aux_args,
- env.clone(),
+ Vec::new(),
aux_cx.config.compile_lib_path.to_str().unwrap(),
Some(aux_dir.to_str().unwrap()),
None);
}
self.compose_and_run(args,
- env,
+ self.props.rustc_env.clone(),
self.config.compile_lib_path.to_str().unwrap(),
Some(aux_dir.to_str().unwrap()),
input)