Skip to content

Commit 9f0d168

Browse files
committed
[Comgr] Removing target specification from HIP compilation
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
1 parent 0e9ca91 commit 9f0d168

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

amd/comgr/src/comgr-compiler.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,8 @@ AMDGPUCompiler::executeInProcessDriver(ArrayRef<const char *> Args) {
668668
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient);
669669
ProcessWarningOptions(Diags, *DiagOpts, /*ReportDiags=*/false);
670670

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

@@ -1052,8 +1053,6 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
10521053
case AMD_COMGR_LANGUAGE_HIP:
10531054
Args.push_back("hip");
10541055
Args.push_back("-std=c++11");
1055-
Args.push_back("-target");
1056-
Args.push_back("x86_64-unknown-linux-gnu");
10571056
Args.push_back("--cuda-device-only");
10581057
Args.push_back("-isystem");
10591058
Args.push_back(ROCMIncludePath.c_str());

0 commit comments

Comments
 (0)