mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
bundle compiler-rt through zig
This commit is contained in:
parent
f738d5a2bf
commit
be06599bb6
4 changed files with 8 additions and 8 deletions
|
@ -59,6 +59,7 @@ fn generateLlvmIrFile(
|
|||
const obj = b.addObject(.{ .name = object_name, .root_source_file = main_path, .optimize = mode, .target = target, .use_llvm = true });
|
||||
obj.strip = true;
|
||||
obj.disable_stack_probing = true;
|
||||
obj.bundle_compiler_rt = true;
|
||||
|
||||
// Generating the bin seems required to get zig to generate the llvm ir.
|
||||
_ = obj.getEmittedBin();
|
||||
|
@ -91,6 +92,7 @@ fn generateObjectFile(
|
|||
obj.link_function_sections = true;
|
||||
obj.force_pic = true;
|
||||
obj.disable_stack_probing = true;
|
||||
obj.bundle_compiler_rt = true;
|
||||
|
||||
const obj_file = obj.getEmittedBin();
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ const expect = @import("expect.zig");
|
|||
const panic_utils = @import("panic.zig");
|
||||
const dbg_utils = @import("dbg.zig");
|
||||
|
||||
comptime {
|
||||
_ = @import("compiler_rt.zig");
|
||||
_ = @import("libc.zig");
|
||||
}
|
||||
// comptime {
|
||||
// _ = @import("compiler_rt.zig");
|
||||
// _ = @import("libc.zig");
|
||||
// }
|
||||
|
||||
const ROC_BUILTINS = "roc_builtins";
|
||||
const NUM = "num";
|
||||
|
|
|
@ -215,9 +215,7 @@ pub fn exportRound(comptime F: type, comptime T: type, comptime name: []const u8
|
|||
pub fn exportFloor(comptime F: type, comptime T: type, comptime name: []const u8) void {
|
||||
comptime var f = struct {
|
||||
fn func(input: F) callconv(.C) T {
|
||||
// intFromFloat just returns the integer part of the float.
|
||||
// This means it automatically floors. No need for an explicit call to floor.
|
||||
return @as(T, @intFromFloat(input));
|
||||
return @as(T, @intFromFloat((math.floor(input))));
|
||||
}
|
||||
}.func;
|
||||
@export(f, .{ .name = name ++ @typeName(T), .linkage = .Strong });
|
||||
|
|
|
@ -235,7 +235,7 @@ len : Dict * * -> Nat
|
|||
len = \@Dict { data } ->
|
||||
List.len data
|
||||
|
||||
## Check if the dictinoary is empty.
|
||||
## Check if the dictionary is empty.
|
||||
## ```
|
||||
## Dict.isEmpty (Dict.empty {} |> Dict.insert "key" 42)
|
||||
##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue