when roc_panic is setjmp/longjmp, mark its linkage as internal

This commit is contained in:
Folkert 2023-03-29 15:03:30 +02:00
parent 2f6f5c09a0
commit d67617e64b
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -197,6 +197,11 @@ pub fn add_sjlj_roc_panic(env: &Env<'_, '_, '_>) {
let mut params = fn_val.get_param_iter();
let roc_str_arg = params.next().unwrap();
// normally, roc_panic is marked as external so it can be provided by the host. But when we
// define it here in LLVM IR, we never want it to be linked by the host (that would
// overwrite which implementation is used.
fn_val.set_linkage(Linkage::Internal);
let tag_id_arg = params.next().unwrap();
debug_assert!(params.next().is_none());