aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-09-21 21:42:27 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-09-21 21:42:27 -0700
commit974333faaf70eb67b78d3fa83bdc92e91379631a (patch)
treef7f59ef4df3bc2390ff2d06af25fba213f9fc9ce /src/Compilation.zig
parent0c70bb4fce8b0460f86ed218f54ba31b291f2bfb (diff)
downloadzig-974333faaf70eb67b78d3fa83bdc92e91379631a.tar.gz
zig-974333faaf70eb67b78d3fa83bdc92e91379631a.zip
stage2: fix linking libc trying to depend on itself
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 948eb1840b..f67e164ecc 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -324,6 +324,8 @@ pub const InitOptions = struct {
verbose_cimport: bool = false,
verbose_llvm_cpu_features: bool = false,
is_test: bool = false,
+ test_evented_io: bool = false,
+ is_compiler_rt_or_libc: bool = false,
stack_size_override: ?u64 = null,
self_exe_path: ?[]const u8 = null,
version: ?std.builtin.Version = null,
@@ -333,7 +335,6 @@ pub const InitOptions = struct {
color: @import("main.zig").Color = .Auto,
test_filter: ?[]const u8 = null,
test_name_prefix: ?[]const u8 = null,
- test_evented_io: bool = false,
};
pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
@@ -704,9 +705,9 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
.dll_export_fns = dll_export_fns,
.error_return_tracing = error_return_tracing,
.llvm_cpu_features = llvm_cpu_features,
+ .is_compiler_rt_or_libc = options.is_compiler_rt_or_libc,
});
errdefer bin_file.destroy();
-
comp.* = .{
.gpa = gpa,
.arena_state = arena_allocator.state,
@@ -2116,6 +2117,7 @@ fn buildStaticLibFromZig(comp: *Compilation, basename: []const u8, out: *?CRTFil
.verbose_cimport = comp.verbose_cimport,
.verbose_llvm_cpu_features = comp.verbose_llvm_cpu_features,
.clang_passthrough_mode = comp.clang_passthrough_mode,
+ .is_compiler_rt_or_libc = true,
});
defer sub_compilation.destroy();