diff --git a/src/Compilation.zig b/src/Compilation.zig index 6db84a7d67..529ba9d33b 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1288,7 +1288,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { const sysroot = options.sysroot orelse libc_dirs.sysroot; const pie: bool = pie: { - if (options.output_mode != .Exe) { + if (is_dyn_lib) { if (options.want_pie == true) return error.OutputModeForbidsPie; break :pie false; }