From 7c2ab49ff43b399a2db1ba7f0507648e20d3ed00 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Tue, 16 Jul 2024 01:02:14 -0700 Subject: [PATCH] Update build.zig --- build.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index e704229c3673b2..4d781bfd16ab2d 100644 --- a/build.zig +++ b/build.zig @@ -330,6 +330,7 @@ pub inline fn addMultiCheck( } pub fn addBunObject(b: *Build, opts: *BunBuildOptions) *Compile { + const disable_pie = opts.os == .linux; const obj = b.addObject(.{ .name = if (opts.optimize == .Debug) "bun-debug" else "bun", .root_source_file = switch (opts.os) { @@ -338,10 +339,10 @@ pub fn addBunObject(b: *Build, opts: *BunBuildOptions) *Compile { }, .target = opts.target, .optimize = opts.optimize, - .pic = false, + .pic = !disable_pie, .strip = false, // stripped at the end }); - + obj.pie = !disable_pie; obj.bundle_compiler_rt = false; obj.formatted_panics = true; obj.root_module.omit_frame_pointer = false;