From 766f6c5d0ad5c71f42ab3a305572bf1e7b5edafa Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Fri, 17 Jan 2020 16:11:52 -0800 Subject: [PATCH] Actually pass target LLVM args to LLVM --- src/librustc_codegen_llvm/llvm_util.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs index 52613fef7e612..4823fe10c463f 100644 --- a/src/librustc_codegen_llvm/llvm_util.rs +++ b/src/librustc_codegen_llvm/llvm_util.rs @@ -58,9 +58,10 @@ unsafe fn configure_llvm(sess: &Session) { let cg_opts = sess.opts.cg.llvm_args.iter(); let tg_opts = sess.target.target.options.llvm_args.iter(); + let sess_args = cg_opts.chain(tg_opts); let user_specified_args: FxHashSet<_> = - cg_opts.chain(tg_opts).map(|s| llvm_arg_to_arg_name(s)).filter(|s| s.len() > 0).collect(); + sess_args.clone().map(|s| llvm_arg_to_arg_name(s)).filter(|s| s.len() > 0).collect(); { // This adds the given argument to LLVM. Unless `force` is true @@ -107,7 +108,7 @@ unsafe fn configure_llvm(sess: &Session) { // during inlining. Unfortunately these may block other optimizations. add("-preserve-alignment-assumptions-during-inlining=false", false); - for arg in &sess.opts.cg.llvm_args { + for arg in sess_args { add(&(*arg), true); } }