hit a linker error, finally

This commit is contained in:
Folkert 2020-11-06 00:05:41 +01:00
parent 4c3f0a5002
commit 035444fb81
2 changed files with 4 additions and 2 deletions

View file

@ -115,7 +115,7 @@ pub fn gen_from_mono_module(
if fn_val.verify(true) { if fn_val.verify(true) {
fpm.run_on(&fn_val); fpm.run_on(&fn_val);
} else { } else {
// fn_val.print_to_stderr(); fn_val.print_to_stderr();
// env.module.print_to_stderr(); // env.module.print_to_stderr();
// NOTE: If this fails, uncomment the above println to debug. // NOTE: If this fails, uncomment the above println to debug.
panic!( panic!(

View file

@ -3432,7 +3432,9 @@ fn get_foreign_symbol<'a, 'ctx, 'env>(
None => { None => {
let foreign_function = module.add_function( let foreign_function = module.add_function(
foreign_symbol.as_str(), 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), Some(Linkage::External),
); );
foreign_function.set_call_conventions(C_CALL_CONV); foreign_function.set_call_conventions(C_CALL_CONV);