authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2022-06-08 15:13:04+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2022-06-08 15:13:04+02:00
logd8cae4d1974ae0948cfd4cad5a2bb6e8c4248609
tree17491aa83b86bc81fe87f1310b49de1f45d1ea7f
parent33817794268b5453794f98ee752403ff44693112
signaturelock-open Commit is signed but in an unrecognized format.

std.build: Expose `-z norelro` and `-z lazy`


1 files changed, 14 insertions(+), 0 deletions(-)

lib/std/build.zig+14
......@@ -1570,6 +1570,12 @@ pub const LibExeObjStep = struct {
15701570 /// Permit read-only relocations in read-only segments. Disallowed by default.
15711571 link_z_notext: bool = false,
15721572
1573 /// Force all relocations to be read-only after processing.
1574 link_z_relro: bool = true,
1575
1576 /// Allow relocations to be lazily processed after load.
1577 link_z_lazy: bool = false,
1578
15731579 /// (Darwin) Install name for the dylib
15741580 install_name: ?[]const u8 = null,
15751581
......@@ -2577,6 +2583,14 @@ pub const LibExeObjStep = struct {
25772583 try zig_args.append("-z");
25782584 try zig_args.append("notext");
25792585 }
2586 if (!self.link_z_relro) {
2587 try zig_args.append("-z");
2588 try zig_args.append("norelro");
2589 }
2590 if (self.link_z_lazy) {
2591 try zig_args.append("-z");
2592 try zig_args.append("lazy");
2593 }
25802594
25812595 if (self.libc_file) |libc_file| {
25822596 try zig_args.append("--libc");