aboutsummaryrefslogtreecommitdiff
path: root/src/link.zig
diff options
context:
space:
mode:
authorAlexandros Naskos <alex_naskos@hotmail.com>2020-11-07 11:03:13 +0200
committerAndrew Kelley <andrew@ziglang.org>2020-11-30 14:31:41 -0700
commit2fae28b6afc0e5411c9a9a9def43eeb59fba840f (patch)
treea19b223f9cdb4fecd3b4d0601f9417606c704b3e /src/link.zig
parent51d7c14ce1bdadc4405474cfb3945581c198c741 (diff)
downloadzig-2fae28b6afc0e5411c9a9a9def43eeb59fba840f.tar.gz
zig-2fae28b6afc0e5411c9a9a9def43eeb59fba840f.zip
Added bundle-compiler-rt flag
Diffstat (limited to 'src/link.zig')
-rw-r--r--src/link.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/link.zig b/src/link.zig
index 21022a760a..c24c003073 100644
--- a/src/link.zig
+++ b/src/link.zig
@@ -46,6 +46,7 @@ pub const Options = struct {
entry_addr: ?u64 = null,
stack_size_override: ?u64,
image_base_override: ?u64,
+ bundle_compiler_rt: bool,
/// Set to `true` to omit debug info.
strip: bool,
/// If this is true then this link code is responsible for outputting an object
@@ -518,7 +519,8 @@ pub const File = struct {
var object_files = std.ArrayList([*:0]const u8).init(base.allocator);
defer object_files.deinit();
- try object_files.ensureCapacity(base.options.objects.len + comp.c_object_table.items().len + 1);
+ try object_files.ensureCapacity(base.options.objects.len + comp.c_object_table.items().len +
+ 1 + @boolToInt(base.options.bundle_compiler_rt));
for (base.options.objects) |obj_path| {
object_files.appendAssumeCapacity(try arena.dupeZ(u8, obj_path));
}
@@ -528,6 +530,9 @@ pub const File = struct {
if (module_obj_path) |p| {
object_files.appendAssumeCapacity(try arena.dupeZ(u8, p));
}
+ if (base.options.bundle_compiler_rt) {
+ object_files.appendAssumeCapacity(try arena.dupeZ(u8, comp.compiler_rt_obj.?.full_object_path));
+ }
const full_out_path = try directory.join(arena, &[_][]const u8{base.options.emit.?.sub_path});
const full_out_path_z = try arena.dupeZ(u8, full_out_path);