authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-15 05:45:53+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-15 05:45:53+01:00
log5f34224b2b4afed00c412fccaf20eef0a7dbedcc
tree3cbd3561afe24ffab073f62d189a7d9b7217c62f
parentaf89bb05d392b34a9ac257d166df1c794542f2e8
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

zig cc: Remove broken CUDA C/C++ support.


2 files changed, 6 insertions(+), 16 deletions(-)

src/Compilation.zig+3-12
...@@ -305,7 +305,6 @@ pub const LangToExt = std.StaticStringMap(FileExt).initComptime(.{...@@ -305,7 +305,6 @@ pub const LangToExt = std.StaticStringMap(FileExt).initComptime(.{
305 .{ "objective-c++-header", .hmm },305 .{ "objective-c++-header", .hmm },
306 .{ "assembler", .assembly },306 .{ "assembler", .assembly },
307 .{ "assembler-with-cpp", .assembly_with_cpp },307 .{ "assembler-with-cpp", .assembly_with_cpp },
308 .{ "cuda", .cu },
309});308});
310309
311/// For passing to a C compiler.310/// For passing to a C compiler.
...@@ -4699,7 +4698,6 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr...@@ -4699,7 +4698,6 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr
4699 .hm => "objective-c-header",4698 .hm => "objective-c-header",
4700 .mm => "objective-c++",4699 .mm => "objective-c++",
4701 .hmm => "objective-c++-header",4700 .hmm => "objective-c++-header",
4702 .cu => "cuda",
4703 else => fatal("language '{s}' is unsupported in this context", .{@tagName(ext)}),4701 else => fatal("language '{s}' is unsupported in this context", .{@tagName(ext)}),
4704 } });4702 } });
4705 }4703 }
...@@ -5583,7 +5581,6 @@ pub fn addCCArgs(...@@ -5583,7 +5581,6 @@ pub fn addCCArgs(
5583 .hm,5581 .hm,
5584 .mm,5582 .mm,
5585 .hmm,5583 .hmm,
5586 .cu,
5587 => {5584 => {
5588 try argv.append("-fno-spell-checking");5585 try argv.append("-fno-spell-checking");
55895586
...@@ -5821,7 +5818,6 @@ fn failWin32ResourceWithOwnedBundle(...@@ -5821,7 +5818,6 @@ fn failWin32ResourceWithOwnedBundle(
5821pub const FileExt = enum {5818pub const FileExt = enum {
5822 c,5819 c,
5823 cpp,5820 cpp,
5824 cu,
5825 h,5821 h,
5826 hpp,5822 hpp,
5827 hm,5823 hm,
...@@ -5852,7 +5848,6 @@ pub const FileExt = enum {...@@ -5852,7 +5848,6 @@ pub const FileExt = enum {
58525848
5853 .c,5849 .c,
5854 .cpp,5850 .cpp,
5855 .cu,
5856 .m,5851 .m,
5857 .mm,5852 .mm,
5858 .ll,5853 .ll,
...@@ -5874,7 +5869,7 @@ pub const FileExt = enum {...@@ -5874,7 +5869,7 @@ pub const FileExt = enum {
58745869
5875 pub fn clangSupportsDiagnostics(ext: FileExt) bool {5870 pub fn clangSupportsDiagnostics(ext: FileExt) bool {
5876 return switch (ext) {5871 return switch (ext) {
5877 .c, .cpp, .h, .hpp, .hm, .hmm, .m, .mm, .cu, .ll, .bc => true,5872 .c, .cpp, .h, .hpp, .hm, .hmm, .m, .mm, .ll, .bc => true,
58785873
5879 .assembly,5874 .assembly,
5880 .assembly_with_cpp,5875 .assembly_with_cpp,
...@@ -5893,7 +5888,7 @@ pub const FileExt = enum {...@@ -5893,7 +5888,7 @@ pub const FileExt = enum {
58935888
5894 pub fn clangSupportsDepFile(ext: FileExt) bool {5889 pub fn clangSupportsDepFile(ext: FileExt) bool {
5895 return switch (ext) {5890 return switch (ext) {
5896 .assembly_with_cpp, .c, .cpp, .h, .hpp, .hm, .hmm, .m, .mm, .cu => true,5891 .assembly_with_cpp, .c, .cpp, .h, .hpp, .hm, .hmm, .m, .mm => true,
58975892
5898 .ll,5893 .ll,
5899 .bc,5894 .bc,
...@@ -5915,7 +5910,6 @@ pub const FileExt = enum {...@@ -5915,7 +5910,6 @@ pub const FileExt = enum {
5915 return switch (ext) {5910 return switch (ext) {
5916 .c => ".c",5911 .c => ".c",
5917 .cpp => ".cpp",5912 .cpp => ".cpp",
5918 .cu => ".cu",
5919 .h => ".h",5913 .h => ".h",
5920 .hpp => ".hpp",5914 .hpp => ".hpp",
5921 .hm => ".hm",5915 .hm => ".hm",
...@@ -5967,8 +5961,7 @@ pub fn hasCppExt(filename: []const u8) bool {...@@ -5967,8 +5961,7 @@ pub fn hasCppExt(filename: []const u8) bool {
5967 mem.endsWith(u8, filename, ".CPP") or5961 mem.endsWith(u8, filename, ".CPP") or
5968 mem.endsWith(u8, filename, ".cpp") or5962 mem.endsWith(u8, filename, ".cpp") or
5969 mem.endsWith(u8, filename, ".cxx") or5963 mem.endsWith(u8, filename, ".cxx") or
5970 mem.endsWith(u8, filename, ".c++") or5964 mem.endsWith(u8, filename, ".c++");
5971 mem.endsWith(u8, filename, ".stub");
5972}5965}
59735966
5974pub fn hasCppHExt(filename: []const u8) bool {5967pub fn hasCppHExt(filename: []const u8) bool {
...@@ -6054,8 +6047,6 @@ pub fn classifyFileExt(filename: []const u8) FileExt {...@@ -6054,8 +6047,6 @@ pub fn classifyFileExt(filename: []const u8) FileExt {
6054 return .static_library;6047 return .static_library;
6055 } else if (hasObjectExt(filename)) {6048 } else if (hasObjectExt(filename)) {
6056 return .object;6049 return .object;
6057 } else if (mem.endsWith(u8, filename, ".cu")) {
6058 return .cu;
6059 } else if (mem.endsWith(u8, filename, ".def")) {6050 } else if (mem.endsWith(u8, filename, ".def")) {
6060 return .def;6051 return .def;
6061 } else if (std.ascii.endsWithIgnoreCase(filename, ".rc")) {6052 } else if (std.ascii.endsWithIgnoreCase(filename, ".rc")) {
src/main.zig+3-4
...@@ -406,11 +406,10 @@ const usage_build_generic =...@@ -406,11 +406,10 @@ const usage_build_generic =
406 \\ .s Target-specific assembly source code406 \\ .s Target-specific assembly source code
407 \\ .S Assembly with C preprocessor (requires LLVM extensions)407 \\ .S Assembly with C preprocessor (requires LLVM extensions)
408 \\ .c C source code (requires LLVM extensions)408 \\ .c C source code (requires LLVM extensions)
409 \\ .cxx .cc .C .cpp .c++ .stub C++ source code (requires LLVM extensions)409 \\ .cxx .cc .C .cpp .c++ C++ source code (requires LLVM extensions)
410 \\ .m Objective-C source code (requires LLVM extensions)410 \\ .m Objective-C source code (requires LLVM extensions)
411 \\ .mm Objective-C++ source code (requires LLVM extensions)411 \\ .mm Objective-C++ source code (requires LLVM extensions)
412 \\ .bc LLVM IR Module (requires LLVM extensions)412 \\ .bc LLVM IR Module (requires LLVM extensions)
413 \\ .cu Cuda source code (requires LLVM extensions)
414 \\413 \\
415 \\General Options:414 \\General Options:
416 \\ -h, --help Print this help and exit415 \\ -h, --help Print this help and exit
...@@ -1770,7 +1769,7 @@ fn buildOutputType(...@@ -1770,7 +1769,7 @@ fn buildOutputType(
1770 fatal("only one manifest file can be specified, found '{s}' after '{s}'", .{ arg, other });1769 fatal("only one manifest file can be specified, found '{s}' after '{s}'", .{ arg, other });
1771 } else manifest_file = arg;1770 } else manifest_file = arg;
1772 },1771 },
1773 .assembly, .assembly_with_cpp, .c, .cpp, .h, .hpp, .hm, .hmm, .ll, .bc, .m, .mm, .cu => {1772 .assembly, .assembly_with_cpp, .c, .cpp, .h, .hpp, .hm, .hmm, .ll, .bc, .m, .mm => {
1774 try create_module.c_source_files.append(arena, .{1773 try create_module.c_source_files.append(arena, .{
1775 // Populated after module creation.1774 // Populated after module creation.
1776 .owner = undefined,1775 .owner = undefined,
...@@ -1867,7 +1866,7 @@ fn buildOutputType(...@@ -1867,7 +1866,7 @@ fn buildOutputType(
1867 try cc_argv.appendSlice(arena, it.other_args);1866 try cc_argv.appendSlice(arena, it.other_args);
1868 },1867 },
1869 .positional => switch (file_ext orelse Compilation.classifyFileExt(mem.sliceTo(it.only_arg, 0))) {1868 .positional => switch (file_ext orelse Compilation.classifyFileExt(mem.sliceTo(it.only_arg, 0))) {
1870 .assembly, .assembly_with_cpp, .c, .cpp, .ll, .bc, .h, .hpp, .hm, .hmm, .m, .mm, .cu => {1869 .assembly, .assembly_with_cpp, .c, .cpp, .ll, .bc, .h, .hpp, .hm, .hmm, .m, .mm => {
1871 try create_module.c_source_files.append(arena, .{1870 try create_module.c_source_files.append(arena, .{
1872 // Populated after module creation.1871 // Populated after module creation.
1873 .owner = undefined,1872 .owner = undefined,