rustc: Set data layout and target triple
This commit is contained in:
parent
aeef8cee29
commit
f371dc613a
2 changed files with 23 additions and 0 deletions
|
@ -157,6 +157,26 @@ fn get_module_asm() -> str {
|
|||
ret _str.connect(glues, "\n\n");
|
||||
}
|
||||
|
||||
fn get_data_layout() -> str {
|
||||
if (_str.eq(target_os(), "macos")) {
|
||||
ret "e-p:32:32-f64:32:64-i64:32:64-f80:128:128-n8:16:32";
|
||||
}
|
||||
if (_str.eq(target_os(), "win32")) {
|
||||
ret "e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32";
|
||||
}
|
||||
ret "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32";
|
||||
}
|
||||
|
||||
fn get_target_triple() -> str {
|
||||
if (_str.eq(target_os(), "macos")) {
|
||||
ret "i686-apple-darwin";
|
||||
}
|
||||
if (_str.eq(target_os(), "win32")) {
|
||||
ret "i686-pc-mingw32";
|
||||
}
|
||||
ret "i686-pc-linux-gnu";
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Local Variables:
|
||||
|
|
|
@ -2151,6 +2151,9 @@ fn trans_crate(session.session sess, @ast.crate crate, str output) {
|
|||
llvm.LLVMModuleCreateWithNameInContext(_str.buf("rust_out"),
|
||||
llvm.LLVMGetGlobalContext());
|
||||
|
||||
llvm.LLVMSetDataLayout(llmod, _str.buf(x86.get_data_layout()));
|
||||
llvm.LLVMSetTarget(llmod, _str.buf(x86.get_target_triple()));
|
||||
|
||||
llvm.LLVMSetModuleInlineAsm(llmod, _str.buf(x86.get_module_asm()));
|
||||
|
||||
auto intrinsics = declare_intrinsics(llmod);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue