zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 569182dbb259b2b5cfb457e798407d8ec2eacc2d (tree)
parent 5de06365776687265ecf017979b33163db59e93e
Author: Michael Dusan <michael.dusan@gmail.com>
Date:   Fri, 10 Nov 2023 14:56:46 -0500

compilation: forbid PIE for dynamic libraries

but allow for { .exe, .o, .a }.

closes #17928

Diffstat:
Msrc/Compilation.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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; }