revive nvptx linkage

This commit is contained in:
Ali Cheraghi 2025-04-20 20:45:01 +03:30 committed by Alex Rønne Petersen
parent af6670c403
commit f38a28a626
No known key found for this signature in database
2 changed files with 9 additions and 6 deletions

View file

@ -53,6 +53,7 @@ pub fn createEmpty(
.tag = .nvptx, .tag = .nvptx,
.comp = comp, .comp = comp,
.emit = emit, .emit = emit,
.zcu_object_sub_path = emit.sub_path,
.gc_sections = options.gc_sections orelse false, .gc_sections = options.gc_sections orelse false,
.print_gc_sections = options.print_gc_sections, .print_gc_sections = options.print_gc_sections,
.stack_size = options.stack_size orelse 0, .stack_size = options.stack_size orelse 0,
@ -116,11 +117,7 @@ pub fn flushModule(self: *NvPtx, arena: Allocator, tid: Zcu.PerThread.Id, prog_n
if (build_options.skip_non_native) if (build_options.skip_non_native)
@panic("Attempted to compile for architecture that was disabled by build configuration"); @panic("Attempted to compile for architecture that was disabled by build configuration");
// The code that was here before mutated the Compilation's file emission mechanism.
// That's not supposed to happen in flushModule, so I deleted the code.
_ = arena;
_ = self;
_ = prog_node;
_ = tid; _ = tid;
@panic("TODO: rewrite the NvPtx.flushModule function");
try self.base.emitLlvmObject(arena, self.llvm_object, prog_node);
} }

View file

@ -3074,6 +3074,12 @@ fn buildOutputType(
const target = main_mod.resolved_target.result; const target = main_mod.resolved_target.result;
if (target.cpu.arch.isNvptx()) {
if (emit_bin != .no and create_module.resolved_options.use_llvm) {
fatal("cannot emit PTX binary with the LLVM backend; only '-femit-asm' is supported", .{});
}
}
if (target.os.tag == .windows and major_subsystem_version == null and minor_subsystem_version == null) { if (target.os.tag == .windows and major_subsystem_version == null and minor_subsystem_version == null) {
major_subsystem_version, minor_subsystem_version = switch (target.os.version_range.windows.min) { major_subsystem_version, minor_subsystem_version = switch (target.os.version_range.windows.min) {
.nt4 => .{ 4, 0 }, .nt4 => .{ 4, 0 },