diff --git a/src-self-hosted/libc_installation.zig b/src-self-hosted/libc_installation.zig index 0f9736456a0ef408041a8bf86a174d3eeec0dba7..c07ef03b5175b690a16bf54d319f7b031bbe5d1f 100644 --- a/src-self-hosted/libc_installation.zig +++ b/src-self-hosted/libc_installation.zig @@ -17,7 +17,6 @@ pub const LibCInstallation = struct { include_dir: ?[:0]const u8 = null, sys_include_dir: ?[:0]const u8 = null, crt_dir: ?[:0]const u8 = null, - static_crt_dir: ?[:0]const u8 = null, msvc_lib_dir: ?[:0]const u8 = null, kernel32_lib_dir: ?[:0]const u8 = null, @@ -98,13 +97,6 @@ pub const LibCInstallation = struct { try stderr.print("crt_dir may not be empty for {}\n", .{@tagName(Target.current.os.tag)}); return error.ParseError; } - if (self.static_crt_dir == null and is_windows and is_gnu) { - try stderr.print("static_crt_dir may not be empty for {}-{}\n", .{ - @tagName(Target.current.os.tag), - @tagName(Target.current.abi), - }); - return error.ParseError; - } if (self.msvc_lib_dir == null and is_windows and !is_gnu) { try stderr.print("msvc_lib_dir may not be empty for {}-{}\n", .{ @tagName(Target.current.os.tag), @@ -128,7 +120,6 @@ pub const LibCInstallation = struct { const include_dir = self.include_dir orelse ""; const sys_include_dir = self.sys_include_dir orelse ""; const crt_dir = self.crt_dir orelse ""; - const static_crt_dir = self.static_crt_dir orelse ""; const msvc_lib_dir = self.msvc_lib_dir orelse ""; const kernel32_lib_dir = self.kernel32_lib_dir orelse ""; @@ -147,11 +138,6 @@ pub const LibCInstallation = struct { \\# Not needed when targeting MacOS. \\crt_dir={} \\ - \\# The directory that contains `crtbegin.o`. - \\# On POSIX, can be found with `cc -print-file-name=crtbegin.o`. - \\# Only needed when targeting MinGW-w64 on Windows. - \\static_crt_dir={} - \\ \\# The directory that contains `vcruntime.lib`. \\# Only needed when targeting MSVC on Windows. \\msvc_lib_dir={} @@ -164,7 +150,6 @@ pub const LibCInstallation = struct { include_dir, sys_include_dir, crt_dir, - static_crt_dir, msvc_lib_dir, kernel32_lib_dir, }); @@ -186,7 +171,6 @@ pub const LibCInstallation = struct { var batch = Batch(FindError!void, 3, .auto_async).init(); batch.add(&async self.findNativeIncludeDirPosix(args)); batch.add(&async self.findNativeCrtDirPosix(args)); - batch.add(&async self.findNativeStaticCrtDirPosix(args)); try batch.wait(); } else { var sdk: *ZigWindowsSDK = undefined; @@ -428,15 +412,6 @@ pub const LibCInstallation = struct { }); } - fn findNativeStaticCrtDirPosix(self: *LibCInstallation, args: FindNativeOptions) FindError!void { - self.static_crt_dir = try ccPrintFileName(.{ - .allocator = args.allocator, - .search_basename = "crtbegin.o", - .want_dirname = .only_dir, - .verbose = args.verbose, - }); - } - fn findNativeKernel32LibDir( self: *LibCInstallation, args: FindNativeOptions, diff --git a/src-self-hosted/stage2.zig b/src-self-hosted/stage2.zig index 36941cc3a13830eac7ff13c3c09fd0533470f03a..b355f8f02a7d47d7a10a2f27f1b2fe2c52a42cfa 100644 --- a/src-self-hosted/stage2.zig +++ b/src-self-hosted/stage2.zig @@ -744,8 +744,6 @@ const Stage2LibCInstallation = extern struct { sys_include_dir_len: usize, crt_dir: [*:0]const u8, crt_dir_len: usize, - static_crt_dir: [*:0]const u8, - static_crt_dir_len: usize, msvc_lib_dir: [*:0]const u8, msvc_lib_dir_len: usize, kernel32_lib_dir: [*:0]const u8, @@ -773,13 +771,6 @@ const Stage2LibCInstallation = extern struct { self.crt_dir = ""; self.crt_dir_len = 0; } - if (libc.static_crt_dir) |s| { - self.static_crt_dir = s.ptr; - self.static_crt_dir_len = s.len; - } else { - self.static_crt_dir = ""; - self.static_crt_dir_len = 0; - } if (libc.msvc_lib_dir) |s| { self.msvc_lib_dir = s.ptr; self.msvc_lib_dir_len = s.len; @@ -807,9 +798,6 @@ const Stage2LibCInstallation = extern struct { if (self.crt_dir_len != 0) { libc.crt_dir = self.crt_dir[0..self.crt_dir_len :0]; } - if (self.static_crt_dir_len != 0) { - libc.static_crt_dir = self.static_crt_dir[0..self.static_crt_dir_len :0]; - } if (self.msvc_lib_dir_len != 0) { libc.msvc_lib_dir = self.msvc_lib_dir[0..self.msvc_lib_dir_len :0]; } diff --git a/src/stage2.cpp b/src/stage2.cpp index 7495ffddb9940af270596e0a93f45335434a573a..a8d8b7cf971fb0ae98f1df66f969ea85af043e42 100644 --- a/src/stage2.cpp +++ b/src/stage2.cpp @@ -272,8 +272,6 @@ enum Error stage2_libc_parse(struct Stage2LibCInstallation *libc, const char *li libc->sys_include_dir_len = strlen(libc->sys_include_dir); libc->crt_dir = ""; libc->crt_dir_len = strlen(libc->crt_dir); - libc->static_crt_dir = ""; - libc->static_crt_dir_len = strlen(libc->static_crt_dir); libc->msvc_lib_dir = ""; libc->msvc_lib_dir_len = strlen(libc->msvc_lib_dir); libc->kernel32_lib_dir = ""; diff --git a/src/stage2.h b/src/stage2.h index 50f891dca983becc4b111497afde7ccaebaee146..24fd664b3cbaabe3d71de5c1e8b58b70f9e7205a 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -209,8 +209,6 @@ struct Stage2LibCInstallation { size_t sys_include_dir_len; const char *crt_dir; size_t crt_dir_len; - const char *static_crt_dir; - size_t static_crt_dir_len; const char *msvc_lib_dir; size_t msvc_lib_dir_len; const char *kernel32_lib_dir;