authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-08-02 15:20:28-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-08-03 09:52:15-07:00
log469af6780408cf3f2d7ce0c16e2d3b797dd525f1
tree5d3aec863977c1b6b991561ff9fe389c80ab58d9
parentd7e74f7cbfe3adfe70ae1d7b92509f81fce28a5a

CLI: delete redundant logic and use null instead of undef

The `null` value here was missed in 0a4d4eb252a73555a568a532902951a13284d2ef. I hope it is the cause of the CI failures on Windows. The fact that libc++ depends on libc is not important for the CLI and Compilation.create already handles that logic.

1 files changed, 2 insertions(+), 14 deletions(-)

src/main.zig+2-14
......@@ -1151,9 +1151,6 @@ fn buildOutputType(
11511151 try system_libs.put(args_iter.nextOrFatal(), .{
11521152 .needed = false,
11531153 .weak = false,
1154 // -l always dynamic links. For static libraries,
1155 // users are expected to use positional arguments
1156 // which are always unambiguous.
11571154 .preferred_mode = lib_preferred_mode,
11581155 .search_strategy = lib_search_strategy,
11591156 });
......@@ -1560,9 +1557,6 @@ fn buildOutputType(
15601557 try system_libs.put(arg["-l".len..], .{
15611558 .needed = false,
15621559 .weak = false,
1563 // -l always dynamic links. For static libraries,
1564 // users are expected to use positional arguments
1565 // which are always unambiguous.
15661560 .preferred_mode = lib_preferred_mode,
15671561 .search_strategy = lib_search_strategy,
15681562 });
......@@ -2675,7 +2669,7 @@ fn buildOutputType(
26752669 .lib = .{
26762670 .needed = true,
26772671 .weak = false,
2678 .path = undefined,
2672 .path = null,
26792673 },
26802674 });
26812675 continue;
......@@ -2700,11 +2694,6 @@ fn buildOutputType(
27002694 }
27012695 // After this point, external_system_libs is used instead of system_libs.
27022696
2703 // libc++ depends on libc
2704 if (link_libcpp) {
2705 link_libc = true;
2706 }
2707
27082697 // Trigger native system library path detection if necessary.
27092698 if (sysroot == null and cross_target.isNativeOs() and
27102699 (external_system_libs.len != 0 or want_native_include_dirs))
......@@ -6343,13 +6332,12 @@ fn accessLibPath(
63436332 // In the case of Darwin, the main check will be .dylib, so here we
63446333 // additionally check for .so files.
63456334 if (target.isDarwin() and link_mode == .Dynamic) so: {
6346 // Prefer .tbd over .dylib.
63476335 test_path.clearRetainingCapacity();
63486336 try test_path.writer().print("{s}" ++ sep ++ "lib{s}.so", .{ lib_dir_path, lib_name });
63496337 try checked_paths.writer().print("\n {s}", .{test_path.items});
63506338 fs.cwd().access(test_path.items, .{}) catch |err| switch (err) {
63516339 error.FileNotFound => break :so,
6352 else => |e| fatal("unable to search for tbd library '{s}': {s}", .{
6340 else => |e| fatal("unable to search for so library '{s}': {s}", .{
63536341 test_path.items, @errorName(e),
63546342 }),
63556343 };