[Offload][AMDGPU] Make compiler-rt libs visible (#209849)
Fixed the failure in offload test after https://github.com/llvm/llvm-project/pull/209765
This commit is contained in:
parent
18d2b47a0d
commit
ba2be3f8ad
1 changed files with 15 additions and 1 deletions
|
|
@ -252,14 +252,28 @@ def get_target_library_dir():
|
|||
# The AMDGPU offload triple was renamed amdgcn-amd-amdhsa ->
|
||||
# amdgpu-amd-amdhsa. Fall back to the legacy directory when the runtime was
|
||||
# built under the old triple name.
|
||||
# FIXME: Drop this once --offload-arch and bundled AMDGPU offload images
|
||||
# consistently use amdgpu-amd-amdhsa.
|
||||
if target == amdgpu_target and not os.path.isdir(library_dir):
|
||||
legacy_dir = os.path.join(config.llvm_library_dir, legacy_amdgpu_target)
|
||||
if os.path.isdir(legacy_dir):
|
||||
return legacy_dir
|
||||
return library_dir
|
||||
|
||||
def get_compiler_rt_library_dirs():
|
||||
target = remove_suffix_if_present(config.libomptarget_current_target)
|
||||
dirs = glob.glob(os.path.join(config.llvm_library_dir, "clang", "*", "lib",
|
||||
target))
|
||||
if target == amdgpu_target:
|
||||
# FIXME: Drop this once --offload-arch and bundled AMDGPU offload images
|
||||
# consistently use amdgpu-amd-amdhsa.
|
||||
dirs += glob.glob(os.path.join(config.llvm_library_dir, "clang", "*",
|
||||
"lib", legacy_amdgpu_target))
|
||||
return dirs
|
||||
|
||||
if "gpu" in config.available_features and "intelgpu" not in config.available_features:
|
||||
config.test_flags += " -Xoffload-linker -L" + get_target_library_dir()
|
||||
for library_dir in [get_target_library_dir()] + get_compiler_rt_library_dirs():
|
||||
config.test_flags += " -Xoffload-linker -L" + library_dir
|
||||
|
||||
def add_libraries(source):
|
||||
if "gpu" not in config.available_features:
|
||||
|
|
|
|||
Loading…
Reference in a new issue