Skip to content

fix(clr): drop version-script entries for symbols the libraries don't define - #10564

Open
lamb-j wants to merge 1 commit into
developfrom
users/lambj/clr-prune-dead-version-script-syms
Open

fix(clr): drop version-script entries for symbols the libraries don't define#10564
lamb-j wants to merge 1 commit into
developfrom
users/lambj/clr-prune-dead-version-script-syms

Conversation

@lamb-j

@lamb-j lamb-j commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

CLR's two linker version scripts list roughly 40 symbols that the libraries they apply to do not define. lld has defaulted to --no-undefined-version since 241dbd310599, and under that default a literal version-script pattern matching nothing is a hard link error — so CLR does not link against a stock upstream lld.

Technical Details

hipamd/src/hip_hcc.map.in — 18 dead hiprtc* entries. These moved to the separate libhiprtc when hiprtc was split out. The script is applied only to amdhip64; hiprtc.map.in already covers the hiprtc* exports:

# hipamd/src/CMakeLists.txt:159
target_link_libraries(amdhip64 PRIVATE "-Wl,--version-script=.../hip_hcc.map.in")
# hipamd/src/hiprtc/CMakeLists.txt:79
target_link_libraries(hiprtc   PRIVATE "-Wl,--version-script=.../hiprtc.map.in")

Against a shipped 7.12 tree:

$ readelf --dyn-syms -W lib/libamdhip64.so | grep -c ' hiprtc'
0
$ readelf --dyn-syms -W lib/libhiprtc.so | grep -c ' hiprtc'
18

opencl/amdocl/amdocl.map — 19 acl* plus 4 others.

  • 19 acl* symbols (aclCompilerInit, aclBinaryInit, aclDisassemble, ...) — no definition anywhere in the tree.
  • clCreateFromD3D10Buffer, clCreateImageFromD3D10Resourcecl_d3d10.cpp is entirely under #ifdef _WIN32, and the WIN32 build links amdocl.def instead of this script.
  • clEnqueueAcquireExternalObjects, clEnqueueReleaseExternalObjects — no definition.

Not an ABI change. None of these symbols were ever exported, so the resulting export set is byte-identical. After the change every literal in amdocl.map is exported by the shipped libamdocl64.so, and every literal in hip_hcc.map.in has a definition in the tree.

Issue Tracking

#10562

Test Plan

Passing CI.

Test Result

Pending CI.

… define

hip_hcc.map.in still lists the 18 hiprtc* entry points, which moved to the
separate libhiprtc when hiprtc was split out; libamdhip64 exports none of
them and hiprtc.map.in already covers them. amdocl.map lists 19 acl*
symbols that no longer exist anywhere in the tree, plus two D3D10 entries
(cl_d3d10.cpp is entirely under #ifdef _WIN32, and WIN32 links amdocl.def
instead) and two clEnqueue*ExternalObjects entries with no definition.

lld has defaulted to --no-undefined-version since 241dbd310599, so a
literal version-script pattern matching nothing is a hard link error.

Changes:
- hipamd/src/hip_hcc.map.in: remove 18 hiprtc* entries
- opencl/amdocl/amdocl.map: remove 19 acl*, 2 D3D10, 2 ExternalObjects

After the change every literal in amdocl.map is exported by the shipped
libamdocl64.so, and every literal in hip_hcc.map.in has a definition in
the tree.
@lamb-j
lamb-j requested a review from a team as a code owner August 21, 2026 21:54
@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass
Forbidden Files ✅ Pass
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants