From fe9870f9d29b5086d15e5262fa464f9c9b6148fd Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Fri, 3 May 2024 13:25:10 +0100 Subject: [PATCH] Enable PIC --- build.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index d4832c9..ddcb2d4 100644 --- a/build.zig +++ b/build.zig @@ -40,10 +40,10 @@ pub fn build(b: *std.Build) void { .optimize = optimize, .version = version, .root_source_file = .{ .path = "src/lib.zig" }, + .pic = true, }); _ = lib.getEmittedH(); // Needed to trigger header generation lib.bundle_compiler_rt = true; - lib.pie = true; const lib_install = b.addInstallArtifact(lib, .{}); // Ideally we would use dlib.getEmittedH(), but https://github.com/ziglang/zig/issues/18497 const lib_header = b.addInstallFile(.{ .path = "zig-cache/fastlanez.h" }, "include/fastlanez.h"); @@ -56,6 +56,7 @@ pub fn build(b: *std.Build) void { .optimize = optimize, .version = version, .root_source_file = .{ .path = "src/lib.zig" }, + .pic = true, }); _ = lib.getEmittedH(); // Needed to trigger header generation dylib.bundle_compiler_rt = true;