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(.{
305305 .{ "objective-c++-header", .hmm },
306306 .{ "assembler", .assembly },
307307 .{ "assembler-with-cpp", .assembly_with_cpp },
308 .{ "cuda", .cu },
309308});
310309
311310/// For passing to a C compiler.
......@@ -4699,7 +4698,6 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr
46994698 .hm => "objective-c-header",
47004699 .mm => "objective-c++",
47014700 .hmm => "objective-c++-header",
4702 .cu => "cuda",
47034701 else => fatal("language '{s}' is unsupported in this context", .{@tagName(ext)}),
47044702 } });
47054703 }
......@@ -5583,7 +5581,6 @@ pub fn addCCArgs(
55835581 .hm,
55845582 .mm,
55855583 .hmm,
5586 .cu,
55875584 => {
55885585 try argv.append("-fno-spell-checking");
55895586
......@@ -5821,7 +5818,6 @@ fn failWin32ResourceWithOwnedBundle(
58215818pub const FileExt = enum {
58225819 c,
58235820 cpp,
5824 cu,
58255821 h,
58265822 hpp,
58275823 hm,
......@@ -5852,7 +5848,6 @@ pub const FileExt = enum {
58525848
58535849 .c,
58545850 .cpp,
5855 .cu,
58565851 .m,
58575852 .mm,
58585853 .ll,
......@@ -5874,7 +5869,7 @@ pub const FileExt = enum {
58745869
58755870 pub fn clangSupportsDiagnostics(ext: FileExt) bool {
58765871 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
58795874 .assembly,
58805875 .assembly_with_cpp,
......@@ -5893,7 +5888,7 @@ pub const FileExt = enum {
58935888
58945889 pub fn clangSupportsDepFile(ext: FileExt) bool {
58955890 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
58985893 .ll,
58995894 .bc,
......@@ -5915,7 +5910,6 @@ pub const FileExt = enum {
59155910 return switch (ext) {
59165911 .c => ".c",
59175912 .cpp => ".cpp",
5918 .cu => ".cu",
59195913 .h => ".h",
59205914 .hpp => ".hpp",
59215915 .hm => ".hm",
......@@ -5967,8 +5961,7 @@ pub fn hasCppExt(filename: []const u8) bool {
59675961 mem.endsWith(u8, filename, ".CPP") or
59685962 mem.endsWith(u8, filename, ".cpp") or
59695963 mem.endsWith(u8, filename, ".cxx") or
5970 mem.endsWith(u8, filename, ".c++") or
5971 mem.endsWith(u8, filename, ".stub");
5964 mem.endsWith(u8, filename, ".c++");
59725965}
59735966
59745967pub fn hasCppHExt(filename: []const u8) bool {
......@@ -6054,8 +6047,6 @@ pub fn classifyFileExt(filename: []const u8) FileExt {
60546047 return .static_library;
60556048 } else if (hasObjectExt(filename)) {
60566049 return .object;
6057 } else if (mem.endsWith(u8, filename, ".cu")) {
6058 return .cu;
60596050 } else if (mem.endsWith(u8, filename, ".def")) {
60606051 return .def;
60616052 } else if (std.ascii.endsWithIgnoreCase(filename, ".rc")) {
src/main.zig+3-4
......@@ -406,11 +406,10 @@ const usage_build_generic =
406406 \\ .s Target-specific assembly source code
407407 \\ .S Assembly with C preprocessor (requires LLVM extensions)
408408 \\ .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)
410410 \\ .m Objective-C source code (requires LLVM extensions)
411411 \\ .mm Objective-C++ source code (requires LLVM extensions)
412412 \\ .bc LLVM IR Module (requires LLVM extensions)
413 \\ .cu Cuda source code (requires LLVM extensions)
414413 \\
415414 \\General Options:
416415 \\ -h, --help Print this help and exit
......@@ -1770,7 +1769,7 @@ fn buildOutputType(
17701769 fatal("only one manifest file can be specified, found '{s}' after '{s}'", .{ arg, other });
17711770 } else manifest_file = arg;
17721771 },
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 => {
17741773 try create_module.c_source_files.append(arena, .{
17751774 // Populated after module creation.
17761775 .owner = undefined,
......@@ -1867,7 +1866,7 @@ fn buildOutputType(
18671866 try cc_argv.appendSlice(arena, it.other_args);
18681867 },
18691868 .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 => {
18711870 try create_module.c_source_files.append(arena, .{
18721871 // Populated after module creation.
18731872 .owner = undefined,