================
@@ -79,13 +85,63 @@ IncrementalHIPDeviceParser::GenerateDeviceObject() {
return llvm::StringRef(ObjectContent.data(), ObjectContent.size());
}
+llvm::Expected<llvm::StringRef>
+IncrementalHIPDeviceParser::GenerateHSACO(llvm::StringRef Object) {
+ std::string Exe = llvm::sys::fs::getMainExecutable(nullptr, nullptr);
+ llvm::ErrorOr<std::string> LLDPath = llvm::sys::findProgramByName(
+ "ld.lld", {llvm::sys::path::parent_path(Exe)});
+ if (!LLDPath)
+ LLDPath = llvm::sys::findProgramByName("ld.lld");
----------------
AdityaSinha149 wrote:
We need `lld` to generate `HSACO` from the object file because `AMDGPU` backend
only emits a relocatable object that can't be loaded by the HIP runtime. `lld
-shared` changes it into a loadable shared code object.
https://github.com/llvm/llvm-project/pull/235614
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits