aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig12
1 files changed, 10 insertions, 2 deletions
diff --git a/build.zig b/build.zig
index fcd4b4b1d..04c9f9231 100644
--- a/build.zig
+++ b/build.zig
@@ -280,7 +280,7 @@ pub fn build(b: *std.build.Builder) !void {
var obj_step = b.step("obj", "Build Bun as a .o file");
var obj = b.addObject(bun_executable_name, exe.root_src.?.path);
- obj.bundle_compiler_rt = true;
+ obj.setTarget(target);
addPicoHTTP(obj, false);
obj.addPackage(.{
.name = "clap",
@@ -293,7 +293,15 @@ pub fn build(b: *std.build.Builder) !void {
obj.linkLibC();
obj.linkLibCpp();
- obj.setTarget(target);
+ obj.bundle_compiler_rt = true;
+
+ if (target.getOsTag() == .linux) {
+ // obj.want_lto = tar;
+ obj.link_emit_relocs = true;
+ obj.link_function_sections = true;
+ }
+
+
} else {
b.default_step.dependOn(&exe.step);
}