|
@@ -1907,6 +1907,10 @@ gb_internal lbProcedure *lb_create_startup_runtime(lbModule *main_module, lbProc
|
|
|
lb_add_attribute_to_proc(p->module, p->value, "optnone");
|
|
|
lb_add_attribute_to_proc(p->module, p->value, "noinline");
|
|
|
|
|
|
+ // Make sure shared libraries call their own runtime startup on Linux.
|
|
|
+ LLVMSetVisibility(p->value, LLVMHiddenVisibility);
|
|
|
+ LLVMSetLinkage(p->value, LLVMWeakAnyLinkage);
|
|
|
+
|
|
|
lb_begin_procedure_body(p);
|
|
|
|
|
|
lb_setup_type_info_data(main_module);
|
|
@@ -2016,6 +2020,10 @@ gb_internal lbProcedure *lb_create_cleanup_runtime(lbModule *main_module) { // C
|
|
|
lb_add_attribute_to_proc(p->module, p->value, "optnone");
|
|
|
lb_add_attribute_to_proc(p->module, p->value, "noinline");
|
|
|
|
|
|
+ // Make sure shared libraries call their own runtime cleanup on Linux.
|
|
|
+ LLVMSetVisibility(p->value, LLVMHiddenVisibility);
|
|
|
+ LLVMSetLinkage(p->value, LLVMWeakAnyLinkage);
|
|
|
+
|
|
|
lb_begin_procedure_body(p);
|
|
|
|
|
|
CheckerInfo *info = main_module->gen->info;
|