| author | |
| committer | |
| log | 33174f11ef5cbb3534217dbc1502886d97226778 |
| tree | a57894a7e791074a4726b883ba6608eddb7e88cd |
| parent | ade10387a583351fe597b58c4c9ceb97d959adf5 |
4 files changed, 16 insertions(+), 11 deletions(-)
src-self-hosted/libc_installation.zig+2-2| ... | @@ -283,7 +283,7 @@ pub const LibCInstallation = struct { | ... | @@ -283,7 +283,7 @@ pub const LibCInstallation = struct { |
| 283 | switch (builtin.arch) { | 283 | switch (builtin.arch) { |
| 284 | builtin.Arch.i386 => try stream.write("x86"), | 284 | builtin.Arch.i386 => try stream.write("x86"), |
| 285 | builtin.Arch.x86_64 => try stream.write("x64"), | 285 | builtin.Arch.x86_64 => try stream.write("x64"), |
| 286 | builtin.Arch.aarch64v8 => try stream.write("arm"), | 286 | builtin.Arch.aarch64 => try stream.write("arm"), |
| 287 | else => return error.UnsupportedArchitecture, | 287 | else => return error.UnsupportedArchitecture, |
| 288 | } | 288 | } |
| 289 | const ucrt_lib_path = try std.os.path.join( | 289 | const ucrt_lib_path = try std.os.path.join( |
| ... | @@ -361,7 +361,7 @@ pub const LibCInstallation = struct { | ... | @@ -361,7 +361,7 @@ pub const LibCInstallation = struct { |
| 361 | switch (builtin.arch) { | 361 | switch (builtin.arch) { |
| 362 | builtin.Arch.i386 => try stream.write("x86\\"), | 362 | builtin.Arch.i386 => try stream.write("x86\\"), |
| 363 | builtin.Arch.x86_64 => try stream.write("x64\\"), | 363 | builtin.Arch.x86_64 => try stream.write("x64\\"), |
| 364 | builtin.Arch.aarch64v8 => try stream.write("arm\\"), | 364 | builtin.Arch.aarch64 => try stream.write("arm\\"), |
| 365 | else => return error.UnsupportedArchitecture, | 365 | else => return error.UnsupportedArchitecture, |
| 366 | } | 366 | } |
| 367 | const kernel32_path = try std.os.path.join( | 367 | const kernel32_path = try std.os.path.join( |
src/codegen.cpp+6-7| ... | @@ -8174,20 +8174,19 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { | ... | @@ -8174,20 +8174,19 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { |
| 8174 | args.append(buf_ptr(out_dep_path)); | 8174 | args.append(buf_ptr(out_dep_path)); |
| 8175 | } | 8175 | } |
| 8176 | 8176 | ||
| 8177 | args.append("-nobuiltininc"); | ||
| 8178 | args.append("-nostdinc"); | 8177 | args.append("-nostdinc"); |
| 8179 | args.append("-nostdinc++"); | ||
| 8180 | |||
| 8181 | if (g->libc_link_lib == nullptr) { | ||
| 8182 | args.append("-nolibc"); | ||
| 8183 | } | ||
| 8184 | |||
| 8185 | args.append("-fno-spell-checking"); | 8178 | args.append("-fno-spell-checking"); |
| 8186 | 8179 | ||
| 8187 | args.append("-isystem"); | 8180 | args.append("-isystem"); |
| 8188 | args.append(buf_ptr(g->zig_c_headers_dir)); | 8181 | args.append(buf_ptr(g->zig_c_headers_dir)); |
| 8189 | 8182 | ||
| 8190 | if (g->libc != nullptr) { | 8183 | if (g->libc != nullptr) { |
| 8184 | if (buf_len(&g->libc->msvc_lib_dir) != 0) { | ||
| 8185 | Buf *include_dir = buf_sprintf("%s" OS_SEP ".." OS_SEP ".." OS_SEP "include", buf_ptr(&g->libc->msvc_lib_dir)); | ||
| 8186 | args.append("-isystem"); | ||
| 8187 | args.append(buf_ptr(include_dir)); | ||
| 8188 | } | ||
| 8189 | |||
| 8191 | args.append("-isystem"); | 8190 | args.append("-isystem"); |
| 8192 | args.append(buf_ptr(&g->libc->include_dir)); | 8191 | args.append(buf_ptr(&g->libc->include_dir)); |
| 8193 | } | 8192 | } |
src/libc_installation.cpp+2-2| ... | @@ -172,7 +172,7 @@ static Error zig_libc_find_crt_dir_windows(ZigLibCInstallation *self, ZigWindows | ... | @@ -172,7 +172,7 @@ static Error zig_libc_find_crt_dir_windows(ZigLibCInstallation *self, ZigWindows |
| 172 | bool verbose) | 172 | bool verbose) |
| 173 | { | 173 | { |
| 174 | Error err; | 174 | Error err; |
| 175 | if ((err = os_get_win32_ucrt_lib_path(sdk, &self->crt_dir, target->arch.arch))) { | 175 | if ((err = os_get_win32_ucrt_lib_path(sdk, &self->crt_dir, target->arch))) { |
| 176 | if (verbose) { | 176 | if (verbose) { |
| 177 | fprintf(stderr, "Unable to determine ucrt path: %s\n", err_str(err)); | 177 | fprintf(stderr, "Unable to determine ucrt path: %s\n", err_str(err)); |
| 178 | } | 178 | } |
| ... | @@ -184,7 +184,7 @@ static Error zig_libc_find_kernel32_lib_dir(ZigLibCInstallation *self, ZigWindow | ... | @@ -184,7 +184,7 @@ static Error zig_libc_find_kernel32_lib_dir(ZigLibCInstallation *self, ZigWindow |
| 184 | bool verbose) | 184 | bool verbose) |
| 185 | { | 185 | { |
| 186 | Error err; | 186 | Error err; |
| 187 | if ((err = os_get_win32_kern32_path(sdk, &self->kernel32_lib_dir, target->arch.arch))) { | 187 | if ((err = os_get_win32_kern32_path(sdk, &self->kernel32_lib_dir, target->arch))) { |
| 188 | if (verbose) { | 188 | if (verbose) { |
| 189 | fprintf(stderr, "Unable to determine kernel32 path: %s\n", err_str(err)); | 189 | fprintf(stderr, "Unable to determine kernel32 path: %s\n", err_str(err)); |
| 190 | } | 190 | } |
src/translate_c.cpp+6| ... | @@ -4815,6 +4815,12 @@ Error parse_h_file(ImportTableEntry *import, ZigList<ErrorMsg *> *errors, const | ... | @@ -4815,6 +4815,12 @@ Error parse_h_file(ImportTableEntry *import, ZigList<ErrorMsg *> *errors, const |
| 4815 | clang_argv.append(buf_ptr(codegen->zig_c_headers_dir)); | 4815 | clang_argv.append(buf_ptr(codegen->zig_c_headers_dir)); |
| 4816 | 4816 | ||
| 4817 | if (codegen->libc != nullptr) { | 4817 | if (codegen->libc != nullptr) { |
| 4818 | if (buf_len(&codegen->libc->msvc_lib_dir) != 0) { | ||
| 4819 | Buf *include_dir = buf_sprintf("%s" OS_SEP ".." OS_SEP ".." OS_SEP "include", buf_ptr(&codegen->libc->msvc_lib_dir)); | ||
| 4820 | clang_argv.append("-isystem"); | ||
| 4821 | clang_argv.append(buf_ptr(include_dir)); | ||
| 4822 | } | ||
| 4823 | |||
| 4818 | clang_argv.append("-isystem"); | 4824 | clang_argv.append("-isystem"); |
| 4819 | clang_argv.append(buf_ptr(&codegen->libc->include_dir)); | 4825 | clang_argv.append(buf_ptr(&codegen->libc->include_dir)); |
| 4820 | } | 4826 | } |