From 469af6780408cf3f2d7ce0c16e2d3b797dd525f1 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 2 Aug 2023 15:20:28 -0700 Subject: [PATCH] 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. --- src/main.zig | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/main.zig b/src/main.zig index 1de6ac7449..ebbe67e353 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1151,9 +1151,6 @@ fn buildOutputType( try system_libs.put(args_iter.nextOrFatal(), .{ .needed = false, .weak = false, - // -l always dynamic links. For static libraries, - // users are expected to use positional arguments - // which are always unambiguous. .preferred_mode = lib_preferred_mode, .search_strategy = lib_search_strategy, }); @@ -1560,9 +1557,6 @@ fn buildOutputType( try system_libs.put(arg["-l".len..], .{ .needed = false, .weak = false, - // -l always dynamic links. For static libraries, - // users are expected to use positional arguments - // which are always unambiguous. .preferred_mode = lib_preferred_mode, .search_strategy = lib_search_strategy, }); @@ -2675,7 +2669,7 @@ fn buildOutputType( .lib = .{ .needed = true, .weak = false, - .path = undefined, + .path = null, }, }); continue; @@ -2700,11 +2694,6 @@ fn buildOutputType( } // After this point, external_system_libs is used instead of system_libs. - // libc++ depends on libc - if (link_libcpp) { - link_libc = true; - } - // Trigger native system library path detection if necessary. if (sysroot == null and cross_target.isNativeOs() and (external_system_libs.len != 0 or want_native_include_dirs)) @@ -6343,13 +6332,12 @@ fn accessLibPath( // In the case of Darwin, the main check will be .dylib, so here we // additionally check for .so files. if (target.isDarwin() and link_mode == .Dynamic) so: { - // Prefer .tbd over .dylib. test_path.clearRetainingCapacity(); try test_path.writer().print("{s}" ++ sep ++ "lib{s}.so", .{ lib_dir_path, lib_name }); try checked_paths.writer().print("\n {s}", .{test_path.items}); fs.cwd().access(test_path.items, .{}) catch |err| switch (err) { error.FileNotFound => break :so, - else => |e| fatal("unable to search for tbd library '{s}': {s}", .{ + else => |e| fatal("unable to search for so library '{s}': {s}", .{ test_path.items, @errorName(e), }), };