| ... | @@ -984,6 +984,7 @@ fn buildOutputType( | ... | @@ -984,6 +984,7 @@ fn buildOutputType( |
| 984 | .libc_paths_file = try EnvVar.ZIG_LIBC.get(arena), | 984 | .libc_paths_file = try EnvVar.ZIG_LIBC.get(arena), |
| 985 | .native_system_include_paths = &.{}, | 985 | .native_system_include_paths = &.{}, |
| 986 | }; | 986 | }; |
| | 987 | defer create_module.link_inputs.deinit(gpa); |
| 987 | | 988 | |
| 988 | // before arg parsing, check for the NO_COLOR and CLICOLOR_FORCE environment variables | 989 | // before arg parsing, check for the NO_COLOR and CLICOLOR_FORCE environment variables |
| 989 | // if set, default the color setting to .off or .on, respectively | 990 | // if set, default the color setting to .off or .on, respectively |
| ... | @@ -3682,7 +3683,7 @@ const CreateModule = struct { | ... | @@ -3682,7 +3683,7 @@ const CreateModule = struct { |
| 3682 | /// This one is used while collecting CLI options. The set of libs is used | 3683 | /// This one is used while collecting CLI options. The set of libs is used |
| 3683 | /// directly after computing the target and used to compute link_libc, | 3684 | /// directly after computing the target and used to compute link_libc, |
| 3684 | /// link_libcpp, and then the libraries are filtered into | 3685 | /// link_libcpp, and then the libraries are filtered into |
| 3685 | /// `unresolved_linker_inputs` and `windows_libs`. | 3686 | /// `unresolved_link_inputs` and `windows_libs`. |
| 3686 | cli_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput), | 3687 | cli_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput), |
| 3687 | windows_libs: std.StringArrayHashMapUnmanaged(void), | 3688 | windows_libs: std.StringArrayHashMapUnmanaged(void), |
| 3688 | /// The local variable `unresolved_link_inputs` is fed into library | 3689 | /// The local variable `unresolved_link_inputs` is fed into library |
| ... | @@ -3816,7 +3817,8 @@ fn createModule( | ... | @@ -3816,7 +3817,8 @@ fn createModule( |
| 3816 | // to decide whether to trigger native path detection logic. | 3817 | // to decide whether to trigger native path detection logic. |
| 3817 | // Preserves linker input order. | 3818 | // Preserves linker input order. |
| 3818 | var unresolved_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput) = .empty; | 3819 | var unresolved_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput) = .empty; |
| 3819 | try unresolved_link_inputs.ensureUnusedCapacity(arena, create_module.cli_link_inputs.items.len); | 3820 | defer unresolved_link_inputs.deinit(gpa); |
| | 3821 | try unresolved_link_inputs.ensureUnusedCapacity(gpa, create_module.cli_link_inputs.items.len); |
| 3820 | var any_name_queries_remaining = false; | 3822 | var any_name_queries_remaining = false; |
| 3821 | for (create_module.cli_link_inputs.items) |cli_link_input| switch (cli_link_input) { | 3823 | for (create_module.cli_link_inputs.items) |cli_link_input| switch (cli_link_input) { |
| 3822 | .name_query => |nq| { | 3824 | .name_query => |nq| { |