aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorMotiejus Jakštys <motiejus@jakstys.lt>2022-05-19 16:36:01 +0300
committerAndrew Kelley <andrew@ziglang.org>2022-05-19 20:21:07 -0400
commit1d532f12b568c924baead9de78701f66a526e16b (patch)
tree648c562336582e2bb3c4c81a21db2876ca1a2679 /src/Compilation.zig
parent7b63f98cd7d86337e8157afc9600e1e17c27db80 (diff)
downloadzig-1d532f12b568c924baead9de78701f66a526e16b.tar.gz
zig-1d532f12b568c924baead9de78701f66a526e16b.zip
[Elf] add -z nocopyreloc
Warnings about non-implemented `-z nocopyreloc` are common when compiling go code (including Go's tests themselves). Let's just make it stop complaining.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 687b0a6dc6..7ac1e49196 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -764,6 +764,7 @@ pub const InitOptions = struct {
linker_z_noexecstack: bool = false,
linker_z_now: bool = false,
linker_z_relro: bool = false,
+ linker_z_nocopyreloc: bool = false,
linker_tsaware: bool = false,
linker_nxcompat: bool = false,
linker_dynamicbase: bool = false,
@@ -1597,6 +1598,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
.z_notext = options.linker_z_notext,
.z_defs = options.linker_z_defs,
.z_origin = options.linker_z_origin,
+ .z_nocopyreloc = options.linker_z_nocopyreloc,
.z_noexecstack = options.linker_z_noexecstack,
.z_now = options.linker_z_now,
.z_relro = options.linker_z_relro,
@@ -2255,7 +2257,7 @@ fn prepareWholeEmitSubPath(arena: Allocator, opt_emit: ?EmitLoc) error{OutOfMemo
/// to remind the programmer to update multiple related pieces of code that
/// are in different locations. Bump this number when adding or deleting
/// anything from the link cache manifest.
-pub const link_hash_implementation_version = 2;
+pub const link_hash_implementation_version = 3;
fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifest) !void {
const gpa = comp.gpa;
@@ -2265,7 +2267,7 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes
defer arena_allocator.deinit();
const arena = arena_allocator.allocator();
- comptime assert(link_hash_implementation_version == 2);
+ comptime assert(link_hash_implementation_version == 3);
if (comp.bin_file.options.module) |mod| {
const main_zig_file = try mod.main_pkg.root_src_directory.join(arena, &[_][]const u8{
@@ -2333,6 +2335,7 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes
man.hash.add(comp.bin_file.options.z_notext);
man.hash.add(comp.bin_file.options.z_defs);
man.hash.add(comp.bin_file.options.z_origin);
+ man.hash.add(comp.bin_file.options.z_nocopyreloc);
man.hash.add(comp.bin_file.options.z_noexecstack);
man.hash.add(comp.bin_file.options.z_now);
man.hash.add(comp.bin_file.options.z_relro);