Skip to content

Fix LIB_CORE_NAME mismatch when soversion is enabled#21375

Merged
vepadulano merged 1 commit intoroot-project:masterfrom
chrisburr:fix-lib-core-name-soversion-master
Feb 25, 2026
Merged

Fix LIB_CORE_NAME mismatch when soversion is enabled#21375
vepadulano merged 1 commit intoroot-project:masterfrom
chrisburr:fix-lib-core-name-soversion-master

Conversation

@chrisburr
Copy link
Contributor

When soversion=ON, TROOT::GetSharedLibDir() fails to find libCore on Linux because LIB_CORE_NAME (set to TARGET_FILE_NAME, e.g. libCore.so.6.38.02) doesn't match what dl_iterate_phdr reports (the SONAME, e.g. libCore.so.6.38).

This causes ROOT to fail to locate its library directory, breaking pre-compiled module loading and causing cling to attempt recompiling modules from source at runtime.

Discovered via the conda-forge ROOT build which enables soversion=ON.

The fix uses TARGET_SONAME_FILE_NAME when soversion is enabled on Linux. On macOS, _dyld_get_image_name returns the actual filename so TARGET_FILE_NAME remains correct.

Introduced by ff7e631.

On Linux, dl_iterate_phdr reports loaded libraries by their SONAME
(e.g. libCore.so.6.38), not their full filename (libCore.so.6.38.02).

Commit ff7e631 changed LIB_CORE_NAME from using the SOVERSION-based
name to TARGET_FILE_NAME, which gives the full versioned filename. When
soversion is enabled, this causes TROOT::GetSharedLibDir() to fail to
match the library name reported by the dynamic linker, returning an
empty path. This breaks module loading and causes cling to attempt
recompiling modules from source at runtime, which fails when external
headers (e.g. Vc) are not in cling's include path.

Fix by using TARGET_SONAME_FILE_NAME when soversion is enabled on Linux.
On macOS, _dyld_get_image_name returns the actual filename, so
TARGET_FILE_NAME remains correct there.
@chrisburr chrisburr marked this pull request as ready for review February 25, 2026 13:45
@chrisburr chrisburr requested a review from bellenot as a code owner February 25, 2026 13:45
@vepadulano vepadulano self-assigned this Feb 25, 2026
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Test Results

    22 files      22 suites   3d 4h 40m 14s ⏱️
 3 799 tests  3 795 ✅ 0 💤 4 ❌
76 413 runs  76 409 ✅ 0 💤 4 ❌

For more details on these failures, see this check.

Results for commit 1528d05.

♻️ This comment has been updated with latest results.

@pcanal
Copy link
Member

pcanal commented Feb 25, 2026

For the record, the Spack builds are similarly broken since they also use soversion.

Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vepadulano vepadulano merged commit 82162e3 into root-project:master Feb 25, 2026
50 of 56 checks passed
@hageboeck
Copy link
Member

/backport to 6.38

@root-project-bot
Copy link

Something went wrong with the backport to 6.38: @hageboeck please see the logs

@chrisburr chrisburr deleted the fix-lib-core-name-soversion-master branch February 26, 2026 13:37
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.

5 participants