Skip to content

Commit

Permalink
[Comgr] Removing target specification from HIP compilation
Browse files Browse the repository at this point in the history
Reported here: #92

Instead of hardcoding the -target option, allow clang to use
the default target. This avoids issues when using musl, which
requires a 'x86_64-unknown-linux-musl' target.

Change-Id: I6a24dda4078f914e47bf3b4b2715dbce9d1a513f
  • Loading branch information
lamb-j committed Jun 28, 2024
1 parent 49a8545 commit 26a1514
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions amd/comgr/src/comgr-compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ AMDGPUCompiler::executeInProcessDriver(ArrayRef<const char *> Args) {
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient);
ProcessWarningOptions(Diags, *DiagOpts, /*ReportDiags=*/false);

Driver TheDriver((Twine(env::getLLVMPath()) + "/bin/clang").str(), "", Diags);
Driver TheDriver((Twine(env::getLLVMPath()) + "/bin/clang").str(),
llvm::sys::getDefaultTargetTriple(), Diags);
TheDriver.setTitle("AMDGPU Code Object Manager");
TheDriver.setCheckInputsExist(false);

Expand Down Expand Up @@ -1053,8 +1054,6 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
case AMD_COMGR_LANGUAGE_HIP:
Args.push_back("hip");
Args.push_back("-std=c++11");
Args.push_back("-target");
Args.push_back("x86_64-unknown-linux-gnu");
Args.push_back("--cuda-device-only");
Args.push_back("-isystem");
Args.push_back(ROCMIncludePath.c_str());
Expand Down

0 comments on commit 26a1514

Please sign in to comment.