Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose -z nocopyreloc to the build system #19774

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/std/Build/Step/Compile.zig
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ linker_enable_new_dtags: ?bool = null,
/// Permit read-only relocations in read-only segments. Disallowed by default.
link_z_notext: bool = false,

// Disable the creation of copy relocations.
link_z_nocopyreloc: bool = false,

/// Force all relocations to be read-only after processing.
link_z_relro: bool = true,

Expand Down Expand Up @@ -1434,6 +1437,10 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
try zig_args.append("-z");
try zig_args.append("notext");
}
if (self.link_z_nocopyreloc) {
try zig_args.append("-z");
try zig_args.append("nocopyreloc");
}
if (!self.link_z_relro) {
try zig_args.append("-z");
try zig_args.append("norelro");
Expand Down