aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorDillen Meijboom <dillen@brainhive.nl>2024-02-22 23:39:16 +0100
committerAndrew Kelley <andrew@ziglang.org>2024-03-06 17:52:05 -0800
commit377ecc6afb14a112a07c6d2c3570e2b77b12a116 (patch)
tree706ef264ff807f729e37e2aef2b83a8d8e7ab99e /src/Compilation.zig
parentaa7d16aba1f0b3a9e816684618d16cb1d178a6d3 (diff)
downloadzig-377ecc6afb14a112a07c6d2c3570e2b77b12a116.tar.gz
zig-377ecc6afb14a112a07c6d2c3570e2b77b12a116.zip
feat: add support for --enable-new-dtags and --disable-new-dtags
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 539a11faa0..f0b074fc07 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1034,6 +1034,7 @@ pub const CreateOptions = struct {
linker_script: ?[]const u8 = null,
version_script: ?[]const u8 = null,
linker_allow_undefined_version: bool = false,
+ linker_enable_new_dtags: ?bool = null,
soname: ?[]const u8 = null,
linker_gc_sections: ?bool = null,
linker_allow_shlib_undefined: ?bool = null,
@@ -1581,6 +1582,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
.image_base = options.image_base,
.version_script = options.version_script,
.allow_undefined_version = options.linker_allow_undefined_version,
+ .enable_new_dtags = options.linker_enable_new_dtags,
.gc_sections = options.linker_gc_sections,
.emit_relocs = options.link_emit_relocs,
.soname = options.soname,
@@ -2460,7 +2462,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 = 12;
+pub const link_hash_implementation_version = 13;
fn addNonIncrementalStuffToCacheManifest(
comp: *Compilation,
@@ -2469,7 +2471,7 @@ fn addNonIncrementalStuffToCacheManifest(
) !void {
const gpa = comp.gpa;
- comptime assert(link_hash_implementation_version == 12);
+ comptime assert(link_hash_implementation_version == 13);
if (comp.module) |mod| {
try addModuleTableToCacheHash(gpa, arena, &man.hash, mod.root_mod, mod.main_mod, .{ .files = man });
@@ -2541,6 +2543,7 @@ fn addNonIncrementalStuffToCacheManifest(
try man.addOptionalFile(opts.linker_script);
try man.addOptionalFile(opts.version_script);
man.hash.add(opts.allow_undefined_version);
+ man.hash.addOptional(opts.enable_new_dtags);
man.hash.addOptional(opts.stack_size);
man.hash.addOptional(opts.image_base);