From 035444fb818cd9adac8b098f21caa711d9f76cc5 Mon Sep 17 00:00:00 2001 From: Folkert Date: Fri, 6 Nov 2020 00:05:41 +0100 Subject: [PATCH] hit a linker error, finally --- compiler/build/src/program.rs | 2 +- compiler/gen/src/llvm/build.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/build/src/program.rs b/compiler/build/src/program.rs index 2836704ae7..3652250494 100644 --- a/compiler/build/src/program.rs +++ b/compiler/build/src/program.rs @@ -115,7 +115,7 @@ pub fn gen_from_mono_module( if fn_val.verify(true) { fpm.run_on(&fn_val); } else { - // fn_val.print_to_stderr(); + fn_val.print_to_stderr(); // env.module.print_to_stderr(); // NOTE: If this fails, uncomment the above println to debug. panic!( diff --git a/compiler/gen/src/llvm/build.rs b/compiler/gen/src/llvm/build.rs index 553e843ed4..ff6c43f272 100644 --- a/compiler/gen/src/llvm/build.rs +++ b/compiler/gen/src/llvm/build.rs @@ -3432,7 +3432,9 @@ fn get_foreign_symbol<'a, 'ctx, 'env>( None => { let foreign_function = module.add_function( foreign_symbol.as_str(), - context.i64_type().fn_type(&[], false), + context + .struct_type(&[], false) + .fn_type(&[context.struct_type(&[], false).into()], false), Some(Linkage::External), ); foreign_function.set_call_conventions(C_CALL_CONV);