@zigc/lib 0.16.0-test.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/LICENSE +19 -0
  2. package/c/math.zig +135 -35
  3. package/c/stropts.zig +17 -0
  4. package/c.zig +1 -0
  5. package/compiler/aro/aro/Attribute/names.zig +604 -589
  6. package/compiler/aro/aro/Attribute.zig +202 -116
  7. package/compiler/aro/aro/Builtins/common.zig +874 -863
  8. package/compiler/aro/aro/Builtins/eval.zig +15 -7
  9. package/compiler/aro/aro/Builtins.zig +0 -1
  10. package/compiler/aro/aro/CodeGen.zig +3 -1
  11. package/compiler/aro/aro/Compilation.zig +120 -97
  12. package/compiler/aro/aro/Diagnostics.zig +21 -17
  13. package/compiler/aro/aro/Driver/GCCDetector.zig +635 -0
  14. package/compiler/aro/aro/Driver.zig +124 -50
  15. package/compiler/aro/aro/LangOpts.zig +12 -2
  16. package/compiler/aro/aro/Parser/Diagnostic.zig +79 -19
  17. package/compiler/aro/aro/Parser.zig +336 -142
  18. package/compiler/aro/aro/Preprocessor/Diagnostic.zig +21 -0
  19. package/compiler/aro/aro/Preprocessor.zig +127 -56
  20. package/compiler/aro/aro/Target.zig +17 -12
  21. package/compiler/aro/aro/Tokenizer.zig +31 -14
  22. package/compiler/aro/aro/Toolchain.zig +4 -7
  23. package/compiler/aro/aro/Tree.zig +178 -148
  24. package/compiler/aro/aro/TypeStore.zig +82 -24
  25. package/compiler/aro/aro/Value.zig +13 -17
  26. package/compiler/aro/aro/features.zig +1 -0
  27. package/compiler/aro/aro/pragmas/once.zig +0 -1
  28. package/compiler/aro/aro/record_layout.zig +3 -3
  29. package/compiler/aro/assembly_backend/x86_64.zig +3 -4
  30. package/compiler/aro/backend/Assembly.zig +1 -2
  31. package/compiler/aro/backend/Interner.zig +2 -2
  32. package/compiler/aro/backend/Ir.zig +100 -92
  33. package/compiler/aro/include/ptrcheck.h +49 -0
  34. package/compiler/aro/main.zig +26 -10
  35. package/compiler/build_runner.zig +1 -0
  36. package/compiler/objdump.zig +93 -0
  37. package/compiler/reduce.zig +5 -1
  38. package/compiler/resinator/compile.zig +2 -2
  39. package/compiler/resinator/main.zig +7 -1
  40. package/compiler/resinator/preprocess.zig +1 -3
  41. package/compiler/std-docs.zig +8 -1
  42. package/compiler/test_runner.zig +193 -61
  43. package/compiler/translate-c/MacroTranslator.zig +80 -11
  44. package/compiler/translate-c/PatternList.zig +1 -9
  45. package/compiler/translate-c/Scope.zig +43 -6
  46. package/compiler/translate-c/Translator.zig +364 -126
  47. package/compiler/translate-c/ast.zig +19 -11
  48. package/compiler/translate-c/main.zig +75 -16
  49. package/compiler_rt/cos.zig +141 -52
  50. package/compiler_rt/limb64.zig +266 -0
  51. package/compiler_rt/long_double.zig +37 -0
  52. package/compiler_rt/mulo.zig +6 -1
  53. package/compiler_rt/rem_pio2l.zig +173 -0
  54. package/compiler_rt/sin.zig +140 -55
  55. package/compiler_rt/sincos.zig +279 -72
  56. package/compiler_rt/tan.zig +118 -47
  57. package/compiler_rt/trig.zig +256 -6
  58. package/compiler_rt.zig +2 -0
  59. package/fuzzer.zig +855 -307
  60. package/libc/musl/src/math/pow.c +343 -0
  61. package/package.json +1 -1
  62. package/std/Build/Fuzz.zig +6 -19
  63. package/std/Build/Module.zig +1 -1
  64. package/std/Build/Step/CheckObject.zig +3 -3
  65. package/std/Build/Step/Compile.zig +18 -0
  66. package/std/Build/Step/ConfigHeader.zig +49 -33
  67. package/std/Build/Step/InstallArtifact.zig +18 -0
  68. package/std/Build/Step/Run.zig +536 -87
  69. package/std/Build/Step/TranslateC.zig +0 -6
  70. package/std/Build/Step.zig +8 -15
  71. package/std/Build/WebServer.zig +29 -17
  72. package/std/Build/abi.zig +47 -11
  73. package/std/Build.zig +17 -14
  74. package/std/Io/Dispatch.zig +2 -0
  75. package/std/Io/File/Reader.zig +3 -1
  76. package/std/Io/File.zig +1 -0
  77. package/std/Io/Kqueue.zig +2 -2
  78. package/std/Io/Threaded.zig +181 -143
  79. package/std/Io/Uring.zig +2 -1
  80. package/std/Io.zig +970 -2
  81. package/std/Target.zig +3 -2
  82. package/std/Thread.zig +8 -3
  83. package/std/array_hash_map.zig +96 -555
  84. package/std/array_list.zig +22 -31
  85. package/std/bit_set.zig +22 -6
  86. package/std/builtin/assembly.zig +68 -0
  87. package/std/c.zig +17 -17
  88. package/std/compress/flate/Compress.zig +3 -3
  89. package/std/crypto/Certificate/Bundle.zig +15 -1
  90. package/std/crypto/codecs/asn1.zig +33 -18
  91. package/std/crypto/codecs/base64_hex_ct.zig +14 -4
  92. package/std/debug/Dwarf.zig +29 -9
  93. package/std/debug/Info.zig +4 -0
  94. package/std/debug/MachOFile.zig +46 -8
  95. package/std/debug/Pdb.zig +539 -36
  96. package/std/debug/SelfInfo/Elf.zig +19 -18
  97. package/std/debug/SelfInfo/MachO.zig +18 -7
  98. package/std/debug/SelfInfo/Windows.zig +138 -36
  99. package/std/debug.zig +179 -65
  100. package/std/enums.zig +25 -19
  101. package/std/heap/ArenaAllocator.zig +145 -154
  102. package/std/heap/debug_allocator.zig +7 -7
  103. package/std/http/Client.zig +10 -6
  104. package/std/http.zig +11 -9
  105. package/std/json/Stringify.zig +3 -3
  106. package/std/json/dynamic.zig +4 -4
  107. package/std/math/big/int.zig +16 -17
  108. package/std/mem/Allocator.zig +4 -5
  109. package/std/mem.zig +48 -0
  110. package/std/os/emscripten.zig +1 -17
  111. package/std/os/linux.zig +7 -2
  112. package/std/os/windows.zig +2 -2
  113. package/std/pdb.zig +143 -4
  114. package/std/posix.zig +6 -12
  115. package/std/priority_dequeue.zig +13 -12
  116. package/std/priority_queue.zig +5 -4
  117. package/std/process/Child.zig +1 -1
  118. package/std/process/Environ.zig +1 -1
  119. package/std/start.zig +17 -4
  120. package/std/std.zig +19 -6
  121. package/std/testing/FailingAllocator.zig +4 -4
  122. package/std/testing/Smith.zig +37 -2
  123. package/std/zig/Ast/Render.zig +186 -458
  124. package/std/zig/Ast.zig +0 -4
  125. package/std/zig/AstGen.zig +44 -7
  126. package/std/zig/AstSmith.zig +2602 -0
  127. package/std/zig/Client.zig +8 -3
  128. package/std/zig/Parse.zig +83 -74
  129. package/std/zig/Server.zig +26 -0
  130. package/std/zig/Zir.zig +17 -0
  131. package/std/zig/c_translation/helpers.zig +14 -9
  132. package/std/zig/llvm/Builder.zig +107 -48
  133. package/std/zig/system.zig +20 -4
  134. package/std/zig/tokenizer.zig +2 -1
  135. package/std/zig.zig +6 -0
  136. package/compiler/aro/aro/Driver/Filesystem.zig +0 -241
  137. package/libc/mingw/complex/cabs.c +0 -48
  138. package/libc/mingw/complex/cabsf.c +0 -48
  139. package/libc/mingw/complex/cacos.c +0 -50
  140. package/libc/mingw/complex/cacosf.c +0 -50
  141. package/libc/mingw/complex/carg.c +0 -48
  142. package/libc/mingw/complex/cargf.c +0 -48
  143. package/libc/mingw/complex/casin.c +0 -50
  144. package/libc/mingw/complex/casinf.c +0 -50
  145. package/libc/mingw/complex/catan.c +0 -50
  146. package/libc/mingw/complex/catanf.c +0 -50
  147. package/libc/mingw/complex/ccos.c +0 -50
  148. package/libc/mingw/complex/ccosf.c +0 -50
  149. package/libc/mingw/complex/cexp.c +0 -48
  150. package/libc/mingw/complex/cexpf.c +0 -48
  151. package/libc/mingw/complex/cimag.c +0 -48
  152. package/libc/mingw/complex/cimagf.c +0 -48
  153. package/libc/mingw/complex/clog.c +0 -48
  154. package/libc/mingw/complex/clog10.c +0 -49
  155. package/libc/mingw/complex/clog10f.c +0 -49
  156. package/libc/mingw/complex/clogf.c +0 -48
  157. package/libc/mingw/complex/conj.c +0 -48
  158. package/libc/mingw/complex/conjf.c +0 -48
  159. package/libc/mingw/complex/cpow.c +0 -48
  160. package/libc/mingw/complex/cpowf.c +0 -48
  161. package/libc/mingw/complex/cproj.c +0 -48
  162. package/libc/mingw/complex/cprojf.c +0 -48
  163. package/libc/mingw/complex/creal.c +0 -48
  164. package/libc/mingw/complex/crealf.c +0 -48
  165. package/libc/mingw/complex/csin.c +0 -50
  166. package/libc/mingw/complex/csinf.c +0 -50
  167. package/libc/mingw/complex/csqrt.c +0 -48
  168. package/libc/mingw/complex/csqrtf.c +0 -48
  169. package/libc/mingw/complex/ctan.c +0 -50
  170. package/libc/mingw/complex/ctanf.c +0 -50
  171. package/libc/mingw/math/arm/s_rint.c +0 -86
  172. package/libc/mingw/math/arm/s_rintf.c +0 -51
  173. package/libc/mingw/math/arm/sincos.S +0 -30
  174. package/libc/mingw/math/arm-common/sincosl.c +0 -13
  175. package/libc/mingw/math/arm64/rint.c +0 -12
  176. package/libc/mingw/math/arm64/rintf.c +0 -12
  177. package/libc/mingw/math/arm64/sincos.S +0 -32
  178. package/libc/mingw/math/bsd_private_base.h +0 -148
  179. package/libc/mingw/math/frexpf.c +0 -13
  180. package/libc/mingw/math/frexpl.c +0 -71
  181. package/libc/mingw/math/x86/acosf.c +0 -29
  182. package/libc/mingw/math/x86/atanf.c +0 -23
  183. package/libc/mingw/math/x86/atanl.c +0 -18
  184. package/libc/mingw/math/x86/cos.def.h +0 -65
  185. package/libc/mingw/math/x86/cosl.c +0 -46
  186. package/libc/mingw/math/x86/cosl_internal.S +0 -55
  187. package/libc/mingw/math/x86/ldexp.c +0 -23
  188. package/libc/mingw/math/x86/scalbn.S +0 -41
  189. package/libc/mingw/math/x86/scalbnf.S +0 -40
  190. package/libc/mingw/math/x86/sin.def.h +0 -65
  191. package/libc/mingw/math/x86/sinl.c +0 -46
  192. package/libc/mingw/math/x86/sinl_internal.S +0 -58
  193. package/libc/mingw/math/x86/tanl.S +0 -62
  194. package/libc/mingw/misc/btowc.c +0 -28
  195. package/libc/mingw/misc/wcstof.c +0 -66
  196. package/libc/mingw/misc/wcstoimax.c +0 -132
  197. package/libc/mingw/misc/wcstoumax.c +0 -126
  198. package/libc/mingw/misc/wctob.c +0 -29
  199. package/libc/mingw/misc/winbs_uint64.c +0 -6
  200. package/libc/mingw/misc/winbs_ulong.c +0 -6
  201. package/libc/mingw/misc/winbs_ushort.c +0 -6
  202. package/libc/mingw/stdio/_Exit.c +0 -10
  203. package/libc/mingw/stdio/_findfirst64i32.c +0 -21
  204. package/libc/mingw/stdio/_findnext64i32.c +0 -21
  205. package/libc/mingw/stdio/_fstat64i32.c +0 -37
  206. package/libc/mingw/stdio/_stat64i32.c +0 -37
  207. package/libc/mingw/stdio/_wfindfirst64i32.c +0 -21
  208. package/libc/mingw/stdio/_wfindnext64i32.c +0 -21
  209. package/libc/mingw/stdio/_wstat64i32.c +0 -37
  210. package/libc/musl/src/legacy/isastream.c +0 -7
  211. package/libc/musl/src/legacy/valloc.c +0 -8
  212. package/libc/musl/src/math/__cosl.c +0 -96
  213. package/libc/musl/src/math/__sinl.c +0 -78
  214. package/libc/musl/src/math/__tanl.c +0 -143
  215. package/libc/musl/src/math/aarch64/lrint.c +0 -10
  216. package/libc/musl/src/math/aarch64/lrintf.c +0 -10
  217. package/libc/musl/src/math/aarch64/rintf.c +0 -7
  218. package/libc/musl/src/math/cosl.c +0 -39
  219. package/libc/musl/src/math/fdim.c +0 -10
  220. package/libc/musl/src/math/finite.c +0 -7
  221. package/libc/musl/src/math/finitef.c +0 -7
  222. package/libc/musl/src/math/frexp.c +0 -23
  223. package/libc/musl/src/math/frexpf.c +0 -23
  224. package/libc/musl/src/math/frexpl.c +0 -29
  225. package/libc/musl/src/math/i386/lrint.c +0 -8
  226. package/libc/musl/src/math/i386/lrintf.c +0 -8
  227. package/libc/musl/src/math/i386/rintf.c +0 -7
  228. package/libc/musl/src/math/lrint.c +0 -72
  229. package/libc/musl/src/math/lrintf.c +0 -8
  230. package/libc/musl/src/math/powerpc64/lrint.c +0 -16
  231. package/libc/musl/src/math/powerpc64/lrintf.c +0 -16
  232. package/libc/musl/src/math/rintf.c +0 -30
  233. package/libc/musl/src/math/s390x/rintf.c +0 -15
  234. package/libc/musl/src/math/sincosl.c +0 -60
  235. package/libc/musl/src/math/sinl.c +0 -41
  236. package/libc/musl/src/math/tanl.c +0 -29
  237. package/libc/musl/src/math/x32/lrint.s +0 -5
  238. package/libc/musl/src/math/x32/lrintf.s +0 -5
  239. package/libc/musl/src/math/x86_64/lrint.c +0 -8
  240. package/libc/musl/src/math/x86_64/lrintf.c +0 -8
  241. package/libc/wasi/libc-bottom-half/sources/reallocarray.c +0 -14
@@ -38,7 +38,7 @@ pub const Value = union(enum) {
38
38
  };
39
39
 
40
40
  step: Step,
41
- values: std.StringArrayHashMap(Value),
41
+ values: std.array_hash_map.String(Value),
42
42
  /// This directory contains the generated file under the name `include_path`.
43
43
  generated_dir: std.Build.GeneratedFile,
44
44
 
@@ -95,7 +95,7 @@ pub fn create(owner: *std.Build, options: Options) *ConfigHeader {
95
95
  .first_ret_addr = options.first_ret_addr orelse @returnAddress(),
96
96
  }),
97
97
  .style = options.style,
98
- .values = .init(owner.allocator),
98
+ .values = .empty,
99
99
 
100
100
  .max_bytes = options.max_bytes,
101
101
  .include_path = include_path,
@@ -109,6 +109,11 @@ pub fn create(owner: *std.Build, options: Options) *ConfigHeader {
109
109
  return config_header;
110
110
  }
111
111
 
112
+ pub fn addIdent(config_header: *ConfigHeader, name: []const u8, value: []const u8) void {
113
+ const arena = config_header.step.owner.allocator;
114
+ config_header.values.put(arena, name, .{ .ident = value }) catch @panic("OOM");
115
+ }
116
+
112
117
  pub fn addValue(config_header: *ConfigHeader, name: []const u8, comptime T: type, value: T) void {
113
118
  return addValueInner(config_header, name, T, value) catch @panic("OOM");
114
119
  }
@@ -127,43 +132,44 @@ pub fn getOutputFile(ch: *ConfigHeader) std.Build.LazyPath {
127
132
  }
128
133
 
129
134
  fn addValueInner(config_header: *ConfigHeader, name: []const u8, comptime T: type, value: T) !void {
135
+ const arena = config_header.step.owner.allocator;
130
136
  switch (@typeInfo(T)) {
131
137
  .null => {
132
- try config_header.values.put(name, .undef);
138
+ try config_header.values.put(arena, name, .undef);
133
139
  },
134
140
  .void => {
135
- try config_header.values.put(name, .defined);
141
+ try config_header.values.put(arena, name, .defined);
136
142
  },
137
143
  .bool => {
138
- try config_header.values.put(name, .{ .boolean = value });
144
+ try config_header.values.put(arena, name, .{ .boolean = value });
139
145
  },
140
146
  .int => {
141
- try config_header.values.put(name, .{ .int = value });
147
+ try config_header.values.put(arena, name, .{ .int = value });
142
148
  },
143
149
  .comptime_int => {
144
- try config_header.values.put(name, .{ .int = value });
150
+ try config_header.values.put(arena, name, .{ .int = value });
145
151
  },
146
152
  .@"enum", .enum_literal => {
147
- try config_header.values.put(name, .{ .ident = @tagName(value) });
153
+ try config_header.values.put(arena, name, .{ .ident = @tagName(value) });
148
154
  },
149
155
  .optional => {
150
156
  if (value) |x| {
151
157
  return addValueInner(config_header, name, @TypeOf(x), x);
152
158
  } else {
153
- try config_header.values.put(name, .undef);
159
+ try config_header.values.put(arena, name, .undef);
154
160
  }
155
161
  },
156
162
  .pointer => |ptr| {
157
163
  switch (@typeInfo(ptr.child)) {
158
164
  .array => |array| {
159
165
  if (ptr.size == .one and array.child == u8) {
160
- try config_header.values.put(name, .{ .string = value });
166
+ try config_header.values.put(arena, name, .{ .string = value });
161
167
  return;
162
168
  }
163
169
  },
164
170
  .int => {
165
171
  if (ptr.size == .slice and ptr.child == u8) {
166
- try config_header.values.put(name, .{ .string = value });
172
+ try config_header.values.put(arena, name, .{ .string = value });
167
173
  return;
168
174
  }
169
175
  },
@@ -214,8 +220,8 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
214
220
  });
215
221
  };
216
222
  switch (config_header.style) {
217
- .autoconf_undef => try render_autoconf_undef(step, contents, bw, config_header.values, src_path),
218
- .autoconf_at => try render_autoconf_at(step, contents, &aw, config_header.values, src_path),
223
+ .autoconf_undef => try render_autoconf_undef(step, contents, bw, &config_header.values, src_path),
224
+ .autoconf_at => try render_autoconf_at(step, contents, &aw, &config_header.values, src_path),
219
225
  else => unreachable,
220
226
  }
221
227
  },
@@ -278,7 +284,7 @@ fn render_autoconf_undef(
278
284
  step: *Step,
279
285
  contents: []const u8,
280
286
  bw: *Writer,
281
- values: std.StringArrayHashMap(Value),
287
+ values: *const std.array_hash_map.String(Value),
282
288
  src_path: []const u8,
283
289
  ) !void {
284
290
  const build = step.owner;
@@ -330,7 +336,7 @@ fn render_autoconf_at(
330
336
  step: *Step,
331
337
  contents: []const u8,
332
338
  aw: *Writer.Allocating,
333
- values: std.StringArrayHashMap(Value),
339
+ values: *const std.array_hash_map.String(Value),
334
340
  src_path: []const u8,
335
341
  ) !void {
336
342
  const build = step.owner;
@@ -369,7 +375,7 @@ fn render_autoconf_at(
369
375
  if (!last_line) try bw.writeByte('\n');
370
376
  }
371
377
 
372
- for (values.unmanaged.entries.slice().items(.key), used) |name, u| {
378
+ for (values.entries.slice().items(.key), used) |name, u| {
373
379
  if (!u) {
374
380
  try step.addError("{s}: error: config header value unused: '{s}'", .{ src_path, name });
375
381
  any_errors = true;
@@ -383,14 +389,14 @@ fn render_cmake(
383
389
  step: *Step,
384
390
  contents: []const u8,
385
391
  bw: *Writer,
386
- values: std.StringArrayHashMap(Value),
392
+ values: std.array_hash_map.String(Value),
387
393
  src_path: []const u8,
388
394
  ) !void {
389
395
  const build = step.owner;
390
396
  const allocator = build.allocator;
391
397
 
392
- var values_copy = try values.clone();
393
- defer values_copy.deinit();
398
+ var values_copy = try values.clone(allocator);
399
+ defer values_copy.deinit(allocator);
394
400
 
395
401
  var any_errors = false;
396
402
  var line_index: u32 = 0;
@@ -416,12 +422,21 @@ fn render_cmake(
416
422
  };
417
423
  defer allocator.free(line);
418
424
 
419
- if (!std.mem.startsWith(u8, line, "#")) {
425
+ const line_start = std.mem.findNone(u8, line, " \t\r") orelse {
426
+ try bw.writeAll(line);
427
+ if (!last_line) try bw.writeByte('\n');
428
+ continue;
429
+ };
430
+ const whitespace_prefix = line[0..line_start];
431
+ const trimmed_line = line[line_start..];
432
+
433
+ if (!std.mem.startsWith(u8, trimmed_line, "#")) {
420
434
  try bw.writeAll(line);
421
435
  if (!last_line) try bw.writeByte('\n');
422
436
  continue;
423
437
  }
424
- var it = std.mem.tokenizeAny(u8, line[1..], " \t\r");
438
+
439
+ var it = std.mem.tokenizeAny(u8, trimmed_line[1..], " \t\r");
425
440
  const cmakedefine = it.next().?;
426
441
  if (!std.mem.eql(u8, cmakedefine, "cmakedefine") and
427
442
  !std.mem.eql(u8, cmakedefine, "cmakedefine01"))
@@ -498,6 +513,7 @@ fn render_cmake(
498
513
  value = Value{ .ident = it.rest() };
499
514
  }
500
515
 
516
+ try bw.writeAll(whitespace_prefix);
501
517
  try renderValueC(bw, name, value);
502
518
  }
503
519
 
@@ -509,7 +525,7 @@ fn render_cmake(
509
525
  fn render_blank(
510
526
  gpa: std.mem.Allocator,
511
527
  bw: *Writer,
512
- defines: std.StringArrayHashMap(Value),
528
+ defines: std.array_hash_map.String(Value),
513
529
  include_path: []const u8,
514
530
  include_guard_override: ?[]const u8,
515
531
  ) !void {
@@ -541,7 +557,7 @@ fn render_blank(
541
557
  , .{include_guard_name});
542
558
  }
543
559
 
544
- fn render_nasm(bw: *Writer, defines: std.StringArrayHashMap(Value)) !void {
560
+ fn render_nasm(bw: *Writer, defines: std.array_hash_map.String(Value)) !void {
545
561
  for (defines.keys(), defines.values()) |name, value| try renderValueNasm(bw, name, value);
546
562
  }
547
563
 
@@ -572,7 +588,7 @@ fn renderValueNasm(bw: *Writer, name: []const u8, value: Value) !void {
572
588
  fn expand_variables_autoconf_at(
573
589
  bw: *Writer,
574
590
  contents: []const u8,
575
- values: std.StringArrayHashMap(Value),
591
+ values: *const std.array_hash_map.String(Value),
576
592
  used: []bool,
577
593
  ) !void {
578
594
  const valid_varname_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
@@ -598,7 +614,7 @@ fn expand_variables_autoconf_at(
598
614
  try bw.writeAll(key);
599
615
  return error.MissingValue;
600
616
  };
601
- const value = values.unmanaged.entries.slice().items(.value)[index];
617
+ const value = values.entries.slice().items(.value)[index];
602
618
  used[index] = true;
603
619
  try bw.writeAll(contents[source_offset..curr]);
604
620
  switch (value) {
@@ -619,7 +635,7 @@ fn expand_variables_autoconf_at(
619
635
  fn expand_variables_cmake(
620
636
  allocator: Allocator,
621
637
  contents: []const u8,
622
- values: std.StringArrayHashMap(Value),
638
+ values: std.array_hash_map.String(Value),
623
639
  ) ![]const u8 {
624
640
  var result: std.array_list.Managed(u8) = .init(allocator);
625
641
  errdefer result.deinit();
@@ -751,7 +767,7 @@ fn testReplaceVariablesAutoconfAt(
751
767
  allocator: Allocator,
752
768
  contents: []const u8,
753
769
  expected: []const u8,
754
- values: std.StringArrayHashMap(Value),
770
+ values: std.array_hash_map.String(Value),
755
771
  ) !void {
756
772
  var aw: Writer.Allocating = .init(allocator);
757
773
  defer aw.deinit();
@@ -770,7 +786,7 @@ fn testReplaceVariablesCMake(
770
786
  allocator: Allocator,
771
787
  contents: []const u8,
772
788
  expected: []const u8,
773
- values: std.StringArrayHashMap(Value),
789
+ values: std.array_hash_map.String(Value),
774
790
  ) !void {
775
791
  const actual = try expand_variables_cmake(allocator, contents, values);
776
792
  defer allocator.free(actual);
@@ -780,7 +796,7 @@ fn testReplaceVariablesCMake(
780
796
 
781
797
  test "expand_variables_autoconf_at simple cases" {
782
798
  const allocator = std.testing.allocator;
783
- var values: std.StringArrayHashMap(Value) = .init(allocator);
799
+ var values: std.array_hash_map.String(Value) = .init(allocator);
784
800
  defer values.deinit();
785
801
 
786
802
  // empty strings are preserved
@@ -876,7 +892,7 @@ test "expand_variables_autoconf_at simple cases" {
876
892
 
877
893
  test "expand_variables_autoconf_at edge cases" {
878
894
  const allocator = std.testing.allocator;
879
- var values: std.StringArrayHashMap(Value) = .init(allocator);
895
+ var values: std.array_hash_map.String(Value) = .init(allocator);
880
896
  defer values.deinit();
881
897
 
882
898
  // @-vars resolved only when they wrap valid characters, otherwise considered literals
@@ -892,7 +908,7 @@ test "expand_variables_autoconf_at edge cases" {
892
908
 
893
909
  test "expand_variables_cmake simple cases" {
894
910
  const allocator = std.testing.allocator;
895
- var values: std.StringArrayHashMap(Value) = .init(allocator);
911
+ var values: std.array_hash_map.String(Value) = .init(allocator);
896
912
  defer values.deinit();
897
913
 
898
914
  try values.putNoClobber("undef", .undef);
@@ -980,7 +996,7 @@ test "expand_variables_cmake simple cases" {
980
996
 
981
997
  test "expand_variables_cmake edge cases" {
982
998
  const allocator = std.testing.allocator;
983
- var values: std.StringArrayHashMap(Value) = .init(allocator);
999
+ var values: std.array_hash_map.String(Value) = .init(allocator);
984
1000
  defer values.deinit();
985
1001
 
986
1002
  // special symbols
@@ -1041,7 +1057,7 @@ test "expand_variables_cmake edge cases" {
1041
1057
 
1042
1058
  test "expand_variables_cmake escaped characters" {
1043
1059
  const allocator = std.testing.allocator;
1044
- var values: std.StringArrayHashMap(Value) = .init(allocator);
1060
+ var values: std.array_hash_map.String(Value) = .init(allocator);
1045
1061
  defer values.deinit();
1046
1062
 
1047
1063
  try values.putNoClobber("string", Value{ .string = "text" });
@@ -17,6 +17,10 @@ emitted_implib: ?LazyPath,
17
17
  pdb_dir: ?InstallDir,
18
18
  emitted_pdb: ?LazyPath,
19
19
 
20
+ // hack for stage2_x86_64 + coff
21
+ compiler_rt_dyn_lib_dir: ?InstallDir,
22
+ emitted_compiler_rt_dyn_lib: ?LazyPath,
23
+
20
24
  h_dir: ?InstallDir,
21
25
  emitted_h: ?LazyPath,
22
26
 
@@ -35,6 +39,7 @@ pub const Options = struct {
35
39
  /// Which installation directory to put the main output file into.
36
40
  dest_dir: Dir = .default,
37
41
  pdb_dir: Dir = .default,
42
+ compiler_rt_dyn_lib_dir: Dir = .default,
38
43
  h_dir: Dir = .default,
39
44
  implib_dir: Dir = .default,
40
45
 
@@ -75,6 +80,11 @@ pub fn create(owner: *std.Build, artifact: *Step.Compile, options: Options) *Ins
75
80
  .default => if (artifact.producesPdbFile()) dest_dir else null,
76
81
  .override => |o| o,
77
82
  },
83
+ .compiler_rt_dyn_lib_dir = switch (options.compiler_rt_dyn_lib_dir) {
84
+ .disabled => null,
85
+ .default => if (artifact.producesCompilerRtDynLib()) dest_dir else null,
86
+ .override => |o| o,
87
+ },
78
88
  .h_dir = switch (options.h_dir) {
79
89
  .disabled => null,
80
90
  .default => if (artifact.kind == .lib) .header else null,
@@ -98,6 +108,7 @@ pub fn create(owner: *std.Build, artifact: *Step.Compile, options: Options) *Ins
98
108
 
99
109
  .emitted_bin = null,
100
110
  .emitted_pdb = null,
111
+ .emitted_compiler_rt_dyn_lib = null,
101
112
  .emitted_h = null,
102
113
  .emitted_implib = null,
103
114
 
@@ -107,6 +118,7 @@ pub fn create(owner: *std.Build, artifact: *Step.Compile, options: Options) *Ins
107
118
  install_artifact.step.dependOn(&artifact.step);
108
119
 
109
120
  if (install_artifact.dest_dir != null) install_artifact.emitted_bin = artifact.getEmittedBin();
121
+ if (install_artifact.compiler_rt_dyn_lib_dir != null) install_artifact.emitted_compiler_rt_dyn_lib = artifact.getEmittedCompilerRtDynLib();
110
122
  if (install_artifact.pdb_dir != null) install_artifact.emitted_pdb = artifact.getEmittedPdb();
111
123
  // https://github.com/ziglang/zig/issues/9698
112
124
  //if (install_artifact.h_dir != null) install_artifact.emitted_h = artifact.getEmittedH();
@@ -135,6 +147,12 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
135
147
  install_artifact.artifact.installed_path = full_dest_path;
136
148
  }
137
149
 
150
+ if (install_artifact.compiler_rt_dyn_lib_dir) |compiler_rt_dir| {
151
+ const full_compiler_rt_path = b.getInstallPath(compiler_rt_dir, install_artifact.emitted_compiler_rt_dyn_lib.?.basename(b, step));
152
+ const p = try step.installFile(install_artifact.emitted_compiler_rt_dyn_lib.?, full_compiler_rt_path);
153
+ all_cached = all_cached and p == .fresh;
154
+ }
155
+
138
156
  if (install_artifact.implib_dir) |implib_dir| {
139
157
  const full_implib_path = b.getInstallPath(implib_dir, install_artifact.emitted_implib.?.basename(b, step));
140
158
  const p = try step.installFile(install_artifact.emitted_implib.?, full_implib_path);