mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 15:42:49 +00:00
c99c085d70
The purpose of this branch is to switch to using an object file for each independent function, in order to make linking simpler - instead of relying on `-ffunction-sections` and `--gc-sections`, which involves the linker doing the work of linking everything and then undoing work via garbage collection, this will allow the linker to only include the compilation units that are depended on in the first place. This commit makes progress towards that goal.
21 lines
511 B
Zig
21 lines
511 B
Zig
const common = @import("./common.zig");
|
|
const addf3 = @import("./addf3.zig").addf3;
|
|
|
|
pub const panic = common.panic;
|
|
|
|
comptime {
|
|
if (common.want_aeabi) {
|
|
@export(__aeabi_fadd, .{ .name = "__aeabi_fadd", .linkage = common.linkage });
|
|
} else {
|
|
@export(__addsf3, .{ .name = "__addsf3", .linkage = common.linkage });
|
|
}
|
|
}
|
|
|
|
fn __addsf3(a: f32, b: f32) callconv(.C) f32 {
|
|
return addf3(f32, a, b);
|
|
}
|
|
|
|
fn __aeabi_fadd(a: f32, b: f32) callconv(.AAPCS) f32 {
|
|
return addf3(f32, a, b);
|
|
}
|