export _mh_execute_header with weak linkage
* also fix extern variables with initialiaztion values to generate runtime code * remove the workaround in example/shared_library/mathtest.zig * introduce the ability for global variables to have Weak and LinkOnce linkage * fix `@export` to work for non-functions. this code needs to be audited though. * fix comptime ptrcast not keeping bigger alignment * fix linker warnings when targeting darwin closes #1903
This commit is contained in:
@@ -1,12 +1,3 @@
|
||||
// TODO Remove this workaround
|
||||
comptime {
|
||||
const builtin = @import("builtin");
|
||||
if (builtin.os == builtin.Os.macosx) {
|
||||
@export("__mh_execute_header", _mh_execute_header, builtin.GlobalLinkage.Weak);
|
||||
}
|
||||
}
|
||||
var _mh_execute_header = extern struct {x: usize}{.x = 0};
|
||||
|
||||
export fn add(a: i32, b: i32) i32 {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user