diff options
author | 2022-07-24 17:19:05 -0700 | |
---|---|---|
committer | 2022-07-24 17:19:05 -0700 | |
commit | fde64ace31efc241bd2fe1ff957945672bb531f3 (patch) | |
tree | 8dbb9c83b0d9ce3e635a084314f335a2af051ea7 /build.zig | |
parent | 3369881e73bc9abd689750839c8d7098fa6c5682 (diff) | |
download | bun-fde64ace31efc241bd2fe1ff957945672bb531f3.tar.gz bun-fde64ace31efc241bd2fe1ff957945672bb531f3.tar.zst bun-fde64ace31efc241bd2fe1ff957945672bb531f3.zip |
probably fix avx2 builds
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -310,11 +310,12 @@ pub fn build(b: *std.build.Builder) !void { "bindgen", false, ); + const is_baseline = arch.isX86() and (obj.target.cpu_model == .baseline or + !std.Target.x86.featureSetHas(obj.target.getCpuFeatures(), .avx2)); opts.addOption( bool, "baseline", - arch.isX86() and (obj.target.cpu_model == .baseline or - !std.Target.x86.featureSetHas(obj.target.getCpuFeatures(), .avx2)), + is_baseline, ); obj.addOptions("build_options", opts); @@ -324,6 +325,10 @@ pub fn build(b: *std.build.Builder) !void { target, ); + if (is_baseline) { + obj.target.cpu_model = .{ .explicit = &std.Target.x86.cpu.sandybridge }; + } + { obj_step.dependOn(&b.addLog( "Build {s} v{} - v{}\n", @@ -339,6 +344,7 @@ pub fn build(b: *std.build.Builder) !void { obj.setOutputDir(output_dir); obj.setBuildMode(mode); + obj.linkLibC(); if (mode == std.builtin.Mode.Debug) obj.emit_llvm_ir = .{ |