Fix to use the default calling convention ... doesn't help.
This commit is contained in:
@@ -91,10 +91,11 @@ fn main() -> Result<(), MainError> {
|
||||
.render_colored(72, StandardStream::stdout(ColorChoice::Auto))
|
||||
.unwrap();
|
||||
|
||||
let isa = isa::lookup(Triple::host())?.finish(settings::Flags::new(settings::builder()))?;
|
||||
let platform = Triple::host();
|
||||
let isa = isa::lookup(platform.clone())?.finish(settings::Flags::new(settings::builder()))?;
|
||||
let object_builder = ObjectBuilder::new(isa, "example", default_libcall_names())?;
|
||||
let mut object_module = ObjectModule::new(object_builder);
|
||||
let rtfuns = RuntimeFunctions::new(&mut object_module)?;
|
||||
let rtfuns = RuntimeFunctions::new(&platform, &mut object_module)?;
|
||||
|
||||
let _compiled = lil_tree.into_cranelift(&mut object_module, &rtfuns)?;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use cranelift_codegen::ir::{types, AbiParam, FuncRef, Function, Signature};
|
||||
use cranelift_codegen::isa::CallConv;
|
||||
use cranelift_module::{FuncId, Linkage, Module, ModuleResult};
|
||||
use target_lexicon::Triple;
|
||||
use std::collections::HashMap;
|
||||
use thiserror::Error;
|
||||
|
||||
@@ -16,7 +17,7 @@ pub enum RuntimeFunctionError {
|
||||
}
|
||||
|
||||
impl RuntimeFunctions {
|
||||
pub fn new<M: Module>(module: &mut M) -> ModuleResult<RuntimeFunctions> {
|
||||
pub fn new<M: Module>(platform: &Triple, module: &mut M) -> ModuleResult<RuntimeFunctions> {
|
||||
let mut builtin_functions = HashMap::new();
|
||||
let _referenced_functions = Vec::new();
|
||||
|
||||
@@ -29,7 +30,7 @@ impl RuntimeFunctions {
|
||||
&Signature {
|
||||
params: vec![string_param, int64_param],
|
||||
returns: vec![],
|
||||
call_conv: CallConv::AppleAarch64,
|
||||
call_conv: CallConv::triple_default(platform),
|
||||
},
|
||||
)?;
|
||||
builtin_functions.insert("print".to_string(), print_id);
|
||||
|
||||
Reference in New Issue
Block a user