support i386 (no linking yet)

This commit is contained in:
Folkert 2021-09-04 01:31:33 +02:00
parent 2954b582a7
commit a7eeae05ca
8 changed files with 127 additions and 53 deletions

View file

@ -95,7 +95,7 @@ pub fn gen_from_mono_module(
// Generate the binary
let ptr_bytes = target.pointer_width().unwrap().bytes() as u32;
let context = Context::create();
let module = arena.alloc(module_from_builtins(&context, "app", ptr_bytes));
let module = arena.alloc(module_from_builtins(target, &context, "app"));
// strip Zig debug stuff
// module.strip_debug_info();
@ -272,7 +272,7 @@ pub fn gen_from_mono_module(
// Emit the .o file
use target_lexicon::Architecture;
match target.architecture {
Architecture::X86_64 | Architecture::Aarch64(_) => {
Architecture::X86_64 | Architecture::X86_32(_) | Architecture::Aarch64(_) => {
let reloc = RelocMode::Default;
let model = CodeModel::Default;
let target_machine =