authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-21 21:49:58-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-23 16:27:39-07:00
loge0623df9f7bcd2f2cf55e11da535bcbd3455d64a
tree4877712478587b422efabce3b366404f1806d912
parentf2efe051558cb7cfac6f489eb4e3adbfcbb44e4f

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.

1 files changed, 9 insertions(+), 1 deletions(-)

src/Compilation.zig+9-1
...@@ -1769,7 +1769,15 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil...@@ -1769,7 +1769,15 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
1769 // If linking against host libc installation, instead queue up jobs1769 // If linking against host libc installation, instead queue up jobs
1770 // for loading those files in the linker.1770 // for loading those files in the linker.
1771 if (comp.config.link_libc and is_exe_or_dyn_lib) {1771 if (comp.config.link_libc and is_exe_or_dyn_lib) {
1772 if (comp.libc_installation) |lci| {1772 // If the "is darwin" check is moved below the libc_installation check below,
1773 // error.LibCInstallationMissingCrtDir is returned from lci.resolveCrtPaths().
1774 if (target.isDarwin()) {
1775 switch (target.abi) {
1776 .none, .simulator, .macabi => {},
1777 else => return error.LibCUnavailable,
1778 }
1779 // TODO delete logic from MachO flush() and queue up tasks here instead.
1780 } else if (comp.libc_installation) |lci| {
1773 const basenames = LibCInstallation.CrtBasenames.get(.{1781 const basenames = LibCInstallation.CrtBasenames.get(.{
1774 .target = target,1782 .target = target,
1775 .link_libc = comp.config.link_libc,1783 .link_libc = comp.config.link_libc,