diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-05-08 22:43:11 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-05-08 22:45:49 -0400 |
| commit | a7346ea49f4d9b1af2d0babf67354b234a87fe42 (patch) | |
| tree | 18fe76c5f8958d1cf2533fb5136311d855346f4a /std | |
| parent | 4b9e12be50a8d075d06b127712573b531d068837 (diff) | |
| download | zig-a7346ea49f4d9b1af2d0babf67354b234a87fe42.tar.gz zig-a7346ea49f4d9b1af2d0babf67354b234a87fe42.zip | |
fix build on macOS
Sadly due to a workaround for LLD linker limitations on macOS
we cannot put libuserland into an .a file; instead we have to use object
files. Again due to linker limitations, bundling compiler_rt.o into
another relocatable object also doesn't work. So we're left with
disabling stack probing on macOS for the stage1 self-hosted code.
These workarounds could all be removed if the macos support in the LLD
linker improved, or if Zig project had its own linker that did not have
these issues.
Diffstat (limited to 'std')
| -rw-r--r-- | std/build.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/std/build.zig b/std/build.zig index fa3bac83d0..b5ec97ab5f 100644 --- a/std/build.zig +++ b/std/build.zig @@ -942,6 +942,7 @@ pub const LibExeObjStep = struct { verbose_cc: bool, disable_gen_h: bool, bundle_compiler_rt: bool, + disable_stack_probing: bool, c_std: Builder.CStd, override_std_dir: ?[]const u8, override_lib_dir: ?[]const u8, @@ -1052,6 +1053,7 @@ pub const LibExeObjStep = struct { .filter = null, .disable_gen_h = false, .bundle_compiler_rt = false, + .disable_stack_probing = false, .output_dir = null, .need_system_paths = false, .single_threaded = false, @@ -1457,6 +1459,9 @@ pub const LibExeObjStep = struct { if (self.bundle_compiler_rt) { try zig_args.append("--bundle-compiler-rt"); } + if (self.disable_stack_probing) { + try zig_args.append("--disable-stack-probing"); + } switch (self.target) { Target.Native => {}, |
