Do not use llvm-dis to pick the triple

There are a couple problems with this. First, llvm-dis is an unstable
llvm development tool and 3rd party users should generally not rely on
it. The text format is unstable, and the regex here isn't even
explicitly looking for the target triple field, so it could
accidentally find something else. Second, picking the target to
compile based on the library you are linking is a fundamentally
backwards decision. The target you're compiling for changes the
library you would want to link. The device libraries are only ever
compiled with amdgcn-amd-amdhsa. If we had a second triple, this
should be explicitly building for any it cares about.

Change-Id: I3bae8398f60f78df61ab2177aa9e83f47ec6dea4


[ROCm/ROCR-Runtime commit: 96d4140609]
This commit is contained in:
Matt Arsenault
2020-05-06 12:53:31 -04:00
parent ed6147a506
commit b5f6574895
@@ -107,10 +107,7 @@ if (QUIT)
return()
endif()
# Determine the target triple
execute_process(COMMAND ${LLVM_DIS} ${BITCODE_LIB} -o - OUTPUT_VARIABLE LLVM_DIS_OUTPUT)
string(REGEX MATCH "(amdgcn-amd-.*)\"[\r\n]" QUOTED_TRIPLE "${LLVM_DIS_OUTPUT}")
string(REGEX REPLACE "[\"\r\n]" "" TARGET_TRIPLE "${QUOTED_TRIPLE}")
set(TARGET_TRIPLE "amdgcn-amd-amdhsa")
message("")
message("Build Setting:")