aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-10-21 21:49:58 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-10-23 16:27:39 -0700
commite0623df9f7bcd2f2cf55e11da535bcbd3455d64a (patch)
tree4877712478587b422efabce3b366404f1806d912 /src
parentf2efe051558cb7cfac6f489eb4e3adbfcbb44e4f (diff)
downloadzig-e0623df9f7bcd2f2cf55e11da535bcbd3455d64a.tar.gz
zig-e0623df9f7bcd2f2cf55e11da535bcbd3455d64a.zip
Compilation.create: skip libc_installation on darwin
If the "is darwin" check is moved below the libc_installation check below, error.LibCInstallationMissingCrtDir is returned from lci.resolveCrtPaths(). This should be revisited because it makes sense to check libc_installation first even on darwin. Anyway for now this more closely matches logic from master branch.
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 546f98e3e4..09a9f4c38f 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1769,7 +1769,15 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
// If linking against host libc installation, instead queue up jobs
// for loading those files in the linker.
if (comp.config.link_libc and is_exe_or_dyn_lib) {
- if (comp.libc_installation) |lci| {
+ // If the "is darwin" check is moved below the libc_installation check below,
+ // error.LibCInstallationMissingCrtDir is returned from lci.resolveCrtPaths().
+ if (target.isDarwin()) {
+ switch (target.abi) {
+ .none, .simulator, .macabi => {},
+ else => return error.LibCUnavailable,
+ }
+ // TODO delete logic from MachO flush() and queue up tasks here instead.
+ } else if (comp.libc_installation) |lci| {
const basenames = LibCInstallation.CrtBasenames.get(.{
.target = target,
.link_libc = comp.config.link_libc,