Skip to content

Commit 4a2936b

Browse files
nikomatsakisbrson
authored andcommitted
---
yaml --- r: 6114 b: refs/heads/master c: ec77144 h: refs/heads/master v: v3
1 parent 41fe152 commit 4a2936b

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: e012fd03f3a4ff383a2e9beae62f93c527e1eed5
2+
refs/heads/master: ec77144713a67ae8aa616cecd054786cf9e5aa44

trunk/src/comp/back/link.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,9 @@ fn link_binary(sess: session::session,
516516
let prog: str = "gcc";
517517
// The invocations of gcc share some flags across platforms
518518

519-
let gcc_args = [stage, "-m32", "-o", out_filename, obj_filename];
519+
let gcc_args =
520+
[stage] + sess.get_targ_cfg().target_strs.gcc_args +
521+
["-o", out_filename, obj_filename];
520522
let lib_cmd;
521523

522524
let os = sess.get_targ_cfg().os;

trunk/src/comp/back/target_strs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ type t = {
44
module_asm: str,
55
meta_sect_name: str,
66
data_layout: str,
7-
target_triple: str
7+
target_triple: str,
8+
gcc_args: [str]
89
};

trunk/src/comp/back/x86.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ fn get_target_strs(target_os: session::os) -> target_strs::t {
3333
session::os_macos. { "i686-apple-darwin" }
3434
session::os_win32. { "i686-pc-mingw32" }
3535
session::os_linux. { "i686-unknown-linux-gnu" }
36-
}
36+
},
37+
38+
gcc_args: ["-m32"]
3739
};
3840
}
3941

trunk/src/comp/back/x86_64.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ fn get_target_strs(target_os: session::os) -> target_strs::t {
3333
session::os_macos. { "x86_64-apple-darwin" }
3434
session::os_win32. { "x86_64-pc-mingw32" }
3535
session::os_linux. { "x86_64-unknown-linux-gnu" }
36-
}
36+
},
37+
38+
gcc_args: ["-m64"]
3739
};
3840
}
3941

trunk/src/comp/middle/trans.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6063,11 +6063,13 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
60636063
llvm::LLVMModuleCreateWithNameInContext
60646064
(buf, llvm::LLVMGetGlobalContext())
60656065
});
6066+
let data_layout = sess.get_targ_cfg().target_strs.data_layout;
6067+
let targ_triple = sess.get_targ_cfg().target_strs.target_triple;
60666068
let _: () =
6067-
str::as_buf(sess.get_targ_cfg().target_strs.data_layout,
6069+
str::as_buf(data_layout,
60686070
{|buf| llvm::LLVMSetDataLayout(llmod, buf) });
60696071
let _: () =
6070-
str::as_buf(sess.get_targ_cfg().target_strs.target_triple,
6072+
str::as_buf(targ_triple,
60716073
{|buf| llvm::LLVMSetTarget(llmod, buf) });
60726074
let targ_cfg = sess.get_targ_cfg();
60736075
let td = mk_target_data(sess.get_targ_cfg().target_strs.data_layout);

0 commit comments

Comments
 (0)