authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2020-03-13 00:55:52+11:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-12 12:27:45-04:00
log8a22c50c081e4495216ef961a9c1f2db6fbac916
tree420f449a2e1dab2d33f85b649428c11ca70cccf7
parent214af69814b3940236ace44ada0243726d29debf

Remove unused static_crt_dir field from libc config


4 files changed, 0 insertions(+), 41 deletions(-)

src-self-hosted/libc_installation.zig-25
...@@ -17,7 +17,6 @@ pub const LibCInstallation = struct {...@@ -17,7 +17,6 @@ pub const LibCInstallation = struct {
17 include_dir: ?[:0]const u8 = null,17 include_dir: ?[:0]const u8 = null,
18 sys_include_dir: ?[:0]const u8 = null,18 sys_include_dir: ?[:0]const u8 = null,
19 crt_dir: ?[:0]const u8 = null,19 crt_dir: ?[:0]const u8 = null,
20 static_crt_dir: ?[:0]const u8 = null,
21 msvc_lib_dir: ?[:0]const u8 = null,20 msvc_lib_dir: ?[:0]const u8 = null,
22 kernel32_lib_dir: ?[:0]const u8 = null,21 kernel32_lib_dir: ?[:0]const u8 = null,
2322
...@@ -98,13 +97,6 @@ pub const LibCInstallation = struct {...@@ -98,13 +97,6 @@ pub const LibCInstallation = struct {
98 try stderr.print("crt_dir may not be empty for {}\n", .{@tagName(Target.current.os.tag)});97 try stderr.print("crt_dir may not be empty for {}\n", .{@tagName(Target.current.os.tag)});
99 return error.ParseError;98 return error.ParseError;
100 }99 }
101 if (self.static_crt_dir == null and is_windows and is_gnu) {
102 try stderr.print("static_crt_dir may not be empty for {}-{}\n", .{
103 @tagName(Target.current.os.tag),
104 @tagName(Target.current.abi),
105 });
106 return error.ParseError;
107 }
108 if (self.msvc_lib_dir == null and is_windows and !is_gnu) {100 if (self.msvc_lib_dir == null and is_windows and !is_gnu) {
109 try stderr.print("msvc_lib_dir may not be empty for {}-{}\n", .{101 try stderr.print("msvc_lib_dir may not be empty for {}-{}\n", .{
110 @tagName(Target.current.os.tag),102 @tagName(Target.current.os.tag),
...@@ -128,7 +120,6 @@ pub const LibCInstallation = struct {...@@ -128,7 +120,6 @@ pub const LibCInstallation = struct {
128 const include_dir = self.include_dir orelse "";120 const include_dir = self.include_dir orelse "";
129 const sys_include_dir = self.sys_include_dir orelse "";121 const sys_include_dir = self.sys_include_dir orelse "";
130 const crt_dir = self.crt_dir orelse "";122 const crt_dir = self.crt_dir orelse "";
131 const static_crt_dir = self.static_crt_dir orelse "";
132 const msvc_lib_dir = self.msvc_lib_dir orelse "";123 const msvc_lib_dir = self.msvc_lib_dir orelse "";
133 const kernel32_lib_dir = self.kernel32_lib_dir orelse "";124 const kernel32_lib_dir = self.kernel32_lib_dir orelse "";
134125
...@@ -147,11 +138,6 @@ pub const LibCInstallation = struct {...@@ -147,11 +138,6 @@ pub const LibCInstallation = struct {
147 \\# Not needed when targeting MacOS.138 \\# Not needed when targeting MacOS.
148 \\crt_dir={}139 \\crt_dir={}
149 \\140 \\
150 \\# The directory that contains `crtbegin.o`.
151 \\# On POSIX, can be found with `cc -print-file-name=crtbegin.o`.
152 \\# Only needed when targeting MinGW-w64 on Windows.
153 \\static_crt_dir={}
154 \\
155 \\# The directory that contains `vcruntime.lib`.141 \\# The directory that contains `vcruntime.lib`.
156 \\# Only needed when targeting MSVC on Windows.142 \\# Only needed when targeting MSVC on Windows.
157 \\msvc_lib_dir={}143 \\msvc_lib_dir={}
...@@ -164,7 +150,6 @@ pub const LibCInstallation = struct {...@@ -164,7 +150,6 @@ pub const LibCInstallation = struct {
164 include_dir,150 include_dir,
165 sys_include_dir,151 sys_include_dir,
166 crt_dir,152 crt_dir,
167 static_crt_dir,
168 msvc_lib_dir,153 msvc_lib_dir,
169 kernel32_lib_dir,154 kernel32_lib_dir,
170 });155 });
...@@ -186,7 +171,6 @@ pub const LibCInstallation = struct {...@@ -186,7 +171,6 @@ pub const LibCInstallation = struct {
186 var batch = Batch(FindError!void, 3, .auto_async).init();171 var batch = Batch(FindError!void, 3, .auto_async).init();
187 batch.add(&async self.findNativeIncludeDirPosix(args));172 batch.add(&async self.findNativeIncludeDirPosix(args));
188 batch.add(&async self.findNativeCrtDirPosix(args));173 batch.add(&async self.findNativeCrtDirPosix(args));
189 batch.add(&async self.findNativeStaticCrtDirPosix(args));
190 try batch.wait();174 try batch.wait();
191 } else {175 } else {
192 var sdk: *ZigWindowsSDK = undefined;176 var sdk: *ZigWindowsSDK = undefined;
...@@ -428,15 +412,6 @@ pub const LibCInstallation = struct {...@@ -428,15 +412,6 @@ pub const LibCInstallation = struct {
428 });412 });
429 }413 }
430414
431 fn findNativeStaticCrtDirPosix(self: *LibCInstallation, args: FindNativeOptions) FindError!void {
432 self.static_crt_dir = try ccPrintFileName(.{
433 .allocator = args.allocator,
434 .search_basename = "crtbegin.o",
435 .want_dirname = .only_dir,
436 .verbose = args.verbose,
437 });
438 }
439
440 fn findNativeKernel32LibDir(415 fn findNativeKernel32LibDir(
441 self: *LibCInstallation,416 self: *LibCInstallation,
442 args: FindNativeOptions,417 args: FindNativeOptions,
src-self-hosted/stage2.zig-12
...@@ -744,8 +744,6 @@ const Stage2LibCInstallation = extern struct {...@@ -744,8 +744,6 @@ const Stage2LibCInstallation = extern struct {
744 sys_include_dir_len: usize,744 sys_include_dir_len: usize,
745 crt_dir: [*:0]const u8,745 crt_dir: [*:0]const u8,
746 crt_dir_len: usize,746 crt_dir_len: usize,
747 static_crt_dir: [*:0]const u8,
748 static_crt_dir_len: usize,
749 msvc_lib_dir: [*:0]const u8,747 msvc_lib_dir: [*:0]const u8,
750 msvc_lib_dir_len: usize,748 msvc_lib_dir_len: usize,
751 kernel32_lib_dir: [*:0]const u8,749 kernel32_lib_dir: [*:0]const u8,
...@@ -773,13 +771,6 @@ const Stage2LibCInstallation = extern struct {...@@ -773,13 +771,6 @@ const Stage2LibCInstallation = extern struct {
773 self.crt_dir = "";771 self.crt_dir = "";
774 self.crt_dir_len = 0;772 self.crt_dir_len = 0;
775 }773 }
776 if (libc.static_crt_dir) |s| {
777 self.static_crt_dir = s.ptr;
778 self.static_crt_dir_len = s.len;
779 } else {
780 self.static_crt_dir = "";
781 self.static_crt_dir_len = 0;
782 }
783 if (libc.msvc_lib_dir) |s| {774 if (libc.msvc_lib_dir) |s| {
784 self.msvc_lib_dir = s.ptr;775 self.msvc_lib_dir = s.ptr;
785 self.msvc_lib_dir_len = s.len;776 self.msvc_lib_dir_len = s.len;
...@@ -807,9 +798,6 @@ const Stage2LibCInstallation = extern struct {...@@ -807,9 +798,6 @@ const Stage2LibCInstallation = extern struct {
807 if (self.crt_dir_len != 0) {798 if (self.crt_dir_len != 0) {
808 libc.crt_dir = self.crt_dir[0..self.crt_dir_len :0];799 libc.crt_dir = self.crt_dir[0..self.crt_dir_len :0];
809 }800 }
810 if (self.static_crt_dir_len != 0) {
811 libc.static_crt_dir = self.static_crt_dir[0..self.static_crt_dir_len :0];
812 }
813 if (self.msvc_lib_dir_len != 0) {801 if (self.msvc_lib_dir_len != 0) {
814 libc.msvc_lib_dir = self.msvc_lib_dir[0..self.msvc_lib_dir_len :0];802 libc.msvc_lib_dir = self.msvc_lib_dir[0..self.msvc_lib_dir_len :0];
815 }803 }
src/stage2.cpp-2
...@@ -272,8 +272,6 @@ enum Error stage2_libc_parse(struct Stage2LibCInstallation *libc, const char *li...@@ -272,8 +272,6 @@ enum Error stage2_libc_parse(struct Stage2LibCInstallation *libc, const char *li
272 libc->sys_include_dir_len = strlen(libc->sys_include_dir);272 libc->sys_include_dir_len = strlen(libc->sys_include_dir);
273 libc->crt_dir = "";273 libc->crt_dir = "";
274 libc->crt_dir_len = strlen(libc->crt_dir);274 libc->crt_dir_len = strlen(libc->crt_dir);
275 libc->static_crt_dir = "";
276 libc->static_crt_dir_len = strlen(libc->static_crt_dir);
277 libc->msvc_lib_dir = "";275 libc->msvc_lib_dir = "";
278 libc->msvc_lib_dir_len = strlen(libc->msvc_lib_dir);276 libc->msvc_lib_dir_len = strlen(libc->msvc_lib_dir);
279 libc->kernel32_lib_dir = "";277 libc->kernel32_lib_dir = "";
src/stage2.h-2
...@@ -209,8 +209,6 @@ struct Stage2LibCInstallation {...@@ -209,8 +209,6 @@ struct Stage2LibCInstallation {
209 size_t sys_include_dir_len;209 size_t sys_include_dir_len;
210 const char *crt_dir;210 const char *crt_dir;
211 size_t crt_dir_len;211 size_t crt_dir_len;
212 const char *static_crt_dir;
213 size_t static_crt_dir_len;
214 const char *msvc_lib_dir;212 const char *msvc_lib_dir;
215 size_t msvc_lib_dir_len;213 size_t msvc_lib_dir_len;
216 const char *kernel32_lib_dir;214 const char *kernel32_lib_dir;