From 800410cfe7ca44cecf1aa2b807cc51f4d334bd78 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 12 Sep 2025 23:00:20 +0200 Subject: [PATCH] Generate position-independent static libraries by default ".pie" on a static library enables PIC when it is supported by the target. Fixes #1474 --- build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/build.zig b/build.zig index 01f38cce..f52d3378 100644 --- a/build.zig +++ b/build.zig @@ -182,6 +182,7 @@ pub fn build(b: *std.Build) !void { .optimize = optimize, }), }); + static_lib.pie = true; const shared_lib = b.addLibrary(.{ .name = if (target.result.isMinGW()) "libsodium" else "sodium", .linkage = .dynamic,