From 9afc4fe0e2114ae0ed53d48d98f5e12b6a269339 Mon Sep 17 00:00:00 2001
From: Andrew Kelley
Date: Thu, 5 May 2022 14:27:20 -0700
Subject: [PATCH 1/4] Sema: solve a false positive "depends on itself"
This improves the ABI alignment resolution code.
This commit fully enables the MachO linker code in stage3. Note,
however, that there are still miscompilations in stage3.
---
lib/std/array_hash_map.zig | 4 --
src/Sema.zig | 1 +
src/link/MachO.zig | 3 -
src/link/MachO/Dylib.zig | 8 +--
src/link/tapi/yaml.zig | 2 +-
src/type.zig | 129 ++++++++++++++++++++++++++-----------
test/behavior/eval.zig | 111 +++++++++++++++++++++++++++++++
7 files changed, 208 insertions(+), 50 deletions(-)
diff --git a/lib/std/array_hash_map.zig b/lib/std/array_hash_map.zig
index 304c98a2a91074d6acf54cfbbec418117b61f53e..d3c3677747559122e04b16960f8bde392c33e4bf 100644
--- a/lib/std/array_hash_map.zig
+++ b/lib/std/array_hash_map.zig
@@ -82,10 +82,6 @@ pub fn ArrayHashMap(
allocator: Allocator,
ctx: Context,
- comptime {
- std.hash_map.verifyContext(Context, K, K, u32, true);
- }
-
/// The ArrayHashMapUnmanaged type using the same settings as this managed map.
pub const Unmanaged = ArrayHashMapUnmanaged(K, V, Context, store_hash);
diff --git a/src/Sema.zig b/src/Sema.zig
index 9b4977c616edb4de609076dc3f2e63fe76eb5129..76edfbf2cd587589bb26dc3ac70e6d958da09131 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -18073,6 +18073,7 @@ fn elemValSlice(
const is_in_bounds = try block.addBinOp(cmp_op, elem_index, len_inst);
try sema.addSafetyCheck(block, is_in_bounds, .index_out_of_bounds);
}
+ try sema.queueFullTypeResolution(sema.typeOf(slice));
return block.addBinOp(.slice_elem_val, slice, elem_index);
}
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index 7caccb1fb8245aacfef88368874c182dab908c33..b6fed4317261821c1227dfe79095c6e1872b5e21 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -1322,9 +1322,6 @@ pub fn parseDylib(self: *MachO, path: []const u8, opts: DylibCreateOpts) ParseDy
error.EndOfStream, error.NotDylib => {
try file.seekTo(0);
- // TODO https://github.com/ziglang/zig/issues/11367
- if (@import("builtin").zig_backend != .stage1) return error.Unexpected;
-
var lib_stub = LibStub.loadFromFile(self.base.allocator, file) catch {
dylib.deinit(self.base.allocator);
return false;
diff --git a/src/link/MachO/Dylib.zig b/src/link/MachO/Dylib.zig
index 26bac50144eeb3a9357eab20202998a3c5f73d0f..833c976bf9be09cc93f6e5e87f11dd51adbf8e84 100644
--- a/src/link/MachO/Dylib.zig
+++ b/src/link/MachO/Dylib.zig
@@ -242,20 +242,20 @@ fn addObjCClassSymbol(self: *Dylib, allocator: Allocator, sym_name: []const u8)
for (expanded) |sym| {
if (self.symbols.contains(sym)) continue;
- try self.symbols.putNoClobber(allocator, sym, .{});
+ try self.symbols.putNoClobber(allocator, sym, {});
}
}
fn addObjCIVarSymbol(self: *Dylib, allocator: Allocator, sym_name: []const u8) !void {
const expanded = try std.fmt.allocPrint(allocator, "_OBJC_IVAR_$_{s}", .{sym_name});
if (self.symbols.contains(expanded)) return;
- try self.symbols.putNoClobber(allocator, expanded, .{});
+ try self.symbols.putNoClobber(allocator, expanded, {});
}
fn addObjCEhTypeSymbol(self: *Dylib, allocator: Allocator, sym_name: []const u8) !void {
const expanded = try std.fmt.allocPrint(allocator, "_OBJC_EHTYPE_$_{s}", .{sym_name});
if (self.symbols.contains(expanded)) return;
- try self.symbols.putNoClobber(allocator, expanded, .{});
+ try self.symbols.putNoClobber(allocator, expanded, {});
}
fn addSymbol(self: *Dylib, allocator: Allocator, sym_name: []const u8) !void {
@@ -373,7 +373,7 @@ pub fn parseFromStub(
// TODO I thought that we could switch on presence of `parent-umbrella` map;
// however, turns out `libsystem_notify.dylib` is fully reexported by `libSystem.dylib`
// BUT does not feature a `parent-umbrella` map as the only sublib. Apple's bug perhaps?
- try umbrella_libs.put(elem.installName(), .{});
+ try umbrella_libs.put(elem.installName(), {});
}
switch (elem) {
diff --git a/src/link/tapi/yaml.zig b/src/link/tapi/yaml.zig
index 7c1997604d305dc144a7d441e95862a92f402354..e31aa4198522b5ae8c9a5e471d661679440bf1db 100644
--- a/src/link/tapi/yaml.zig
+++ b/src/link/tapi/yaml.zig
@@ -153,7 +153,7 @@ pub const Value = union(ValueType) {
if (node.cast(Node.Doc)) |doc| {
const inner = doc.value orelse {
// empty doc
- return Value{ .empty = .{} };
+ return Value{ .empty = {} };
};
return Value.fromNode(arena, tree, inner, null);
} else if (node.cast(Node.Map)) |map| {
diff --git a/src/type.zig b/src/type.zig
index ddeec596e18aa85964532fdc85bb7012fc136904..049f7ec8561d44c9732aad6a90db0b0d27b528a1 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -2394,11 +2394,15 @@ pub const Type = extern union {
_ = try sk.sema.typeRequiresComptime(sk.block, sk.src, ty);
}
switch (struct_obj.requires_comptime) {
- .wip => unreachable,
.yes => return false,
- .no => if (struct_obj.known_non_opv) return true,
+ .wip, .no => if (struct_obj.known_non_opv) return true,
.unknown => {},
}
+ if (struct_obj.status == .field_types_wip) {
+ // In this case, we guess that hasRuntimeBits() for this type is true,
+ // and then later if our guess was incorrect, we emit a compile error.
+ return true;
+ }
if (sema_kit) |sk| {
_ = try sk.sema.resolveTypeFields(sk.block, sk.src, ty);
}
@@ -2735,6 +2739,12 @@ pub const Type = extern union {
val: Value,
};
+ const AbiAlignmentAdvancedStrat = union(enum) {
+ eager,
+ lazy: Allocator,
+ sema_kit: Module.WipAnalysis,
+ };
+
/// If you pass `eager` you will get back `scalar` and assert the type is resolved.
/// In this case there will be no error, guaranteed.
/// If you pass `lazy` you may get back `scalar` or `val`.
@@ -2744,11 +2754,7 @@ pub const Type = extern union {
pub fn abiAlignmentAdvanced(
ty: Type,
target: Target,
- strat: union(enum) {
- eager,
- lazy: Allocator,
- sema_kit: Module.WipAnalysis,
- },
+ strat: AbiAlignmentAdvancedStrat,
) Module.CompileError!AbiAlignmentAdvanced {
const sema_kit = switch (strat) {
.sema_kit => |sk| sk,
@@ -2928,21 +2934,24 @@ pub const Type = extern union {
},
.@"struct" => {
+ const struct_obj = ty.castTag(.@"struct").?.data;
if (sema_kit) |sk| {
- try sk.sema.resolveTypeLayout(sk.block, sk.src, ty);
- }
- if (ty.castTag(.@"struct")) |payload| {
- const struct_obj = payload.data;
- if (!struct_obj.haveLayout()) switch (strat) {
- .eager => unreachable, // struct layout not resolved
- .sema_kit => unreachable, // handled above
- .lazy => |arena| return AbiAlignmentAdvanced{ .val = try Value.Tag.lazy_align.create(arena, ty) },
- };
- if (struct_obj.layout == .Packed) {
- var buf: Type.Payload.Bits = undefined;
- const int_ty = struct_obj.packedIntegerType(target, &buf);
- return AbiAlignmentAdvanced{ .scalar = int_ty.abiAlignment(target) };
+ if (struct_obj.status == .field_types_wip) {
+ // We'll guess "pointer-aligned" and if we guess wrong, emit
+ // a compile error later.
+ return AbiAlignmentAdvanced{ .scalar = @divExact(target.cpu.arch.ptrBitWidth(), 8) };
}
+ _ = try sk.sema.resolveTypeFields(sk.block, sk.src, ty);
+ }
+ if (!struct_obj.haveFieldTypes()) switch (strat) {
+ .eager => unreachable, // struct layout not resolved
+ .sema_kit => unreachable, // handled above
+ .lazy => |arena| return AbiAlignmentAdvanced{ .val = try Value.Tag.lazy_align.create(arena, ty) },
+ };
+ if (struct_obj.layout == .Packed) {
+ var buf: Type.Payload.Bits = undefined;
+ const int_ty = struct_obj.packedIntegerType(target, &buf);
+ return AbiAlignmentAdvanced{ .scalar = int_ty.abiAlignment(target) };
}
const fields = ty.structFields();
@@ -2950,7 +2959,16 @@ pub const Type = extern union {
for (fields.values()) |field| {
if (!(try field.ty.hasRuntimeBitsAdvanced(false, sema_kit))) continue;
- const field_align = field.normalAlignment(target);
+ const field_align = if (field.abi_align != 0)
+ field.abi_align
+ else switch (try field.ty.abiAlignmentAdvanced(target, strat)) {
+ .scalar => |a| a,
+ .val => switch (strat) {
+ .eager => unreachable, // struct layout not resolved
+ .sema_kit => unreachable, // handled above
+ .lazy => |arena| return AbiAlignmentAdvanced{ .val = try Value.Tag.lazy_align.create(arena, ty) },
+ },
+ };
big_align = @maximum(big_align, field_align);
}
return AbiAlignmentAdvanced{ .scalar = big_align };
@@ -2980,24 +2998,14 @@ pub const Type = extern union {
const int_tag_ty = ty.intTagType(&buffer);
return AbiAlignmentAdvanced{ .scalar = int_tag_ty.abiAlignment(target) };
},
- .@"union" => switch (strat) {
- .eager, .sema_kit => {
- if (sema_kit) |sk| {
- try sk.sema.resolveTypeLayout(sk.block, sk.src, ty);
- }
- // TODO pass `true` for have_tag when unions have a safety tag
- return AbiAlignmentAdvanced{ .scalar = ty.castTag(.@"union").?.data.abiAlignment(target, false) };
- },
- .lazy => |arena| return AbiAlignmentAdvanced{ .val = try Value.Tag.lazy_align.create(arena, ty) },
+ .@"union" => {
+ const union_obj = ty.castTag(.@"union").?.data;
+ // TODO pass `true` for have_tag when unions have a safety tag
+ return abiAlignmentAdvancedUnion(ty, target, strat, union_obj, false);
},
- .union_tagged => switch (strat) {
- .eager, .sema_kit => {
- if (sema_kit) |sk| {
- try sk.sema.resolveTypeLayout(sk.block, sk.src, ty);
- }
- return AbiAlignmentAdvanced{ .scalar = ty.castTag(.union_tagged).?.data.abiAlignment(target, true) };
- },
- .lazy => |arena| return AbiAlignmentAdvanced{ .val = try Value.Tag.lazy_align.create(arena, ty) },
+ .union_tagged => {
+ const union_obj = ty.castTag(.union_tagged).?.data;
+ return abiAlignmentAdvancedUnion(ty, target, strat, union_obj, true);
},
.empty_struct,
@@ -3023,6 +3031,51 @@ pub const Type = extern union {
};
}
+ pub fn abiAlignmentAdvancedUnion(
+ ty: Type,
+ target: Target,
+ strat: AbiAlignmentAdvancedStrat,
+ union_obj: *Module.Union,
+ have_tag: bool,
+ ) Module.CompileError!AbiAlignmentAdvanced {
+ const sema_kit = switch (strat) {
+ .sema_kit => |sk| sk,
+ else => null,
+ };
+ if (sema_kit) |sk| {
+ if (union_obj.status == .field_types_wip) {
+ // We'll guess "pointer-aligned" and if we guess wrong, emit
+ // a compile error later.
+ return AbiAlignmentAdvanced{ .scalar = @divExact(target.cpu.arch.ptrBitWidth(), 8) };
+ }
+ _ = try sk.sema.resolveTypeFields(sk.block, sk.src, ty);
+ }
+ if (!union_obj.haveFieldTypes()) switch (strat) {
+ .eager => unreachable, // union layout not resolved
+ .sema_kit => unreachable, // handled above
+ .lazy => |arena| return AbiAlignmentAdvanced{ .val = try Value.Tag.lazy_align.create(arena, ty) },
+ };
+
+ var max_align: u32 = 0;
+ if (have_tag) max_align = union_obj.tag_ty.abiAlignment(target);
+ for (union_obj.fields.values()) |field| {
+ if (!(try field.ty.hasRuntimeBitsAdvanced(false, sema_kit))) continue;
+
+ const field_align = if (field.abi_align != 0)
+ field.abi_align
+ else switch (try field.ty.abiAlignmentAdvanced(target, strat)) {
+ .scalar => |a| a,
+ .val => switch (strat) {
+ .eager => unreachable, // struct layout not resolved
+ .sema_kit => unreachable, // handled above
+ .lazy => |arena| return AbiAlignmentAdvanced{ .val = try Value.Tag.lazy_align.create(arena, ty) },
+ },
+ };
+ max_align = @maximum(max_align, field_align);
+ }
+ return AbiAlignmentAdvanced{ .scalar = max_align };
+ }
+
/// Asserts the type has the ABI size already resolved.
/// Types that return false for hasRuntimeBits() return 0.
pub fn abiSize(self: Type, target: Target) u64 {
diff --git a/test/behavior/eval.zig b/test/behavior/eval.zig
index 3895b4b7b2a86d6f4e9b3312e018252c9449d02d..007ea48d87d93cb8b1233d3d506c48475a6623c6 100644
--- a/test/behavior/eval.zig
+++ b/test/behavior/eval.zig
@@ -999,3 +999,114 @@ test "comptime break operand passing through runtime switch converted to runtime
try S.doTheTest('b');
comptime try S.doTheTest('b');
}
+
+test "no dependency loop for alignment of self struct" {
+ if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
+
+ const S = struct {
+ fn doTheTest() !void {
+ var a: namespace.A = undefined;
+ a.d = .{ .g = &buf };
+ a.d.g[3] = 42;
+ a.d.g[3] += 1;
+ try expect(a.d.g[3] == 43);
+ }
+
+ var buf: [10]u8 align(@alignOf([*]u8)) = undefined;
+
+ const namespace = struct {
+ const B = struct { a: A };
+ const A = C(B);
+ };
+
+ pub fn C(comptime B: type) type {
+ return struct {
+ d: D(F) = .{},
+
+ const F = struct { b: B };
+ };
+ }
+
+ pub fn D(comptime F: type) type {
+ return struct {
+ g: [*]align(@alignOf(F)) u8 = undefined,
+ };
+ }
+ };
+ try S.doTheTest();
+}
+
+test "no dependency loop for alignment of self bare union" {
+ if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
+
+ const S = struct {
+ fn doTheTest() !void {
+ var a: namespace.A = undefined;
+ a.d = .{ .g = &buf };
+ a.d.g[3] = 42;
+ a.d.g[3] += 1;
+ try expect(a.d.g[3] == 43);
+ }
+
+ var buf: [10]u8 align(@alignOf([*]u8)) = undefined;
+
+ const namespace = struct {
+ const B = union { a: A, b: void };
+ const A = C(B);
+ };
+
+ pub fn C(comptime B: type) type {
+ return struct {
+ d: D(F) = .{},
+
+ const F = struct { b: B };
+ };
+ }
+
+ pub fn D(comptime F: type) type {
+ return struct {
+ g: [*]align(@alignOf(F)) u8 = undefined,
+ };
+ }
+ };
+ try S.doTheTest();
+}
+
+test "no dependency loop for alignment of self tagged union" {
+ if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
+
+ const S = struct {
+ fn doTheTest() !void {
+ var a: namespace.A = undefined;
+ a.d = .{ .g = &buf };
+ a.d.g[3] = 42;
+ a.d.g[3] += 1;
+ try expect(a.d.g[3] == 43);
+ }
+
+ var buf: [10]u8 align(@alignOf([*]u8)) = undefined;
+
+ const namespace = struct {
+ const B = union(enum) { a: A, b: void };
+ const A = C(B);
+ };
+
+ pub fn C(comptime B: type) type {
+ return struct {
+ d: D(F) = .{},
+
+ const F = struct { b: B };
+ };
+ }
+
+ pub fn D(comptime F: type) type {
+ return struct {
+ g: [*]align(@alignOf(F)) u8 = undefined,
+ };
+ }
+ };
+ try S.doTheTest();
+}
--
2.54.0
From f034cef262ed050551bc5c36d710263950e5eb27 Mon Sep 17 00:00:00 2001
From: Andrew Kelley
Date: Thu, 5 May 2022 22:16:38 -0700
Subject: [PATCH 2/4] link/MachO: use const instead of var and limit scope of
vars
---
src/link/MachO/Dylib.zig | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/link/MachO/Dylib.zig b/src/link/MachO/Dylib.zig
index 833c976bf9be09cc93f6e5e87f11dd51adbf8e84..57c8238827e8503d5075ff2c64b6975d599a25d8 100644
--- a/src/link/MachO/Dylib.zig
+++ b/src/link/MachO/Dylib.zig
@@ -214,12 +214,12 @@ fn parseSymbols(self: *Dylib, allocator: Allocator) !void {
const index = self.symtab_cmd_index orelse return;
const symtab_cmd = self.load_commands.items[index].symtab;
- var symtab = try allocator.alloc(u8, @sizeOf(macho.nlist_64) * symtab_cmd.nsyms);
+ const symtab = try allocator.alloc(u8, @sizeOf(macho.nlist_64) * symtab_cmd.nsyms);
defer allocator.free(symtab);
_ = try self.file.preadAll(symtab, symtab_cmd.symoff + self.library_offset);
const slice = @alignCast(@alignOf(macho.nlist_64), mem.bytesAsSlice(macho.nlist_64, symtab));
- var strtab = try allocator.alloc(u8, symtab_cmd.strsize);
+ const strtab = try allocator.alloc(u8, symtab_cmd.strsize);
defer allocator.free(strtab);
_ = try self.file.preadAll(strtab, symtab_cmd.stroff + self.library_offset);
@@ -345,14 +345,16 @@ pub fn parseFromStub(
const umbrella_lib = lib_stub.inner[0];
- var id = try Id.default(allocator, umbrella_lib.installName());
- if (umbrella_lib.currentVersion()) |version| {
- try id.parseCurrentVersion(version);
+ {
+ var id = try Id.default(allocator, umbrella_lib.installName());
+ if (umbrella_lib.currentVersion()) |version| {
+ try id.parseCurrentVersion(version);
+ }
+ if (umbrella_lib.compatibilityVersion()) |version| {
+ try id.parseCompatibilityVersion(version);
+ }
+ self.id = id;
}
- if (umbrella_lib.compatibilityVersion()) |version| {
- try id.parseCompatibilityVersion(version);
- }
- self.id = id;
var umbrella_libs = std.StringHashMap(void).init(allocator);
defer umbrella_libs.deinit();
--
2.54.0
From 3b60ab4872355f0b9a9c7d0794ca8b548ab99412 Mon Sep 17 00:00:00 2001
From: Andrew Kelley
Date: Thu, 5 May 2022 22:17:21 -0700
Subject: [PATCH 3/4] stage2: fix std lib tests always filtering out all tests
---
src/Compilation.zig | 1 +
src/Module.zig | 16 ++++++++++++++--
src/Package.zig | 8 ++++++++
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 2ad8a9e0300537b61d8b1a8c5491a3d9f104d74c..3f4d8d697644087a3121dd2ab0423b99a9f0a297 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1418,6 +1418,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
.gpa = gpa,
.comp = comp,
.main_pkg = main_pkg,
+ .main_pkg_is_std = try main_pkg.isInsideOf(std_pkg.*),
.root_pkg = root_pkg,
.zig_cache_artifact_directory = zig_cache_artifact_directory,
.global_zir_cache = global_zir_cache,
diff --git a/src/Module.zig b/src/Module.zig
index 864663ada2125f1d32995dc14a3fbd9c435808f8..0966c8ffcf82b33e8c9534e8f7abd886cd87410d 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -130,6 +130,10 @@ stage1_flags: packed struct {
} = .{},
job_queued_update_builtin_zig: bool = true,
+/// This makes it so that we can run `zig test` on the standard library.
+/// Otherwise, the logic for scanning test decls skips all of them because
+/// `main_pkg != std_pkg`.
+main_pkg_is_std: bool,
compile_log_text: ArrayListUnmanaged(u8) = .{},
@@ -4528,14 +4532,22 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi
// test decl with no name. Skip the part where we check against
// the test name filter.
if (!mod.comp.bin_file.options.is_test) break :blk false;
- if (decl_pkg != mod.main_pkg) break :blk false;
+ if (decl_pkg != mod.main_pkg) {
+ if (!mod.main_pkg_is_std) break :blk false;
+ const std_pkg = mod.main_pkg.table.get("std").?;
+ if (std_pkg != decl_pkg) break :blk false;
+ }
try mod.test_functions.put(gpa, new_decl_index, {});
break :blk true;
},
else => blk: {
if (!is_named_test) break :blk false;
if (!mod.comp.bin_file.options.is_test) break :blk false;
- if (decl_pkg != mod.main_pkg) break :blk false;
+ if (decl_pkg != mod.main_pkg) {
+ if (!mod.main_pkg_is_std) break :blk false;
+ const std_pkg = mod.main_pkg.table.get("std").?;
+ if (std_pkg != decl_pkg) break :blk false;
+ }
// TODO check the name against --test-filter
try mod.test_functions.put(gpa, new_decl_index, {});
break :blk true;
diff --git a/src/Package.zig b/src/Package.zig
index df894280a99c6c59a653cdd3f133ad34467f753b..9ac1e2e5b1a3591f56cfbdbb08a311a83a9f6d1e 100644
--- a/src/Package.zig
+++ b/src/Package.zig
@@ -124,3 +124,11 @@ pub fn addAndAdopt(parent: *Package, gpa: Allocator, name: []const u8, child: *P
child.parent = parent;
return parent.add(gpa, name, child);
}
+
+pub fn isInsideOf(pkg: Package, another: Package) !bool {
+ var pkg_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var another_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ const pkg_path = try pkg.root_src_directory.handle.realpath(pkg.root_src_path, &pkg_buffer);
+ const another_path = try another.root_src_directory.handle.realpath(".", &another_buffer);
+ return mem.startsWith(u8, pkg_path, another_path);
+}
--
2.54.0
From ec95e00e28cb23f37dc097f71afd7090e947a1cd Mon Sep 17 00:00:00 2001
From: Andrew Kelley
Date: Fri, 6 May 2022 19:22:40 -0700
Subject: [PATCH 4/4] flatten lib/std/special and improve "pkg inside another"
logic
stage2: change logic for detecting whether the main package is inside
the std package. Previously it relied on realpath() which is not portable.
This uses resolve() which is how imports already work.
* stage2: fix cleanup bug when creating Module
* flatten lib/std/special/* to lib/*
- this was motivated by making main_pkg_is_inside_std false for
compiler_rt & friends.
* rename "mini libc" to "universal libc"
---
CMakeLists.txt | 138 +++++++++---------
build.zig | 8 +-
ci/drone/linux_script_test | 2 +-
ci/zinc/linux_test.sh | 2 +-
doc/langref.html.in | 2 +-
lib/{std/special => }/build_runner.zig | 0
lib/{std/special => }/c.zig | 0
lib/{std/special => }/compiler_rt.zig | 0
lib/{std/special => }/compiler_rt/README.md | 0
lib/{std/special => }/compiler_rt/absv.zig | 0
.../special => }/compiler_rt/absvdi2_test.zig | 0
.../special => }/compiler_rt/absvsi2_test.zig | 0
.../special => }/compiler_rt/absvti2_test.zig | 0
lib/{std/special => }/compiler_rt/addXf3.zig | 0
.../special => }/compiler_rt/addXf3_test.zig | 0
lib/{std/special => }/compiler_rt/addo.zig | 0
.../special => }/compiler_rt/addodi4_test.zig | 0
.../special => }/compiler_rt/addosi4_test.zig | 0
.../special => }/compiler_rt/addoti4_test.zig | 0
lib/{std/special => }/compiler_rt/arm.zig | 0
.../special => }/compiler_rt/ashldi3_test.zig | 0
.../special => }/compiler_rt/ashlti3_test.zig | 0
.../special => }/compiler_rt/ashrdi3_test.zig | 0
.../special => }/compiler_rt/ashrti3_test.zig | 0
lib/{std/special => }/compiler_rt/atomics.zig | 0
lib/{std/special => }/compiler_rt/aulldiv.zig | 0
lib/{std/special => }/compiler_rt/aullrem.zig | 0
lib/{std/special => }/compiler_rt/bswap.zig | 0
.../compiler_rt/bswapdi2_test.zig | 0
.../compiler_rt/bswapsi2_test.zig | 0
.../compiler_rt/bswapti2_test.zig | 0
lib/{std/special => }/compiler_rt/ceil.zig | 0
.../special => }/compiler_rt/clear_cache.zig | 0
.../special => }/compiler_rt/clzdi2_test.zig | 0
.../special => }/compiler_rt/clzsi2_test.zig | 0
.../special => }/compiler_rt/clzti2_test.zig | 0
lib/{std/special => }/compiler_rt/cmp.zig | 0
.../special => }/compiler_rt/cmpdi2_test.zig | 0
.../special => }/compiler_rt/cmpsi2_test.zig | 0
.../special => }/compiler_rt/cmpti2_test.zig | 0
.../special => }/compiler_rt/compareXf2.zig | 0
.../compiler_rt/comparedf2_test.zig | 0
.../compiler_rt/comparesf2_test.zig | 0
lib/{std/special => }/compiler_rt/cos.zig | 0
.../special => }/compiler_rt/count0bits.zig | 0
.../special => }/compiler_rt/ctzdi2_test.zig | 0
.../special => }/compiler_rt/ctzsi2_test.zig | 0
.../special => }/compiler_rt/ctzti2_test.zig | 0
lib/{std/special => }/compiler_rt/divdf3.zig | 0
.../special => }/compiler_rt/divdf3_test.zig | 0
lib/{std/special => }/compiler_rt/divsf3.zig | 0
.../special => }/compiler_rt/divsf3_test.zig | 0
lib/{std/special => }/compiler_rt/divtf3.zig | 0
.../special => }/compiler_rt/divtf3_test.zig | 0
lib/{std/special => }/compiler_rt/divti3.zig | 0
.../special => }/compiler_rt/divti3_test.zig | 0
lib/{std/special => }/compiler_rt/divxf3.zig | 0
.../special => }/compiler_rt/divxf3_test.zig | 0
lib/{std/special => }/compiler_rt/emutls.zig | 0
lib/{std/special => }/compiler_rt/exp.zig | 0
lib/{std/special => }/compiler_rt/exp2.zig | 0
.../special => }/compiler_rt/extendXfYf2.zig | 0
.../compiler_rt/extendXfYf2_test.zig | 0
.../special => }/compiler_rt/extend_f80.zig | 0
lib/{std/special => }/compiler_rt/fabs.zig | 0
.../special => }/compiler_rt/ffsdi2_test.zig | 0
.../special => }/compiler_rt/ffssi2_test.zig | 0
.../special => }/compiler_rt/ffsti2_test.zig | 0
lib/{std/special => }/compiler_rt/fixXfYi.zig | 0
.../special => }/compiler_rt/fixXfYi_test.zig | 0
.../special => }/compiler_rt/fixint_test.zig | 0
.../special => }/compiler_rt/floatXiYf.zig | 0
.../compiler_rt/floatXiYf_test.zig | 0
lib/{std/special => }/compiler_rt/floor.zig | 0
lib/{std/special => }/compiler_rt/fma.zig | 0
lib/{std/special => }/compiler_rt/fmax.zig | 0
lib/{std/special => }/compiler_rt/fmin.zig | 0
lib/{std/special => }/compiler_rt/fmod.zig | 0
.../special => }/compiler_rt/fmodq_test.zig | 0
.../special => }/compiler_rt/fmodx_test.zig | 0
lib/{std/special => }/compiler_rt/int.zig | 0
lib/{std/special => }/compiler_rt/log.zig | 0
lib/{std/special => }/compiler_rt/log10.zig | 0
lib/{std/special => }/compiler_rt/log2.zig | 0
.../special => }/compiler_rt/lshrdi3_test.zig | 0
.../special => }/compiler_rt/lshrti3_test.zig | 0
lib/{std/special => }/compiler_rt/modti3.zig | 0
.../special => }/compiler_rt/modti3_test.zig | 0
lib/{std/special => }/compiler_rt/mulXf3.zig | 0
.../special => }/compiler_rt/mulXf3_test.zig | 0
lib/{std/special => }/compiler_rt/muldi3.zig | 0
.../special => }/compiler_rt/muldi3_test.zig | 0
lib/{std/special => }/compiler_rt/mulo.zig | 0
.../special => }/compiler_rt/mulodi4_test.zig | 0
.../special => }/compiler_rt/mulosi4_test.zig | 0
.../special => }/compiler_rt/muloti4_test.zig | 0
lib/{std/special => }/compiler_rt/multi3.zig | 0
.../special => }/compiler_rt/multi3_test.zig | 0
lib/{std/special => }/compiler_rt/negXf2.zig | 0
lib/{std/special => }/compiler_rt/negXi2.zig | 0
.../special => }/compiler_rt/negdi2_test.zig | 0
.../special => }/compiler_rt/negsi2_test.zig | 0
.../special => }/compiler_rt/negti2_test.zig | 0
lib/{std/special => }/compiler_rt/negv.zig | 0
.../special => }/compiler_rt/negvdi2_test.zig | 0
.../special => }/compiler_rt/negvsi2_test.zig | 0
.../special => }/compiler_rt/negvti2_test.zig | 0
.../compiler_rt/os_version_check.zig | 0
lib/{std/special => }/compiler_rt/parity.zig | 0
.../compiler_rt/paritydi2_test.zig | 0
.../compiler_rt/paritysi2_test.zig | 0
.../compiler_rt/parityti2_test.zig | 0
.../special => }/compiler_rt/popcount.zig | 0
.../compiler_rt/popcountdi2_test.zig | 0
.../compiler_rt/popcountsi2_test.zig | 0
.../compiler_rt/popcountti2_test.zig | 0
.../special => }/compiler_rt/rem_pio2.zig | 0
.../compiler_rt/rem_pio2_large.zig | 0
.../special => }/compiler_rt/rem_pio2f.zig | 0
lib/{std/special => }/compiler_rt/round.zig | 0
lib/{std/special => }/compiler_rt/shift.zig | 0
lib/{std/special => }/compiler_rt/sin.zig | 0
lib/{std/special => }/compiler_rt/sincos.zig | 0
lib/{std/special => }/compiler_rt/sparc.zig | 0
lib/{std/special => }/compiler_rt/sqrt.zig | 0
.../special => }/compiler_rt/stack_probe.zig | 0
lib/{std/special => }/compiler_rt/subo.zig | 0
.../special => }/compiler_rt/subodi4_test.zig | 0
.../special => }/compiler_rt/subosi4_test.zig | 0
.../special => }/compiler_rt/suboti4_test.zig | 0
lib/{std/special => }/compiler_rt/tan.zig | 0
lib/{std/special => }/compiler_rt/trig.zig | 0
lib/{std/special => }/compiler_rt/trunc.zig | 0
.../special => }/compiler_rt/truncXfYf2.zig | 0
.../compiler_rt/truncXfYf2_test.zig | 0
.../special => }/compiler_rt/trunc_f80.zig | 0
.../special => }/compiler_rt/ucmpdi2_test.zig | 0
.../special => }/compiler_rt/ucmpsi2_test.zig | 0
.../special => }/compiler_rt/ucmpti2_test.zig | 0
lib/{std/special => }/compiler_rt/udivmod.zig | 0
.../compiler_rt/udivmoddi4_test.zig | 0
.../special => }/compiler_rt/udivmodti4.zig | 0
.../compiler_rt/udivmodti4_test.zig | 0
lib/{std/special => }/compiler_rt/udivti3.zig | 0
lib/{std/special => }/compiler_rt/umodti3.zig | 0
lib/{std/special => }/docs/index.html | 0
lib/{std/special => }/docs/main.js | 0
lib/{std/special => }/init-exe/build.zig | 0
lib/{std/special => }/init-exe/src/main.zig | 0
lib/{std/special => }/init-lib/build.zig | 0
lib/{std/special => }/init-lib/src/main.zig | 0
lib/{std/special => }/ssp.zig | 0
lib/std/build.zig | 2 +-
lib/{std/special => }/test_runner.zig | 0
src/Compilation.zig | 33 +++--
src/Module.zig | 8 +-
src/Package.zig | 8 -
src/main.zig | 15 +-
src/stage1/all_types.hpp | 1 -
src/stage1/codegen.cpp | 22 +--
160 files changed, 115 insertions(+), 126 deletions(-)
rename lib/{std/special => }/build_runner.zig (100%)
rename lib/{std/special => }/c.zig (100%)
rename lib/{std/special => }/compiler_rt.zig (100%)
rename lib/{std/special => }/compiler_rt/README.md (100%)
rename lib/{std/special => }/compiler_rt/absv.zig (100%)
rename lib/{std/special => }/compiler_rt/absvdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/absvsi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/absvti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/addXf3.zig (100%)
rename lib/{std/special => }/compiler_rt/addXf3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/addo.zig (100%)
rename lib/{std/special => }/compiler_rt/addodi4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/addosi4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/addoti4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/arm.zig (100%)
rename lib/{std/special => }/compiler_rt/ashldi3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ashlti3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ashrdi3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ashrti3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/atomics.zig (100%)
rename lib/{std/special => }/compiler_rt/aulldiv.zig (100%)
rename lib/{std/special => }/compiler_rt/aullrem.zig (100%)
rename lib/{std/special => }/compiler_rt/bswap.zig (100%)
rename lib/{std/special => }/compiler_rt/bswapdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/bswapsi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/bswapti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ceil.zig (100%)
rename lib/{std/special => }/compiler_rt/clear_cache.zig (100%)
rename lib/{std/special => }/compiler_rt/clzdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/clzsi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/clzti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/cmp.zig (100%)
rename lib/{std/special => }/compiler_rt/cmpdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/cmpsi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/cmpti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/compareXf2.zig (100%)
rename lib/{std/special => }/compiler_rt/comparedf2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/comparesf2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/cos.zig (100%)
rename lib/{std/special => }/compiler_rt/count0bits.zig (100%)
rename lib/{std/special => }/compiler_rt/ctzdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ctzsi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ctzti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/divdf3.zig (100%)
rename lib/{std/special => }/compiler_rt/divdf3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/divsf3.zig (100%)
rename lib/{std/special => }/compiler_rt/divsf3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/divtf3.zig (100%)
rename lib/{std/special => }/compiler_rt/divtf3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/divti3.zig (100%)
rename lib/{std/special => }/compiler_rt/divti3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/divxf3.zig (100%)
rename lib/{std/special => }/compiler_rt/divxf3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/emutls.zig (100%)
rename lib/{std/special => }/compiler_rt/exp.zig (100%)
rename lib/{std/special => }/compiler_rt/exp2.zig (100%)
rename lib/{std/special => }/compiler_rt/extendXfYf2.zig (100%)
rename lib/{std/special => }/compiler_rt/extendXfYf2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/extend_f80.zig (100%)
rename lib/{std/special => }/compiler_rt/fabs.zig (100%)
rename lib/{std/special => }/compiler_rt/ffsdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ffssi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ffsti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/fixXfYi.zig (100%)
rename lib/{std/special => }/compiler_rt/fixXfYi_test.zig (100%)
rename lib/{std/special => }/compiler_rt/fixint_test.zig (100%)
rename lib/{std/special => }/compiler_rt/floatXiYf.zig (100%)
rename lib/{std/special => }/compiler_rt/floatXiYf_test.zig (100%)
rename lib/{std/special => }/compiler_rt/floor.zig (100%)
rename lib/{std/special => }/compiler_rt/fma.zig (100%)
rename lib/{std/special => }/compiler_rt/fmax.zig (100%)
rename lib/{std/special => }/compiler_rt/fmin.zig (100%)
rename lib/{std/special => }/compiler_rt/fmod.zig (100%)
rename lib/{std/special => }/compiler_rt/fmodq_test.zig (100%)
rename lib/{std/special => }/compiler_rt/fmodx_test.zig (100%)
rename lib/{std/special => }/compiler_rt/int.zig (100%)
rename lib/{std/special => }/compiler_rt/log.zig (100%)
rename lib/{std/special => }/compiler_rt/log10.zig (100%)
rename lib/{std/special => }/compiler_rt/log2.zig (100%)
rename lib/{std/special => }/compiler_rt/lshrdi3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/lshrti3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/modti3.zig (100%)
rename lib/{std/special => }/compiler_rt/modti3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/mulXf3.zig (100%)
rename lib/{std/special => }/compiler_rt/mulXf3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/muldi3.zig (100%)
rename lib/{std/special => }/compiler_rt/muldi3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/mulo.zig (100%)
rename lib/{std/special => }/compiler_rt/mulodi4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/mulosi4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/muloti4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/multi3.zig (100%)
rename lib/{std/special => }/compiler_rt/multi3_test.zig (100%)
rename lib/{std/special => }/compiler_rt/negXf2.zig (100%)
rename lib/{std/special => }/compiler_rt/negXi2.zig (100%)
rename lib/{std/special => }/compiler_rt/negdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/negsi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/negti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/negv.zig (100%)
rename lib/{std/special => }/compiler_rt/negvdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/negvsi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/negvti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/os_version_check.zig (100%)
rename lib/{std/special => }/compiler_rt/parity.zig (100%)
rename lib/{std/special => }/compiler_rt/paritydi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/paritysi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/parityti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/popcount.zig (100%)
rename lib/{std/special => }/compiler_rt/popcountdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/popcountsi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/popcountti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/rem_pio2.zig (100%)
rename lib/{std/special => }/compiler_rt/rem_pio2_large.zig (100%)
rename lib/{std/special => }/compiler_rt/rem_pio2f.zig (100%)
rename lib/{std/special => }/compiler_rt/round.zig (100%)
rename lib/{std/special => }/compiler_rt/shift.zig (100%)
rename lib/{std/special => }/compiler_rt/sin.zig (100%)
rename lib/{std/special => }/compiler_rt/sincos.zig (100%)
rename lib/{std/special => }/compiler_rt/sparc.zig (100%)
rename lib/{std/special => }/compiler_rt/sqrt.zig (100%)
rename lib/{std/special => }/compiler_rt/stack_probe.zig (100%)
rename lib/{std/special => }/compiler_rt/subo.zig (100%)
rename lib/{std/special => }/compiler_rt/subodi4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/subosi4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/suboti4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/tan.zig (100%)
rename lib/{std/special => }/compiler_rt/trig.zig (100%)
rename lib/{std/special => }/compiler_rt/trunc.zig (100%)
rename lib/{std/special => }/compiler_rt/truncXfYf2.zig (100%)
rename lib/{std/special => }/compiler_rt/truncXfYf2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/trunc_f80.zig (100%)
rename lib/{std/special => }/compiler_rt/ucmpdi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ucmpsi2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/ucmpti2_test.zig (100%)
rename lib/{std/special => }/compiler_rt/udivmod.zig (100%)
rename lib/{std/special => }/compiler_rt/udivmoddi4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/udivmodti4.zig (100%)
rename lib/{std/special => }/compiler_rt/udivmodti4_test.zig (100%)
rename lib/{std/special => }/compiler_rt/udivti3.zig (100%)
rename lib/{std/special => }/compiler_rt/umodti3.zig (100%)
rename lib/{std/special => }/docs/index.html (100%)
rename lib/{std/special => }/docs/main.js (100%)
rename lib/{std/special => }/init-exe/build.zig (100%)
rename lib/{std/special => }/init-exe/src/main.zig (100%)
rename lib/{std/special => }/init-lib/build.zig (100%)
rename lib/{std/special => }/init-lib/src/main.zig (100%)
rename lib/{std/special => }/ssp.zig (100%)
rename lib/{std/special => }/test_runner.zig (100%)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2b0c31054a9b4db9a642dd302ead65326ae46ca..dd5791807373f9760b501537f7942cd819582848 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -478,74 +478,74 @@ set(ZIG_STAGE2_SOURCES
"${CMAKE_SOURCE_DIR}/lib/std/process.zig"
"${CMAKE_SOURCE_DIR}/lib/std/rand.zig"
"${CMAKE_SOURCE_DIR}/lib/std/sort.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/absv.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/addXf3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/addo.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/arm.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/atomics.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/aulldiv.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/aullrem.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/bswap.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/ceil.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/clear_cache.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/cmp.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/compareXf2.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/cos.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/count0bits.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/divdf3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/divsf3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/divtf3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/divti3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/divxf3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/emutls.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/exp.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/exp2.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/extendXfYf2.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/extend_f80.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fabs.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fixXfYi.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floatXiYf.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/floor.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fma.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fmax.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fmin.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/fmod.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/int.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/log.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/log10.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/log2.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/modti3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/mulXf3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/muldi3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/mulo.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/multi3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/negXf2.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/negXi2.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/negv.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/os_version_check.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/parity.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/popcount.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/rem_pio2.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/rem_pio2_large.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/rem_pio2f.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/round.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/shift.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/sin.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/sincos.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/sparc.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/sqrt.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/stack_probe.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/subo.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/tan.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/trig.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/trunc.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/truncXfYf2.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/trunc_f80.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/udivmod.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/udivmodti4.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/udivti3.zig"
- "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/umodti3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/absv.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/addXf3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/addo.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/arm.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/atomics.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/aulldiv.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/aullrem.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/bswap.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/ceil.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/clear_cache.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/cmp.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/compareXf2.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/cos.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/count0bits.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/divdf3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/divsf3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/divtf3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/divti3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/divxf3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/emutls.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/exp.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/exp2.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/extendXfYf2.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/extend_f80.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/fabs.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixXfYi.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatXiYf.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/floor.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/fma.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/fmax.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/fmin.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/fmod.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/int.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/log.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/log10.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/log2.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/modti3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/mulXf3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/muldi3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/mulo.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/multi3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/negXf2.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/negXi2.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/negv.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/os_version_check.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/parity.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/popcount.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/rem_pio2.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/rem_pio2_large.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/rem_pio2f.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/round.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/shift.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/sin.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/sincos.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/sparc.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/sqrt.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/stack_probe.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/subo.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/tan.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/trig.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/trunc.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/truncXfYf2.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/trunc_f80.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/udivmod.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/udivmodti4.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/udivti3.zig"
+ "${CMAKE_SOURCE_DIR}/lib/compiler_rt/umodti3.zig"
"${CMAKE_SOURCE_DIR}/lib/std/start.zig"
"${CMAKE_SOURCE_DIR}/lib/std/std.zig"
"${CMAKE_SOURCE_DIR}/lib/std/target.zig"
@@ -869,7 +869,7 @@ set(BUILD_ZIG1_ARGS
-lc
--pkg-begin build_options "${ZIG_CONFIG_ZIG_OUT}"
--pkg-end
- --pkg-begin compiler_rt "${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt.zig"
+ --pkg-begin compiler_rt "${CMAKE_SOURCE_DIR}/lib/compiler_rt.zig"
--pkg-end
)
diff --git a/build.zig b/build.zig
index 4d3cf492bd0944ab51fe2528b92a36a81c16b55e..a70623ce8ecb916b046e055bb6ce1e892e589593 100644
--- a/build.zig
+++ b/build.zig
@@ -450,7 +450,7 @@ pub fn build(b: *Builder) !void {
toolchain_step.dependOn(tests.addPkgTests(
b,
test_filter,
- "lib/std/special/compiler_rt.zig",
+ "lib/compiler_rt.zig",
"compiler-rt",
"Run the compiler_rt tests",
modes,
@@ -462,9 +462,9 @@ pub fn build(b: *Builder) !void {
toolchain_step.dependOn(tests.addPkgTests(
b,
test_filter,
- "lib/std/special/c.zig",
- "minilibc",
- "Run the mini libc tests",
+ "lib/c.zig",
+ "universal-libc",
+ "Run the universal libc tests",
modes,
true, // skip_single_threaded
skip_non_native,
diff --git a/ci/drone/linux_script_test b/ci/drone/linux_script_test
index 14f6fd85df76423e555b97a0180c2a1d420bf25e..12f9439102e4298bb7ee63a2ab2fe2049f0caf4c 100755
--- a/ci/drone/linux_script_test
+++ b/ci/drone/linux_script_test
@@ -28,7 +28,7 @@ case "$1" in
./build/zig build $BUILD_FLAGS test-std -Dskip-debug -Dskip-release-safe -Dskip-release-fast
;;
6)
- ./build/zig build $BUILD_FLAGS test-minilibc
+ ./build/zig build $BUILD_FLAGS test-universal-libc
./build/zig build $BUILD_FLAGS test-compare-output
./build/zig build $BUILD_FLAGS test-standalone -Dskip-release-safe
./build/zig build $BUILD_FLAGS test-stack-traces
diff --git a/ci/zinc/linux_test.sh b/ci/zinc/linux_test.sh
index 180589cc8ef8bd8fb8c038ba70d12ee8e8e33025..c15a4e15c899d72647c9328c0d6a33249d4e6b93 100755
--- a/ci/zinc/linux_test.sh
+++ b/ci/zinc/linux_test.sh
@@ -69,7 +69,7 @@ stage2/bin/zig test test/behavior.zig -I test -fno-LLVM -target x86_64-macos --
$ZIG build test-behavior -fqemu -fwasmtime
$ZIG build test-compiler-rt -fqemu -fwasmtime
$ZIG build test-std -fqemu -fwasmtime
-$ZIG build test-minilibc -fqemu -fwasmtime
+$ZIG build test-universal-libc -fqemu -fwasmtime
$ZIG build test-compare-output -fqemu -fwasmtime
$ZIG build test-standalone -fqemu -fwasmtime
$ZIG build test-stack-traces -fqemu -fwasmtime
diff --git a/doc/langref.html.in b/doc/langref.html.in
index 3c5de6c8d28a08ae6ed46a16fba302b648274425..d81661ecd3b344f98be53282e4eed0b4cac5380d 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -1040,7 +1040,7 @@ fn addOne(number: i32) i32 {
The shell output shown above displays two lines after the zig test command. These lines are
diff --git a/lib/std/special/build_runner.zig b/lib/build_runner.zig
similarity index 100%
rename from lib/std/special/build_runner.zig
rename to lib/build_runner.zig
diff --git a/lib/std/special/c.zig b/lib/c.zig
similarity index 100%
rename from lib/std/special/c.zig
rename to lib/c.zig
diff --git a/lib/std/special/compiler_rt.zig b/lib/compiler_rt.zig
similarity index 100%
rename from lib/std/special/compiler_rt.zig
rename to lib/compiler_rt.zig
diff --git a/lib/std/special/compiler_rt/README.md b/lib/compiler_rt/README.md
similarity index 100%
rename from lib/std/special/compiler_rt/README.md
rename to lib/compiler_rt/README.md
diff --git a/lib/std/special/compiler_rt/absv.zig b/lib/compiler_rt/absv.zig
similarity index 100%
rename from lib/std/special/compiler_rt/absv.zig
rename to lib/compiler_rt/absv.zig
diff --git a/lib/std/special/compiler_rt/absvdi2_test.zig b/lib/compiler_rt/absvdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/absvdi2_test.zig
rename to lib/compiler_rt/absvdi2_test.zig
diff --git a/lib/std/special/compiler_rt/absvsi2_test.zig b/lib/compiler_rt/absvsi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/absvsi2_test.zig
rename to lib/compiler_rt/absvsi2_test.zig
diff --git a/lib/std/special/compiler_rt/absvti2_test.zig b/lib/compiler_rt/absvti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/absvti2_test.zig
rename to lib/compiler_rt/absvti2_test.zig
diff --git a/lib/std/special/compiler_rt/addXf3.zig b/lib/compiler_rt/addXf3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/addXf3.zig
rename to lib/compiler_rt/addXf3.zig
diff --git a/lib/std/special/compiler_rt/addXf3_test.zig b/lib/compiler_rt/addXf3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/addXf3_test.zig
rename to lib/compiler_rt/addXf3_test.zig
diff --git a/lib/std/special/compiler_rt/addo.zig b/lib/compiler_rt/addo.zig
similarity index 100%
rename from lib/std/special/compiler_rt/addo.zig
rename to lib/compiler_rt/addo.zig
diff --git a/lib/std/special/compiler_rt/addodi4_test.zig b/lib/compiler_rt/addodi4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/addodi4_test.zig
rename to lib/compiler_rt/addodi4_test.zig
diff --git a/lib/std/special/compiler_rt/addosi4_test.zig b/lib/compiler_rt/addosi4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/addosi4_test.zig
rename to lib/compiler_rt/addosi4_test.zig
diff --git a/lib/std/special/compiler_rt/addoti4_test.zig b/lib/compiler_rt/addoti4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/addoti4_test.zig
rename to lib/compiler_rt/addoti4_test.zig
diff --git a/lib/std/special/compiler_rt/arm.zig b/lib/compiler_rt/arm.zig
similarity index 100%
rename from lib/std/special/compiler_rt/arm.zig
rename to lib/compiler_rt/arm.zig
diff --git a/lib/std/special/compiler_rt/ashldi3_test.zig b/lib/compiler_rt/ashldi3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ashldi3_test.zig
rename to lib/compiler_rt/ashldi3_test.zig
diff --git a/lib/std/special/compiler_rt/ashlti3_test.zig b/lib/compiler_rt/ashlti3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ashlti3_test.zig
rename to lib/compiler_rt/ashlti3_test.zig
diff --git a/lib/std/special/compiler_rt/ashrdi3_test.zig b/lib/compiler_rt/ashrdi3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ashrdi3_test.zig
rename to lib/compiler_rt/ashrdi3_test.zig
diff --git a/lib/std/special/compiler_rt/ashrti3_test.zig b/lib/compiler_rt/ashrti3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ashrti3_test.zig
rename to lib/compiler_rt/ashrti3_test.zig
diff --git a/lib/std/special/compiler_rt/atomics.zig b/lib/compiler_rt/atomics.zig
similarity index 100%
rename from lib/std/special/compiler_rt/atomics.zig
rename to lib/compiler_rt/atomics.zig
diff --git a/lib/std/special/compiler_rt/aulldiv.zig b/lib/compiler_rt/aulldiv.zig
similarity index 100%
rename from lib/std/special/compiler_rt/aulldiv.zig
rename to lib/compiler_rt/aulldiv.zig
diff --git a/lib/std/special/compiler_rt/aullrem.zig b/lib/compiler_rt/aullrem.zig
similarity index 100%
rename from lib/std/special/compiler_rt/aullrem.zig
rename to lib/compiler_rt/aullrem.zig
diff --git a/lib/std/special/compiler_rt/bswap.zig b/lib/compiler_rt/bswap.zig
similarity index 100%
rename from lib/std/special/compiler_rt/bswap.zig
rename to lib/compiler_rt/bswap.zig
diff --git a/lib/std/special/compiler_rt/bswapdi2_test.zig b/lib/compiler_rt/bswapdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/bswapdi2_test.zig
rename to lib/compiler_rt/bswapdi2_test.zig
diff --git a/lib/std/special/compiler_rt/bswapsi2_test.zig b/lib/compiler_rt/bswapsi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/bswapsi2_test.zig
rename to lib/compiler_rt/bswapsi2_test.zig
diff --git a/lib/std/special/compiler_rt/bswapti2_test.zig b/lib/compiler_rt/bswapti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/bswapti2_test.zig
rename to lib/compiler_rt/bswapti2_test.zig
diff --git a/lib/std/special/compiler_rt/ceil.zig b/lib/compiler_rt/ceil.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ceil.zig
rename to lib/compiler_rt/ceil.zig
diff --git a/lib/std/special/compiler_rt/clear_cache.zig b/lib/compiler_rt/clear_cache.zig
similarity index 100%
rename from lib/std/special/compiler_rt/clear_cache.zig
rename to lib/compiler_rt/clear_cache.zig
diff --git a/lib/std/special/compiler_rt/clzdi2_test.zig b/lib/compiler_rt/clzdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/clzdi2_test.zig
rename to lib/compiler_rt/clzdi2_test.zig
diff --git a/lib/std/special/compiler_rt/clzsi2_test.zig b/lib/compiler_rt/clzsi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/clzsi2_test.zig
rename to lib/compiler_rt/clzsi2_test.zig
diff --git a/lib/std/special/compiler_rt/clzti2_test.zig b/lib/compiler_rt/clzti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/clzti2_test.zig
rename to lib/compiler_rt/clzti2_test.zig
diff --git a/lib/std/special/compiler_rt/cmp.zig b/lib/compiler_rt/cmp.zig
similarity index 100%
rename from lib/std/special/compiler_rt/cmp.zig
rename to lib/compiler_rt/cmp.zig
diff --git a/lib/std/special/compiler_rt/cmpdi2_test.zig b/lib/compiler_rt/cmpdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/cmpdi2_test.zig
rename to lib/compiler_rt/cmpdi2_test.zig
diff --git a/lib/std/special/compiler_rt/cmpsi2_test.zig b/lib/compiler_rt/cmpsi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/cmpsi2_test.zig
rename to lib/compiler_rt/cmpsi2_test.zig
diff --git a/lib/std/special/compiler_rt/cmpti2_test.zig b/lib/compiler_rt/cmpti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/cmpti2_test.zig
rename to lib/compiler_rt/cmpti2_test.zig
diff --git a/lib/std/special/compiler_rt/compareXf2.zig b/lib/compiler_rt/compareXf2.zig
similarity index 100%
rename from lib/std/special/compiler_rt/compareXf2.zig
rename to lib/compiler_rt/compareXf2.zig
diff --git a/lib/std/special/compiler_rt/comparedf2_test.zig b/lib/compiler_rt/comparedf2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/comparedf2_test.zig
rename to lib/compiler_rt/comparedf2_test.zig
diff --git a/lib/std/special/compiler_rt/comparesf2_test.zig b/lib/compiler_rt/comparesf2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/comparesf2_test.zig
rename to lib/compiler_rt/comparesf2_test.zig
diff --git a/lib/std/special/compiler_rt/cos.zig b/lib/compiler_rt/cos.zig
similarity index 100%
rename from lib/std/special/compiler_rt/cos.zig
rename to lib/compiler_rt/cos.zig
diff --git a/lib/std/special/compiler_rt/count0bits.zig b/lib/compiler_rt/count0bits.zig
similarity index 100%
rename from lib/std/special/compiler_rt/count0bits.zig
rename to lib/compiler_rt/count0bits.zig
diff --git a/lib/std/special/compiler_rt/ctzdi2_test.zig b/lib/compiler_rt/ctzdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ctzdi2_test.zig
rename to lib/compiler_rt/ctzdi2_test.zig
diff --git a/lib/std/special/compiler_rt/ctzsi2_test.zig b/lib/compiler_rt/ctzsi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ctzsi2_test.zig
rename to lib/compiler_rt/ctzsi2_test.zig
diff --git a/lib/std/special/compiler_rt/ctzti2_test.zig b/lib/compiler_rt/ctzti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ctzti2_test.zig
rename to lib/compiler_rt/ctzti2_test.zig
diff --git a/lib/std/special/compiler_rt/divdf3.zig b/lib/compiler_rt/divdf3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divdf3.zig
rename to lib/compiler_rt/divdf3.zig
diff --git a/lib/std/special/compiler_rt/divdf3_test.zig b/lib/compiler_rt/divdf3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divdf3_test.zig
rename to lib/compiler_rt/divdf3_test.zig
diff --git a/lib/std/special/compiler_rt/divsf3.zig b/lib/compiler_rt/divsf3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divsf3.zig
rename to lib/compiler_rt/divsf3.zig
diff --git a/lib/std/special/compiler_rt/divsf3_test.zig b/lib/compiler_rt/divsf3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divsf3_test.zig
rename to lib/compiler_rt/divsf3_test.zig
diff --git a/lib/std/special/compiler_rt/divtf3.zig b/lib/compiler_rt/divtf3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divtf3.zig
rename to lib/compiler_rt/divtf3.zig
diff --git a/lib/std/special/compiler_rt/divtf3_test.zig b/lib/compiler_rt/divtf3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divtf3_test.zig
rename to lib/compiler_rt/divtf3_test.zig
diff --git a/lib/std/special/compiler_rt/divti3.zig b/lib/compiler_rt/divti3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divti3.zig
rename to lib/compiler_rt/divti3.zig
diff --git a/lib/std/special/compiler_rt/divti3_test.zig b/lib/compiler_rt/divti3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divti3_test.zig
rename to lib/compiler_rt/divti3_test.zig
diff --git a/lib/std/special/compiler_rt/divxf3.zig b/lib/compiler_rt/divxf3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divxf3.zig
rename to lib/compiler_rt/divxf3.zig
diff --git a/lib/std/special/compiler_rt/divxf3_test.zig b/lib/compiler_rt/divxf3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/divxf3_test.zig
rename to lib/compiler_rt/divxf3_test.zig
diff --git a/lib/std/special/compiler_rt/emutls.zig b/lib/compiler_rt/emutls.zig
similarity index 100%
rename from lib/std/special/compiler_rt/emutls.zig
rename to lib/compiler_rt/emutls.zig
diff --git a/lib/std/special/compiler_rt/exp.zig b/lib/compiler_rt/exp.zig
similarity index 100%
rename from lib/std/special/compiler_rt/exp.zig
rename to lib/compiler_rt/exp.zig
diff --git a/lib/std/special/compiler_rt/exp2.zig b/lib/compiler_rt/exp2.zig
similarity index 100%
rename from lib/std/special/compiler_rt/exp2.zig
rename to lib/compiler_rt/exp2.zig
diff --git a/lib/std/special/compiler_rt/extendXfYf2.zig b/lib/compiler_rt/extendXfYf2.zig
similarity index 100%
rename from lib/std/special/compiler_rt/extendXfYf2.zig
rename to lib/compiler_rt/extendXfYf2.zig
diff --git a/lib/std/special/compiler_rt/extendXfYf2_test.zig b/lib/compiler_rt/extendXfYf2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/extendXfYf2_test.zig
rename to lib/compiler_rt/extendXfYf2_test.zig
diff --git a/lib/std/special/compiler_rt/extend_f80.zig b/lib/compiler_rt/extend_f80.zig
similarity index 100%
rename from lib/std/special/compiler_rt/extend_f80.zig
rename to lib/compiler_rt/extend_f80.zig
diff --git a/lib/std/special/compiler_rt/fabs.zig b/lib/compiler_rt/fabs.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fabs.zig
rename to lib/compiler_rt/fabs.zig
diff --git a/lib/std/special/compiler_rt/ffsdi2_test.zig b/lib/compiler_rt/ffsdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ffsdi2_test.zig
rename to lib/compiler_rt/ffsdi2_test.zig
diff --git a/lib/std/special/compiler_rt/ffssi2_test.zig b/lib/compiler_rt/ffssi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ffssi2_test.zig
rename to lib/compiler_rt/ffssi2_test.zig
diff --git a/lib/std/special/compiler_rt/ffsti2_test.zig b/lib/compiler_rt/ffsti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ffsti2_test.zig
rename to lib/compiler_rt/ffsti2_test.zig
diff --git a/lib/std/special/compiler_rt/fixXfYi.zig b/lib/compiler_rt/fixXfYi.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fixXfYi.zig
rename to lib/compiler_rt/fixXfYi.zig
diff --git a/lib/std/special/compiler_rt/fixXfYi_test.zig b/lib/compiler_rt/fixXfYi_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fixXfYi_test.zig
rename to lib/compiler_rt/fixXfYi_test.zig
diff --git a/lib/std/special/compiler_rt/fixint_test.zig b/lib/compiler_rt/fixint_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fixint_test.zig
rename to lib/compiler_rt/fixint_test.zig
diff --git a/lib/std/special/compiler_rt/floatXiYf.zig b/lib/compiler_rt/floatXiYf.zig
similarity index 100%
rename from lib/std/special/compiler_rt/floatXiYf.zig
rename to lib/compiler_rt/floatXiYf.zig
diff --git a/lib/std/special/compiler_rt/floatXiYf_test.zig b/lib/compiler_rt/floatXiYf_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/floatXiYf_test.zig
rename to lib/compiler_rt/floatXiYf_test.zig
diff --git a/lib/std/special/compiler_rt/floor.zig b/lib/compiler_rt/floor.zig
similarity index 100%
rename from lib/std/special/compiler_rt/floor.zig
rename to lib/compiler_rt/floor.zig
diff --git a/lib/std/special/compiler_rt/fma.zig b/lib/compiler_rt/fma.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fma.zig
rename to lib/compiler_rt/fma.zig
diff --git a/lib/std/special/compiler_rt/fmax.zig b/lib/compiler_rt/fmax.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fmax.zig
rename to lib/compiler_rt/fmax.zig
diff --git a/lib/std/special/compiler_rt/fmin.zig b/lib/compiler_rt/fmin.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fmin.zig
rename to lib/compiler_rt/fmin.zig
diff --git a/lib/std/special/compiler_rt/fmod.zig b/lib/compiler_rt/fmod.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fmod.zig
rename to lib/compiler_rt/fmod.zig
diff --git a/lib/std/special/compiler_rt/fmodq_test.zig b/lib/compiler_rt/fmodq_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fmodq_test.zig
rename to lib/compiler_rt/fmodq_test.zig
diff --git a/lib/std/special/compiler_rt/fmodx_test.zig b/lib/compiler_rt/fmodx_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/fmodx_test.zig
rename to lib/compiler_rt/fmodx_test.zig
diff --git a/lib/std/special/compiler_rt/int.zig b/lib/compiler_rt/int.zig
similarity index 100%
rename from lib/std/special/compiler_rt/int.zig
rename to lib/compiler_rt/int.zig
diff --git a/lib/std/special/compiler_rt/log.zig b/lib/compiler_rt/log.zig
similarity index 100%
rename from lib/std/special/compiler_rt/log.zig
rename to lib/compiler_rt/log.zig
diff --git a/lib/std/special/compiler_rt/log10.zig b/lib/compiler_rt/log10.zig
similarity index 100%
rename from lib/std/special/compiler_rt/log10.zig
rename to lib/compiler_rt/log10.zig
diff --git a/lib/std/special/compiler_rt/log2.zig b/lib/compiler_rt/log2.zig
similarity index 100%
rename from lib/std/special/compiler_rt/log2.zig
rename to lib/compiler_rt/log2.zig
diff --git a/lib/std/special/compiler_rt/lshrdi3_test.zig b/lib/compiler_rt/lshrdi3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/lshrdi3_test.zig
rename to lib/compiler_rt/lshrdi3_test.zig
diff --git a/lib/std/special/compiler_rt/lshrti3_test.zig b/lib/compiler_rt/lshrti3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/lshrti3_test.zig
rename to lib/compiler_rt/lshrti3_test.zig
diff --git a/lib/std/special/compiler_rt/modti3.zig b/lib/compiler_rt/modti3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/modti3.zig
rename to lib/compiler_rt/modti3.zig
diff --git a/lib/std/special/compiler_rt/modti3_test.zig b/lib/compiler_rt/modti3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/modti3_test.zig
rename to lib/compiler_rt/modti3_test.zig
diff --git a/lib/std/special/compiler_rt/mulXf3.zig b/lib/compiler_rt/mulXf3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/mulXf3.zig
rename to lib/compiler_rt/mulXf3.zig
diff --git a/lib/std/special/compiler_rt/mulXf3_test.zig b/lib/compiler_rt/mulXf3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/mulXf3_test.zig
rename to lib/compiler_rt/mulXf3_test.zig
diff --git a/lib/std/special/compiler_rt/muldi3.zig b/lib/compiler_rt/muldi3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/muldi3.zig
rename to lib/compiler_rt/muldi3.zig
diff --git a/lib/std/special/compiler_rt/muldi3_test.zig b/lib/compiler_rt/muldi3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/muldi3_test.zig
rename to lib/compiler_rt/muldi3_test.zig
diff --git a/lib/std/special/compiler_rt/mulo.zig b/lib/compiler_rt/mulo.zig
similarity index 100%
rename from lib/std/special/compiler_rt/mulo.zig
rename to lib/compiler_rt/mulo.zig
diff --git a/lib/std/special/compiler_rt/mulodi4_test.zig b/lib/compiler_rt/mulodi4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/mulodi4_test.zig
rename to lib/compiler_rt/mulodi4_test.zig
diff --git a/lib/std/special/compiler_rt/mulosi4_test.zig b/lib/compiler_rt/mulosi4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/mulosi4_test.zig
rename to lib/compiler_rt/mulosi4_test.zig
diff --git a/lib/std/special/compiler_rt/muloti4_test.zig b/lib/compiler_rt/muloti4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/muloti4_test.zig
rename to lib/compiler_rt/muloti4_test.zig
diff --git a/lib/std/special/compiler_rt/multi3.zig b/lib/compiler_rt/multi3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/multi3.zig
rename to lib/compiler_rt/multi3.zig
diff --git a/lib/std/special/compiler_rt/multi3_test.zig b/lib/compiler_rt/multi3_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/multi3_test.zig
rename to lib/compiler_rt/multi3_test.zig
diff --git a/lib/std/special/compiler_rt/negXf2.zig b/lib/compiler_rt/negXf2.zig
similarity index 100%
rename from lib/std/special/compiler_rt/negXf2.zig
rename to lib/compiler_rt/negXf2.zig
diff --git a/lib/std/special/compiler_rt/negXi2.zig b/lib/compiler_rt/negXi2.zig
similarity index 100%
rename from lib/std/special/compiler_rt/negXi2.zig
rename to lib/compiler_rt/negXi2.zig
diff --git a/lib/std/special/compiler_rt/negdi2_test.zig b/lib/compiler_rt/negdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/negdi2_test.zig
rename to lib/compiler_rt/negdi2_test.zig
diff --git a/lib/std/special/compiler_rt/negsi2_test.zig b/lib/compiler_rt/negsi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/negsi2_test.zig
rename to lib/compiler_rt/negsi2_test.zig
diff --git a/lib/std/special/compiler_rt/negti2_test.zig b/lib/compiler_rt/negti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/negti2_test.zig
rename to lib/compiler_rt/negti2_test.zig
diff --git a/lib/std/special/compiler_rt/negv.zig b/lib/compiler_rt/negv.zig
similarity index 100%
rename from lib/std/special/compiler_rt/negv.zig
rename to lib/compiler_rt/negv.zig
diff --git a/lib/std/special/compiler_rt/negvdi2_test.zig b/lib/compiler_rt/negvdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/negvdi2_test.zig
rename to lib/compiler_rt/negvdi2_test.zig
diff --git a/lib/std/special/compiler_rt/negvsi2_test.zig b/lib/compiler_rt/negvsi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/negvsi2_test.zig
rename to lib/compiler_rt/negvsi2_test.zig
diff --git a/lib/std/special/compiler_rt/negvti2_test.zig b/lib/compiler_rt/negvti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/negvti2_test.zig
rename to lib/compiler_rt/negvti2_test.zig
diff --git a/lib/std/special/compiler_rt/os_version_check.zig b/lib/compiler_rt/os_version_check.zig
similarity index 100%
rename from lib/std/special/compiler_rt/os_version_check.zig
rename to lib/compiler_rt/os_version_check.zig
diff --git a/lib/std/special/compiler_rt/parity.zig b/lib/compiler_rt/parity.zig
similarity index 100%
rename from lib/std/special/compiler_rt/parity.zig
rename to lib/compiler_rt/parity.zig
diff --git a/lib/std/special/compiler_rt/paritydi2_test.zig b/lib/compiler_rt/paritydi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/paritydi2_test.zig
rename to lib/compiler_rt/paritydi2_test.zig
diff --git a/lib/std/special/compiler_rt/paritysi2_test.zig b/lib/compiler_rt/paritysi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/paritysi2_test.zig
rename to lib/compiler_rt/paritysi2_test.zig
diff --git a/lib/std/special/compiler_rt/parityti2_test.zig b/lib/compiler_rt/parityti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/parityti2_test.zig
rename to lib/compiler_rt/parityti2_test.zig
diff --git a/lib/std/special/compiler_rt/popcount.zig b/lib/compiler_rt/popcount.zig
similarity index 100%
rename from lib/std/special/compiler_rt/popcount.zig
rename to lib/compiler_rt/popcount.zig
diff --git a/lib/std/special/compiler_rt/popcountdi2_test.zig b/lib/compiler_rt/popcountdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/popcountdi2_test.zig
rename to lib/compiler_rt/popcountdi2_test.zig
diff --git a/lib/std/special/compiler_rt/popcountsi2_test.zig b/lib/compiler_rt/popcountsi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/popcountsi2_test.zig
rename to lib/compiler_rt/popcountsi2_test.zig
diff --git a/lib/std/special/compiler_rt/popcountti2_test.zig b/lib/compiler_rt/popcountti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/popcountti2_test.zig
rename to lib/compiler_rt/popcountti2_test.zig
diff --git a/lib/std/special/compiler_rt/rem_pio2.zig b/lib/compiler_rt/rem_pio2.zig
similarity index 100%
rename from lib/std/special/compiler_rt/rem_pio2.zig
rename to lib/compiler_rt/rem_pio2.zig
diff --git a/lib/std/special/compiler_rt/rem_pio2_large.zig b/lib/compiler_rt/rem_pio2_large.zig
similarity index 100%
rename from lib/std/special/compiler_rt/rem_pio2_large.zig
rename to lib/compiler_rt/rem_pio2_large.zig
diff --git a/lib/std/special/compiler_rt/rem_pio2f.zig b/lib/compiler_rt/rem_pio2f.zig
similarity index 100%
rename from lib/std/special/compiler_rt/rem_pio2f.zig
rename to lib/compiler_rt/rem_pio2f.zig
diff --git a/lib/std/special/compiler_rt/round.zig b/lib/compiler_rt/round.zig
similarity index 100%
rename from lib/std/special/compiler_rt/round.zig
rename to lib/compiler_rt/round.zig
diff --git a/lib/std/special/compiler_rt/shift.zig b/lib/compiler_rt/shift.zig
similarity index 100%
rename from lib/std/special/compiler_rt/shift.zig
rename to lib/compiler_rt/shift.zig
diff --git a/lib/std/special/compiler_rt/sin.zig b/lib/compiler_rt/sin.zig
similarity index 100%
rename from lib/std/special/compiler_rt/sin.zig
rename to lib/compiler_rt/sin.zig
diff --git a/lib/std/special/compiler_rt/sincos.zig b/lib/compiler_rt/sincos.zig
similarity index 100%
rename from lib/std/special/compiler_rt/sincos.zig
rename to lib/compiler_rt/sincos.zig
diff --git a/lib/std/special/compiler_rt/sparc.zig b/lib/compiler_rt/sparc.zig
similarity index 100%
rename from lib/std/special/compiler_rt/sparc.zig
rename to lib/compiler_rt/sparc.zig
diff --git a/lib/std/special/compiler_rt/sqrt.zig b/lib/compiler_rt/sqrt.zig
similarity index 100%
rename from lib/std/special/compiler_rt/sqrt.zig
rename to lib/compiler_rt/sqrt.zig
diff --git a/lib/std/special/compiler_rt/stack_probe.zig b/lib/compiler_rt/stack_probe.zig
similarity index 100%
rename from lib/std/special/compiler_rt/stack_probe.zig
rename to lib/compiler_rt/stack_probe.zig
diff --git a/lib/std/special/compiler_rt/subo.zig b/lib/compiler_rt/subo.zig
similarity index 100%
rename from lib/std/special/compiler_rt/subo.zig
rename to lib/compiler_rt/subo.zig
diff --git a/lib/std/special/compiler_rt/subodi4_test.zig b/lib/compiler_rt/subodi4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/subodi4_test.zig
rename to lib/compiler_rt/subodi4_test.zig
diff --git a/lib/std/special/compiler_rt/subosi4_test.zig b/lib/compiler_rt/subosi4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/subosi4_test.zig
rename to lib/compiler_rt/subosi4_test.zig
diff --git a/lib/std/special/compiler_rt/suboti4_test.zig b/lib/compiler_rt/suboti4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/suboti4_test.zig
rename to lib/compiler_rt/suboti4_test.zig
diff --git a/lib/std/special/compiler_rt/tan.zig b/lib/compiler_rt/tan.zig
similarity index 100%
rename from lib/std/special/compiler_rt/tan.zig
rename to lib/compiler_rt/tan.zig
diff --git a/lib/std/special/compiler_rt/trig.zig b/lib/compiler_rt/trig.zig
similarity index 100%
rename from lib/std/special/compiler_rt/trig.zig
rename to lib/compiler_rt/trig.zig
diff --git a/lib/std/special/compiler_rt/trunc.zig b/lib/compiler_rt/trunc.zig
similarity index 100%
rename from lib/std/special/compiler_rt/trunc.zig
rename to lib/compiler_rt/trunc.zig
diff --git a/lib/std/special/compiler_rt/truncXfYf2.zig b/lib/compiler_rt/truncXfYf2.zig
similarity index 100%
rename from lib/std/special/compiler_rt/truncXfYf2.zig
rename to lib/compiler_rt/truncXfYf2.zig
diff --git a/lib/std/special/compiler_rt/truncXfYf2_test.zig b/lib/compiler_rt/truncXfYf2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/truncXfYf2_test.zig
rename to lib/compiler_rt/truncXfYf2_test.zig
diff --git a/lib/std/special/compiler_rt/trunc_f80.zig b/lib/compiler_rt/trunc_f80.zig
similarity index 100%
rename from lib/std/special/compiler_rt/trunc_f80.zig
rename to lib/compiler_rt/trunc_f80.zig
diff --git a/lib/std/special/compiler_rt/ucmpdi2_test.zig b/lib/compiler_rt/ucmpdi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ucmpdi2_test.zig
rename to lib/compiler_rt/ucmpdi2_test.zig
diff --git a/lib/std/special/compiler_rt/ucmpsi2_test.zig b/lib/compiler_rt/ucmpsi2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ucmpsi2_test.zig
rename to lib/compiler_rt/ucmpsi2_test.zig
diff --git a/lib/std/special/compiler_rt/ucmpti2_test.zig b/lib/compiler_rt/ucmpti2_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/ucmpti2_test.zig
rename to lib/compiler_rt/ucmpti2_test.zig
diff --git a/lib/std/special/compiler_rt/udivmod.zig b/lib/compiler_rt/udivmod.zig
similarity index 100%
rename from lib/std/special/compiler_rt/udivmod.zig
rename to lib/compiler_rt/udivmod.zig
diff --git a/lib/std/special/compiler_rt/udivmoddi4_test.zig b/lib/compiler_rt/udivmoddi4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/udivmoddi4_test.zig
rename to lib/compiler_rt/udivmoddi4_test.zig
diff --git a/lib/std/special/compiler_rt/udivmodti4.zig b/lib/compiler_rt/udivmodti4.zig
similarity index 100%
rename from lib/std/special/compiler_rt/udivmodti4.zig
rename to lib/compiler_rt/udivmodti4.zig
diff --git a/lib/std/special/compiler_rt/udivmodti4_test.zig b/lib/compiler_rt/udivmodti4_test.zig
similarity index 100%
rename from lib/std/special/compiler_rt/udivmodti4_test.zig
rename to lib/compiler_rt/udivmodti4_test.zig
diff --git a/lib/std/special/compiler_rt/udivti3.zig b/lib/compiler_rt/udivti3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/udivti3.zig
rename to lib/compiler_rt/udivti3.zig
diff --git a/lib/std/special/compiler_rt/umodti3.zig b/lib/compiler_rt/umodti3.zig
similarity index 100%
rename from lib/std/special/compiler_rt/umodti3.zig
rename to lib/compiler_rt/umodti3.zig
diff --git a/lib/std/special/docs/index.html b/lib/docs/index.html
similarity index 100%
rename from lib/std/special/docs/index.html
rename to lib/docs/index.html
diff --git a/lib/std/special/docs/main.js b/lib/docs/main.js
similarity index 100%
rename from lib/std/special/docs/main.js
rename to lib/docs/main.js
diff --git a/lib/std/special/init-exe/build.zig b/lib/init-exe/build.zig
similarity index 100%
rename from lib/std/special/init-exe/build.zig
rename to lib/init-exe/build.zig
diff --git a/lib/std/special/init-exe/src/main.zig b/lib/init-exe/src/main.zig
similarity index 100%
rename from lib/std/special/init-exe/src/main.zig
rename to lib/init-exe/src/main.zig
diff --git a/lib/std/special/init-lib/build.zig b/lib/init-lib/build.zig
similarity index 100%
rename from lib/std/special/init-lib/build.zig
rename to lib/init-lib/build.zig
diff --git a/lib/std/special/init-lib/src/main.zig b/lib/init-lib/src/main.zig
similarity index 100%
rename from lib/std/special/init-lib/src/main.zig
rename to lib/init-lib/src/main.zig
diff --git a/lib/std/special/ssp.zig b/lib/ssp.zig
similarity index 100%
rename from lib/std/special/ssp.zig
rename to lib/ssp.zig
diff --git a/lib/std/build.zig b/lib/std/build.zig
index 38744cea1eabe4c486d4ffdc0f24c30de8b5d646..fcc349a62baf9e31bdcd8a18bd241995a34623d7 100644
--- a/lib/std/build.zig
+++ b/lib/std/build.zig
@@ -229,7 +229,7 @@ pub const Builder = struct {
self.allocator.destroy(self);
}
- /// This function is intended to be called by std/special/build_runner.zig, not a build.zig file.
+ /// This function is intended to be called by lib/build_runner.zig, not a build.zig file.
pub fn resolveInstallPrefix(self: *Builder, install_prefix: ?[]const u8, dir_list: DirList) void {
if (self.dest_dir) |dest_dir| {
self.install_prefix = install_prefix orelse "/usr";
diff --git a/lib/std/special/test_runner.zig b/lib/test_runner.zig
similarity index 100%
rename from lib/std/special/test_runner.zig
rename to lib/test_runner.zig
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 3f4d8d697644087a3121dd2ab0423b99a9f0a297..91262898046e899f319db37d61217db26f3503f3 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1352,7 +1352,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
const test_pkg = try Package.createWithDir(
gpa,
options.zig_lib_directory,
- "std" ++ std.fs.path.sep_str ++ "special",
+ null,
"test_runner.zig",
);
errdefer test_pkg.destroy(gpa);
@@ -1382,6 +1382,20 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
try builtin_pkg.add(gpa, "std", std_pkg);
try builtin_pkg.add(gpa, "builtin", builtin_pkg);
+ const main_pkg_in_std = m: {
+ const std_path = try std.fs.path.resolve(arena, &[_][]const u8{
+ std_pkg.root_src_directory.path orelse ".",
+ std.fs.path.dirname(std_pkg.root_src_path) orelse ".",
+ });
+ defer arena.free(std_path);
+ const main_path = try std.fs.path.resolve(arena, &[_][]const u8{
+ main_pkg.root_src_directory.path orelse ".",
+ main_pkg.root_src_path,
+ });
+ defer arena.free(main_path);
+ break :m mem.startsWith(u8, main_path, std_path);
+ };
+
// Pre-open the directory handles for cached ZIR code so that it does not need
// to redundantly happen for each AstGen operation.
const zir_sub_dir = "z";
@@ -1418,15 +1432,15 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
.gpa = gpa,
.comp = comp,
.main_pkg = main_pkg,
- .main_pkg_is_std = try main_pkg.isInsideOf(std_pkg.*),
+ .main_pkg_in_std = main_pkg_in_std,
.root_pkg = root_pkg,
.zig_cache_artifact_directory = zig_cache_artifact_directory,
.global_zir_cache = global_zir_cache,
.local_zir_cache = local_zir_cache,
.emit_h = emit_h,
- .error_name_list = try std.ArrayListUnmanaged([]const u8).initCapacity(gpa, 1),
+ .error_name_list = .{},
};
- module.error_name_list.appendAssumeCapacity("(no error)");
+ try module.error_name_list.append(gpa, "(no error)");
break :blk module;
} else blk: {
@@ -4780,18 +4794,9 @@ fn buildOutputFromZig(
defer tracy_trace.end();
std.debug.assert(output_mode != .Exe);
- const special_sub = "std" ++ std.fs.path.sep_str ++ "special";
- const special_path = try comp.zig_lib_directory.join(comp.gpa, &[_][]const u8{special_sub});
- defer comp.gpa.free(special_path);
-
- var special_dir = try comp.zig_lib_directory.handle.openDir(special_sub, .{});
- defer special_dir.close();
var main_pkg: Package = .{
- .root_src_directory = .{
- .path = special_path,
- .handle = special_dir,
- },
+ .root_src_directory = comp.zig_lib_directory,
.root_src_path = src_basename,
};
defer main_pkg.deinitTable(comp.gpa);
diff --git a/src/Module.zig b/src/Module.zig
index 0966c8ffcf82b33e8c9534e8f7abd886cd87410d..de29753b13637b7ed662a5db8f6c738eec5c48a8 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -112,7 +112,7 @@ global_error_set: std.StringHashMapUnmanaged(ErrorInt) = .{},
/// ErrorInt -> []const u8 for fast lookups for @intToError at comptime
/// Corresponds with `global_error_set`.
-error_name_list: ArrayListUnmanaged([]const u8) = .{},
+error_name_list: ArrayListUnmanaged([]const u8),
/// Incrementing integer used to compare against the corresponding Decl
/// field to determine whether a Decl's status applies to an ongoing update, or a
@@ -133,7 +133,7 @@ job_queued_update_builtin_zig: bool = true,
/// This makes it so that we can run `zig test` on the standard library.
/// Otherwise, the logic for scanning test decls skips all of them because
/// `main_pkg != std_pkg`.
-main_pkg_is_std: bool,
+main_pkg_in_std: bool,
compile_log_text: ArrayListUnmanaged(u8) = .{},
@@ -4533,7 +4533,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi
// the test name filter.
if (!mod.comp.bin_file.options.is_test) break :blk false;
if (decl_pkg != mod.main_pkg) {
- if (!mod.main_pkg_is_std) break :blk false;
+ if (!mod.main_pkg_in_std) break :blk false;
const std_pkg = mod.main_pkg.table.get("std").?;
if (std_pkg != decl_pkg) break :blk false;
}
@@ -4544,7 +4544,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi
if (!is_named_test) break :blk false;
if (!mod.comp.bin_file.options.is_test) break :blk false;
if (decl_pkg != mod.main_pkg) {
- if (!mod.main_pkg_is_std) break :blk false;
+ if (!mod.main_pkg_in_std) break :blk false;
const std_pkg = mod.main_pkg.table.get("std").?;
if (std_pkg != decl_pkg) break :blk false;
}
diff --git a/src/Package.zig b/src/Package.zig
index 9ac1e2e5b1a3591f56cfbdbb08a311a83a9f6d1e..df894280a99c6c59a653cdd3f133ad34467f753b 100644
--- a/src/Package.zig
+++ b/src/Package.zig
@@ -124,11 +124,3 @@ pub fn addAndAdopt(parent: *Package, gpa: Allocator, name: []const u8, child: *P
child.parent = parent;
return parent.add(gpa, name, child);
}
-
-pub fn isInsideOf(pkg: Package, another: Package) !bool {
- var pkg_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;
- var another_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;
- const pkg_path = try pkg.root_src_directory.handle.realpath(pkg.root_src_path, &pkg_buffer);
- const another_path = try another.root_src_directory.handle.realpath(".", &another_buffer);
- return mem.startsWith(u8, pkg_path, another_path);
-}
diff --git a/src/main.zig b/src/main.zig
index 9487f2e962efa7f526995c699b8d8fe77727f8af..58c614c76efd38d717639b2b090a6f0328b0b688 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -3421,8 +3421,8 @@ pub fn cmdInit(
const s = fs.path.sep_str;
const template_sub_path = switch (output_mode) {
.Obj => unreachable,
- .Lib => "std" ++ s ++ "special" ++ s ++ "init-lib",
- .Exe => "std" ++ s ++ "special" ++ s ++ "init-exe",
+ .Lib => "init-lib",
+ .Exe => "init-exe",
};
var template_dir = zig_lib_directory.handle.openDir(template_sub_path, .{}) catch |err| {
fatal("unable to open zig project template directory '{s}{s}{s}': {s}", .{ zig_lib_directory.path, s, template_sub_path, @errorName(err) });
@@ -3571,19 +3571,10 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
};
defer zig_lib_directory.handle.close();
- const std_special = "std" ++ fs.path.sep_str ++ "special";
- const special_dir_path = try zig_lib_directory.join(arena, &[_][]const u8{std_special});
-
var main_pkg: Package = .{
- .root_src_directory = .{
- .path = special_dir_path,
- .handle = zig_lib_directory.handle.openDir(std_special, .{}) catch |err| {
- fatal("unable to open directory '{s}{s}{s}': {s}", .{ override_lib_dir, fs.path.sep_str, std_special, @errorName(err) });
- },
- },
+ .root_src_directory = zig_lib_directory,
.root_src_path = "build_runner.zig",
};
- defer main_pkg.root_src_directory.handle.close();
var cleanup_build_dir: ?fs.Dir = null;
defer if (cleanup_build_dir) |*dir| dir.close();
diff --git a/src/stage1/all_types.hpp b/src/stage1/all_types.hpp
index 398693e6d81314b1daac2873a26abd18ebbb68dc..fbf0793d682118b6d1757489e92e19117e252b50 100644
--- a/src/stage1/all_types.hpp
+++ b/src/stage1/all_types.hpp
@@ -2144,7 +2144,6 @@ struct CodeGen {
Buf docs_output_path;
Buf *builtin_zig_path;
- Buf *zig_std_special_dir; // Cannot be overridden; derived from zig_lib_dir.
Stage1ZirInst *invalid_inst_src;
Stage1AirInst *invalid_inst_gen;
diff --git a/src/stage1/codegen.cpp b/src/stage1/codegen.cpp
index 9d46a660bcab001dc426a286466c06956824d019..03bd22b42dd2226d1d97bd2e5b63489a42dedd83 100644
--- a/src/stage1/codegen.cpp
+++ b/src/stage1/codegen.cpp
@@ -10088,7 +10088,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
}
static ZigPackage *create_test_runner_pkg(CodeGen *g) {
- return codegen_create_package(g, buf_ptr(g->zig_std_special_dir), "test_runner.zig", "std.special");
+ return codegen_create_package(g, buf_ptr(g->zig_lib_dir), "test_runner.zig", "");
}
static Error define_builtin_compile_vars(CodeGen *g) {
@@ -10141,12 +10141,17 @@ static Error define_builtin_compile_vars(CodeGen *g) {
} else {
g->root_pkg = g->main_pkg;
}
+
+ ZigPackage *compiler_rt_pkg = codegen_create_package(g, buf_ptr(g->zig_lib_dir),
+ "compiler_rt.zig", "compiler_rt");
+
g->compile_var_package->package_table.put(buf_create_from_str("std"), g->std_package);
g->main_pkg->package_table.put(buf_create_from_str("builtin"), g->compile_var_package);
g->main_pkg->package_table.put(buf_create_from_str("root"), g->root_pkg);
g->std_package->package_table.put(buf_create_from_str("builtin"), g->compile_var_package);
g->std_package->package_table.put(buf_create_from_str("std"), g->std_package);
g->std_package->package_table.put(buf_create_from_str("root"), g->root_pkg);
+ g->std_package->package_table.put(buf_create_from_str("compiler_rt"), compiler_rt_pkg);
g->compile_var_import = add_source_file(g, g->compile_var_package, g->builtin_zig_path, contents,
SourceKindPkgMain);
@@ -10454,11 +10459,11 @@ static void gen_root_source(CodeGen *g) {
Buf *import_target_path;
Buf full_path = BUF_INIT;
ZigType *compiler_rt_import;
- if ((err = analyze_import(g, std_import, buf_create_from_str("./special/compiler_rt.zig"),
+ if ((err = analyze_import(g, std_import, buf_create_from_str("compiler_rt"),
&compiler_rt_import, &import_target_path, &full_path)))
{
if (err == ErrorFileNotFound) {
- fprintf(stderr, "unable to find '%s'", buf_ptr(import_target_path));
+ fprintf(stderr, "unable to find '%s'\n", buf_ptr(import_target_path));
} else {
fprintf(stderr, "unable to open '%s': %s\n", buf_ptr(&full_path), err_str(err));
}
@@ -10538,11 +10543,11 @@ void codegen_build_object(CodeGen *g) {
fprintf(stderr, "Unable to create directory %s: %s\n", buf_ptr(doc_dir_path), err_str(err));
exit(1);
}
- Buf *index_html_src_path = buf_sprintf("%s" OS_SEP "special" OS_SEP "docs" OS_SEP "index.html",
- buf_ptr(g->zig_std_dir));
+ Buf *index_html_src_path = buf_sprintf("%s" OS_SEP "docs" OS_SEP "index.html",
+ buf_ptr(g->zig_lib_dir));
Buf *index_html_dest_path = buf_sprintf("%s" OS_SEP "index.html", buf_ptr(doc_dir_path));
- Buf *main_js_src_path = buf_sprintf("%s" OS_SEP "special" OS_SEP "docs" OS_SEP "main.js",
- buf_ptr(g->zig_std_dir));
+ Buf *main_js_src_path = buf_sprintf("%s" OS_SEP "docs" OS_SEP "main.js",
+ buf_ptr(g->zig_lib_dir));
Buf *main_js_dest_path = buf_sprintf("%s" OS_SEP "main.js", buf_ptr(doc_dir_path));
if ((err = os_copy_file(index_html_src_path, index_html_dest_path))) {
@@ -10702,9 +10707,6 @@ CodeGen *codegen_create(Buf *main_pkg_path, Buf *root_src_path, const ZigTarget
g->main_pkg = new_package(".", "", "");
}
- g->zig_std_special_dir = buf_alloc();
- os_path_join(g->zig_std_dir, buf_sprintf("special"), g->zig_std_special_dir);
-
target_triple_llvm(&g->llvm_triple_str, g->zig_target);
g->pointer_size_bytes = target_arch_pointer_bit_width(g->zig_target->arch) / 8;
--
2.54.0