add -m64 to gcc args if appropriate
This commit is contained in:
parent
e012fd03f3
commit
ec77144713
|
@ -516,7 +516,9 @@ fn link_binary(sess: session::session,
|
|||
let prog: str = "gcc";
|
||||
// The invocations of gcc share some flags across platforms
|
||||
|
||||
let gcc_args = [stage, "-m32", "-o", out_filename, obj_filename];
|
||||
let gcc_args =
|
||||
[stage] + sess.get_targ_cfg().target_strs.gcc_args +
|
||||
["-o", out_filename, obj_filename];
|
||||
let lib_cmd;
|
||||
|
||||
let os = sess.get_targ_cfg().os;
|
||||
|
|
|
@ -4,5 +4,6 @@ type t = {
|
|||
module_asm: str,
|
||||
meta_sect_name: str,
|
||||
data_layout: str,
|
||||
target_triple: str
|
||||
target_triple: str,
|
||||
gcc_args: [str]
|
||||
};
|
|
@ -33,7 +33,9 @@ fn get_target_strs(target_os: session::os) -> target_strs::t {
|
|||
session::os_macos. { "i686-apple-darwin" }
|
||||
session::os_win32. { "i686-pc-mingw32" }
|
||||
session::os_linux. { "i686-unknown-linux-gnu" }
|
||||
}
|
||||
},
|
||||
|
||||
gcc_args: ["-m32"]
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,9 @@ fn get_target_strs(target_os: session::os) -> target_strs::t {
|
|||
session::os_macos. { "x86_64-apple-darwin" }
|
||||
session::os_win32. { "x86_64-pc-mingw32" }
|
||||
session::os_linux. { "x86_64-unknown-linux-gnu" }
|
||||
}
|
||||
},
|
||||
|
||||
gcc_args: ["-m64"]
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -6063,11 +6063,13 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
|
|||
llvm::LLVMModuleCreateWithNameInContext
|
||||
(buf, llvm::LLVMGetGlobalContext())
|
||||
});
|
||||
let data_layout = sess.get_targ_cfg().target_strs.data_layout;
|
||||
let targ_triple = sess.get_targ_cfg().target_strs.target_triple;
|
||||
let _: () =
|
||||
str::as_buf(sess.get_targ_cfg().target_strs.data_layout,
|
||||
str::as_buf(data_layout,
|
||||
{|buf| llvm::LLVMSetDataLayout(llmod, buf) });
|
||||
let _: () =
|
||||
str::as_buf(sess.get_targ_cfg().target_strs.target_triple,
|
||||
str::as_buf(targ_triple,
|
||||
{|buf| llvm::LLVMSetTarget(llmod, buf) });
|
||||
let targ_cfg = sess.get_targ_cfg();
|
||||
let td = mk_target_data(sess.get_targ_cfg().target_strs.data_layout);
|
||||
|
|
Loading…
Reference in New Issue