Get a basic dylib linking started

This commit is contained in:
Richard Feldman 2020-10-24 12:26:40 -04:00
parent e8f1201937
commit b4377d4d67
8 changed files with 200 additions and 233 deletions

View file

@ -16,9 +16,9 @@ use target_lexicon::Triple;
pub fn gen_from_mono_module(
arena: &Bump,
loaded: MonomorphizedModule,
filename: PathBuf,
file_path: PathBuf,
target: Triple,
dest_filename: &Path,
app_o_file: &Path,
opt_level: OptLevel,
) {
use roc_reporting::report::{can_problem, type_problem, RocDocAllocator, DEFAULT_PALETTE};
@ -32,7 +32,7 @@ pub fn gen_from_mono_module(
let alloc = RocDocAllocator::new(&src_lines, home, &loaded.interns);
for problem in loaded.can_problems.into_iter() {
let report = can_problem(&alloc, filename.clone(), problem);
let report = can_problem(&alloc, file_path.clone(), problem);
let mut buf = String::new();
report.render_color_terminal(&mut buf, &alloc, &palette);
@ -41,7 +41,7 @@ pub fn gen_from_mono_module(
}
for problem in loaded.type_problems.into_iter() {
let report = type_problem(&alloc, filename.clone(), problem);
let report = type_problem(&alloc, file_path.clone(), problem);
let mut buf = String::new();
report.render_color_terminal(&mut buf, &alloc, &palette);
@ -132,8 +132,6 @@ pub fn gen_from_mono_module(
let target_machine = target::target_machine(&target, opt, reloc, model).unwrap();
target_machine
.write_to_file(&env.module, FileType::Object, &dest_filename)
.write_to_file(&env.module, FileType::Object, &app_o_file)
.expect("Writing .o file failed");
println!("\nSuccess! 🎉\n\n\t{}\n", dest_filename.display());
}