aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-02-25 00:51:20 +0200
committerGravatar GitHub <noreply@github.com> 2023-02-24 14:51:20 -0800
commit26df7ca8926c67311f5ca1fbfc04e2c374c3e1a3 (patch)
treef6b794c7ebc772bcd3e394b36a08b5c69ca215ff /build.zig
parentd33a53deb0d9d2d0b8a586a72e666bb46a174a69 (diff)
downloadbun-26df7ca8926c67311f5ca1fbfc04e2c374c3e1a3.tar.gz
bun-26df7ca8926c67311f5ca1fbfc04e2c374c3e1a3.tar.zst
bun-26df7ca8926c67311f5ca1fbfc04e2c374c3e1a3.zip
fix `compiler_rt` linking failure on `x86_64` (#2163)
- minor code tweaks
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig10
1 files changed, 4 insertions, 6 deletions
diff --git a/build.zig b/build.zig
index fe8aa6a53..892140511 100644
--- a/build.zig
+++ b/build.zig
@@ -43,8 +43,6 @@ const color_map = std.ComptimeStringMap([]const u8, .{
&.{ "yellow", "33m" },
});
-var compiler_rt_path: []const u8 = "";
-var compiler_rt_path_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
fn addInternalPackages(b: *Build, step: *CompileStep, _: std.mem.Allocator, _: []const u8, target: anytype) !void {
var bun = b.createModule(.{
.source_file = FileSource.relative("src/bun_redirect.zig"),
@@ -313,9 +311,12 @@ pub fn build(b: *Build) !void {
obj.linkLibC();
obj.strip = false;
- obj.bundle_compiler_rt = true;
+ obj.bundle_compiler_rt = false;
obj.omit_frame_pointer = optimize != .Debug;
+ // Disable staack probing on x86 so we don't need to include compiler_rt
+ if (target.getCpuArch().isX86()) obj.disable_stack_probing = true;
+
if (b.option(bool, "for-editor", "Do not emit bin, just check for errors") orelse false) {
obj.emit_bin = .no_emit;
}
@@ -596,9 +597,6 @@ pub fn configureObjectStep(b: *std.build.Builder, obj: *CompileStep, comptime Ta
if (target.getOsTag() != .freestanding) obj.linkLibC();
if (target.getOsTag() != .freestanding) obj.bundle_compiler_rt = false;
- // Disable staack probing on x86 so we don't need to include compiler_rt
- if (target.getCpuArch().isX86()) obj.disable_stack_probing = true;
-
if (target.getOsTag() == .linux) {
// obj.want_lto = tar;
obj.link_emit_relocs = true;