| ... | ... | @@ -12,7 +12,7 @@ const Compilation = @import("Compilation.zig"); |
| 12 | 12 | const build_options = @import("build_options"); |
| 13 | 13 | const trace = @import("tracy.zig").trace; |
| 14 | 14 | const Cache = std.Build.Cache; |
| 15 | | const Package = @import("Package.zig"); |
| 15 | const Module = @import("Package/Module.zig"); |
| 16 | 16 | |
| 17 | 17 | pub const Lib = struct { |
| 18 | 18 | name: []const u8, |
| ... | ... | @@ -1067,34 +1067,62 @@ fn buildSharedLib( |
| 1067 | 1067 | .src_path = try path.join(arena, &[_][]const u8{ bin_directory.path.?, asm_file_basename }), |
| 1068 | 1068 | }, |
| 1069 | 1069 | }; |
| 1070 | |
| 1071 | const optimize_mode = comp.compilerRtOptMode(); |
| 1072 | const strip = comp.compilerRtStrip(); |
| 1073 | const config = try Compilation.Config.resolve(.{ |
| 1074 | .output_mode = .Lib, |
| 1075 | .link_mode = .Dynamic, |
| 1076 | .resolved_target = comp.root_mod.resolved_target, |
| 1077 | .is_test = false, |
| 1078 | .have_zcu = false, |
| 1079 | .emit_bin = true, |
| 1080 | .root_optimize_mode = optimize_mode, |
| 1081 | .root_strip = strip, |
| 1082 | .link_libc = false, |
| 1083 | }); |
| 1084 | |
| 1085 | const root_mod = try Module.create(arena, .{ |
| 1086 | .global_cache_directory = comp.global_cache_directory, |
| 1087 | .paths = .{ |
| 1088 | .root = .{ .root_dir = comp.zig_lib_directory }, |
| 1089 | .root_src_path = "", |
| 1090 | }, |
| 1091 | .fully_qualified_name = "root", |
| 1092 | .inherited = .{ |
| 1093 | .resolved_target = comp.root_mod.resolved_target, |
| 1094 | .strip = strip, |
| 1095 | .stack_check = false, |
| 1096 | .stack_protector = 0, |
| 1097 | .sanitize_c = false, |
| 1098 | .sanitize_thread = false, |
| 1099 | .red_zone = comp.root_mod.red_zone, |
| 1100 | .omit_frame_pointer = comp.root_mod.omit_frame_pointer, |
| 1101 | .valgrind = false, |
| 1102 | .optimize_mode = optimize_mode, |
| 1103 | .structured_cfg = comp.root_mod.structured_cfg, |
| 1104 | }, |
| 1105 | .global = config, |
| 1106 | .cc_argv = &.{}, |
| 1107 | .parent = null, |
| 1108 | .builtin_mod = null, |
| 1109 | }); |
| 1110 | |
| 1070 | 1111 | const sub_compilation = try Compilation.create(comp.gpa, .{ |
| 1071 | 1112 | .local_cache_directory = zig_cache_directory, |
| 1072 | 1113 | .global_cache_directory = comp.global_cache_directory, |
| 1073 | 1114 | .zig_lib_directory = comp.zig_lib_directory, |
| 1115 | .thread_pool = comp.thread_pool, |
| 1116 | .self_exe_path = comp.self_exe_path, |
| 1074 | 1117 | .cache_mode = .whole, |
| 1075 | | .target = comp.getTarget(), |
| 1118 | .config = config, |
| 1119 | .root_mod = root_mod, |
| 1076 | 1120 | .root_name = lib.name, |
| 1077 | | .main_mod = null, |
| 1078 | | .output_mode = .Lib, |
| 1079 | | .link_mode = .Dynamic, |
| 1080 | | .thread_pool = comp.thread_pool, |
| 1081 | | .libc_installation = comp.bin_file.options.libc_installation, |
| 1121 | .libc_installation = comp.libc_installation, |
| 1082 | 1122 | .emit_bin = emit_bin, |
| 1083 | | .optimize_mode = comp.compilerRtOptMode(), |
| 1084 | | .want_sanitize_c = false, |
| 1085 | | .want_stack_check = false, |
| 1086 | | .want_stack_protector = 0, |
| 1087 | | .want_red_zone = comp.bin_file.options.red_zone, |
| 1088 | | .omit_frame_pointer = comp.bin_file.options.omit_frame_pointer, |
| 1089 | | .want_valgrind = false, |
| 1090 | | .want_tsan = false, |
| 1091 | 1123 | .emit_h = null, |
| 1092 | | .strip = comp.compilerRtStrip(), |
| 1093 | | .is_native_os = false, |
| 1094 | | .is_native_abi = false, |
| 1095 | | .self_exe_path = comp.self_exe_path, |
| 1096 | 1124 | .verbose_cc = comp.verbose_cc, |
| 1097 | | .verbose_link = comp.bin_file.options.verbose_link, |
| 1125 | .verbose_link = comp.verbose_link, |
| 1098 | 1126 | .verbose_air = comp.verbose_air, |
| 1099 | 1127 | .verbose_llvm_ir = comp.verbose_llvm_ir, |
| 1100 | 1128 | .verbose_llvm_bc = comp.verbose_llvm_bc, |