Skip to content

Commit d70db1c

Browse files
committed
fix: add -O2 flag and sha optimizations for arm
This missing c flag as well as the macro were causing some regressions in performance within lodestar-bun versus production blst-ts in ChainSafe/lodestar-bun#18.
1 parent 10c33c0 commit d70db1c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

build.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub fn build(b: *std.Build) !void {
1111
var c_flags = std.ArrayList([]const u8).init(b.allocator);
1212
defer c_flags.deinit();
1313

14+
try c_flags.append("-O2");
1415
try c_flags.append("-fno-builtin");
1516
try c_flags.append("-Wno-unused-function");
1617
try c_flags.append("-Wno-unused-command-line-argument");
@@ -38,6 +39,8 @@ pub fn build(b: *std.Build) !void {
3839
}
3940
}
4041

42+
if (target.result.cpu.arch == .aarch64) lib.root_module.addCMacro("__ARM_FEATURE_CRYPTO", "1");
43+
4144
if (target.result.cpu.arch != .x86_64 and
4245
target.result.cpu.arch != .aarch64)
4346
{

0 commit comments

Comments
 (0)