authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-01 19:22:03-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-01 19:22:03-05:00
log4af5c3867487b10bdfdb35fba79442f5cc860da1
treef81556784944dab181760082d8ac4f8ed33cc990
parent080316cd4f9a20fb4cf493ee071f672416b5864c
signaturelock-open Commit is signed but in an unrecognized format.

fixes for self-hosted compiler


4 files changed, 13 insertions(+), 13 deletions(-)

lib/std/event/fs.zig+1-1
......@@ -695,7 +695,7 @@ pub fn readFile(allocator: *Allocator, file_path: []const u8, max_size: usize) !
695695 try list.ensureCapacity(list.len + mem.page_size);
696696 const buf = list.items[list.len..];
697697 const buf_array = [_][]u8{buf};
698 const amt = try preadv(allocator, fd, buf_array, list.len);
698 const amt = try preadv(allocator, fd, &buf_array, list.len);
699699 list.len += amt;
700700 if (list.len > max_size) {
701701 return error.FileTooBig;
src-self-hosted/compilation.zig+10-10
......@@ -148,13 +148,13 @@ pub const Compilation = struct {
148148 is_static: bool,
149149 linker_rdynamic: bool = false,
150150
151 clang_argv: []const []const u8 = [_][]const u8{},
152 lib_dirs: []const []const u8 = [_][]const u8{},
153 rpath_list: []const []const u8 = [_][]const u8{},
154 assembly_files: []const []const u8 = [_][]const u8{},
151 clang_argv: []const []const u8 = &[_][]const u8{},
152 lib_dirs: []const []const u8 = &[_][]const u8{},
153 rpath_list: []const []const u8 = &[_][]const u8{},
154 assembly_files: []const []const u8 = &[_][]const u8{},
155155
156156 /// paths that are explicitly provided by the user to link against
157 link_objects: []const []const u8 = [_][]const u8{},
157 link_objects: []const []const u8 = &[_][]const u8{},
158158
159159 /// functions that have their own objects that we need to link
160160 /// it uses an optional pointer so that tombstone removals are possible
......@@ -178,10 +178,10 @@ pub const Compilation = struct {
178178 verbose_llvm_ir: bool = false,
179179 verbose_link: bool = false,
180180
181 darwin_frameworks: []const []const u8 = [_][]const u8{},
181 darwin_frameworks: []const []const u8 = &[_][]const u8{},
182182 darwin_version_min: DarwinVersionMin = .None,
183183
184 test_filters: []const []const u8 = [_][]const u8{},
184 test_filters: []const []const u8 = &[_][]const u8{},
185185 test_name_prefix: ?[]const u8 = null,
186186
187187 emit_file_type: Emit = .Binary,
......@@ -1165,7 +1165,7 @@ pub const Compilation = struct {
11651165 const file_name = try std.fmt.allocPrint(self.gpa(), "{}{}", file_prefix[0..], suffix);
11661166 defer self.gpa().free(file_name);
11671167
1168 const full_path = try std.fs.path.join(self.gpa(), [_][]const u8{ tmp_dir, file_name[0..] });
1168 const full_path = try std.fs.path.join(self.gpa(), &[_][]const u8{ tmp_dir, file_name[0..] });
11691169 errdefer self.gpa().free(full_path);
11701170
11711171 return Buffer.fromOwnedSlice(self.gpa(), full_path);
......@@ -1186,7 +1186,7 @@ pub const Compilation = struct {
11861186 const zig_dir_path = try getZigDir(self.gpa());
11871187 defer self.gpa().free(zig_dir_path);
11881188
1189 const tmp_dir = try std.fs.path.join(self.arena(), [_][]const u8{ zig_dir_path, comp_dir_name[0..] });
1189 const tmp_dir = try std.fs.path.join(self.arena(), &[_][]const u8{ zig_dir_path, comp_dir_name[0..] });
11901190 try std.fs.makePath(self.gpa(), tmp_dir);
11911191 return tmp_dir;
11921192 }
......@@ -1208,7 +1208,7 @@ pub const Compilation = struct {
12081208 }
12091209
12101210 var result: [12]u8 = undefined;
1211 b64_fs_encoder.encode(result[0..], rand_bytes);
1211 b64_fs_encoder.encode(result[0..], &rand_bytes);
12121212 return result;
12131213 }
12141214
src-self-hosted/link.zig+1-1
......@@ -314,7 +314,7 @@ fn constructLinkerArgsElf(ctx: *Context) !void {
314314}
315315
316316fn addPathJoin(ctx: *Context, dirname: []const u8, basename: []const u8) !void {
317 const full_path = try std.fs.path.join(&ctx.arena.allocator, [_][]const u8{ dirname, basename });
317 const full_path = try std.fs.path.join(&ctx.arena.allocator, &[_][]const u8{ dirname, basename });
318318 const full_path_with_null = try std.cstr.addNullByte(&ctx.arena.allocator, full_path);
319319 try ctx.args.append(@ptrCast([*:0]const u8, full_path_with_null.ptr));
320320}
src-self-hosted/main.zig+1-1
......@@ -709,7 +709,7 @@ async fn fmtPath(fmt: *Fmt, file_path_ref: []const u8, check_mode: bool) FmtErro
709709 var it = dir.iterate();
710710 while (try it.next()) |entry| {
711711 if (entry.kind == .Directory or mem.endsWith(u8, entry.name, ".zig")) {
712 const full_path = try fs.path.join(fmt.allocator, [_][]const u8{ file_path, entry.name });
712 const full_path = try fs.path.join(fmt.allocator, &[_][]const u8{ file_path, entry.name });
713713 @panic("TODO https://github.com/ziglang/zig/issues/3777");
714714 // try group.call(fmtPath, fmt, full_path, check_mode);
715715 }