[Issue]: ld.lld: build fails with `version script assignment of 'ROCR_1' to symbol 'hsa_tools_scratch_event_alloc_start' failed: symbol not defined`
Problem Description
Attempt to build ROCR-Runtime 6.1.0 with clang >= 17 and ld.lld (default clang linker) fails, as https://github.com/ROCm/ROCR-Runtime/blob/rocm-6.1.0/src/hsacore.so.def points to symbols, which does not exist anymore.
/usr/lib/llvm/19/bin/clang++-19 ... -Wl,--version-script=/var/tmp/portage/dev-libs/rocr-runtime-6.1.0/work/ROCR-Runtime-rocm-6.1.0/src/hsacore.so.def ... -o libhsa-runtime64.so.1.13.0 ...
ld.lld: error: version script assignment of 'ROCR_1' to symbol 'hsa_tools_scratch_event_alloc_start' failed: symbol not defined
ld.lld: error: version script assignment of 'ROCR_1' to symbol 'hsa_tools_scratch_event_alloc_end' failed: symbol not defined
ld.lld: error: version script assignment of 'ROCR_1' to symbol 'hsa_tools_scratch_event_free_start' failed: symbol not defined
ld.lld: error: version script assignment of 'ROCR_1' to symbol 'hsa_tools_scratch_event_free_end' failed: symbol not defined
ld.lld: error: version script assignment of 'ROCR_1' to symbol 'hsa_tools_scratch_event_async_reclaim_start' failed: symbol not defined
ld.lld: error: version script assignment of 'ROCR_1' to symbol 'hsa_tools_scratch_event_async_reclaim_end' failed: symbol not defined
clang++-19: error: linker command failed with exit code 1 (use -v to see invocation)
Please remove these symbols from hsacore.so.def if you don't plan to use them anymore
Operating System
Gentoo
ROCm Version
ROCm 6.1.0
ROCm Component
ROCR-Runtime
Steps to Reproduce
No response
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response
Issue still applies to rocm-6.2.0, please fix
--- a/hsacore.so.def
+++ b/hsacore.so.def
@@ -247,12 +247,6 @@ global:
hsa_amd_vmem_retain_alloc_handle;
hsa_amd_vmem_get_alloc_properties_from_handle;
hsa_amd_agent_set_async_scratch_limit;
- hsa_tools_scratch_event_alloc_start;
- hsa_tools_scratch_event_alloc_end;
- hsa_tools_scratch_event_free_start;
- hsa_tools_scratch_event_free_end;
- hsa_tools_scratch_event_async_reclaim_start;
- hsa_tools_scratch_event_async_reclaim_end;
hsa_ven_amd_pcs_iterate_configuration;
hsa_ven_amd_pcs_create;
hsa_ven_amd_pcs_create_from_id;
@AngryLoki Internal ticket has been created to fix this issue. Thanks!
Hi @AngryLoki , Thanks for bringing this to our attention. We have confirmed the above symbols are unused and deleted them, expect the change to come in future updates.