authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2025-04-20 20:45:01+03:30
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-04-21 10:45:05+02:00
logffd85ffcda3c36b2cda0783ab285ede8b0fc55af
tree2fcb918dd1f88dbb34cf75916f778709c9a0fcbd
parent13541bc1c0f97c39591c2ba82e9a8c7979ce7b63

revive nvptx linkage


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

src/link/NvPtx.zig+3-6
......@@ -53,6 +53,7 @@ pub fn createEmpty(
5353 .tag = .nvptx,
5454 .comp = comp,
5555 .emit = emit,
56 .zcu_object_sub_path = emit.sub_path,
5657 .gc_sections = options.gc_sections orelse false,
5758 .print_gc_sections = options.print_gc_sections,
5859 .stack_size = options.stack_size orelse 0,
......@@ -116,11 +117,7 @@ pub fn flushModule(self: *NvPtx, arena: Allocator, tid: Zcu.PerThread.Id, prog_n
116117 if (build_options.skip_non_native)
117118 @panic("Attempted to compile for architecture that was disabled by build configuration");
118119
119 // The code that was here before mutated the Compilation's file emission mechanism.
120 // That's not supposed to happen in flushModule, so I deleted the code.
121 _ = arena;
122 _ = self;
123 _ = prog_node;
124120 _ = tid;
125 @panic("TODO: rewrite the NvPtx.flushModule function");
121
122 try self.base.emitLlvmObject(arena, self.llvm_object, prog_node);
126123}
src/main.zig+6
......@@ -3081,6 +3081,12 @@ fn buildOutputType(
30813081
30823082 const target = main_mod.resolved_target.result;
30833083
3084 if (target.cpu.arch.isNvptx()) {
3085 if (emit_bin != .no and create_module.resolved_options.use_llvm) {
3086 fatal("cannot emit PTX binary with the LLVM backend; only '-femit-asm' is supported", .{});
3087 }
3088 }
3089
30843090 if (target.os.tag == .windows and major_subsystem_version == null and minor_subsystem_version == null) {
30853091 major_subsystem_version, minor_subsystem_version = switch (target.os.version_range.windows.min) {
30863092 .nt4 => .{ 4, 0 },