Fix *_input classes destructors visibility (backport #3591)#3601
Merged
maria-Petrova merged 1 commit intorls/2026.0.0-rlsfrom Apr 9, 2026
Merged
Fix *_input classes destructors visibility (backport #3591)#3601maria-Petrova merged 1 commit intorls/2026.0.0-rlsfrom
maria-Petrova merged 1 commit intorls/2026.0.0-rlsfrom
Conversation
Fixes the ABI breakage introduced by CPU SPMD algorithms in the PRs #3507, #3585 Make the binding type of the destructors (~compute_input(), ~partial_compute_input(), ~train_input(), etc.) stably "WEAK" and not dependent on the compiler's logic by adding their non-default implementations. Also fixes `set_responses` method in KNN. (cherry picked from commit 0a5f4cb)
10 tasks
Alexandr-Solovev
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the ABI breakage introduced by CPU SPMD algorithms:
#3507
#3585
The PR changes the binding type of the destructors (
~compute_input(),~partial_compute_input()) to "WEAK" by adding their non-default implementations.Public CI: https://github.com/uxlfoundation/oneDAL/runs/70263726088
Private CI: http://intel-ci.intel.com/f1327082-5573-f199-9143-a4bf010d0e2d
Reasoning
In the #3507 the classes
covariance::compute_inputandcovariance::partial_compute_inputwere not changed explicitly, but the changes led to the unexpected changes in the ABI of those classes. Example:4 Removed function symbols not referenced by debug info:
[D] _ZN6oneapi3dal10covariance2v113compute_inputINS1_4task2v17computeEED0Ev
[D] _ZN6oneapi3dal10covariance2v113compute_inputINS1_4task2v17computeEED2Ev
[D] _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED0Ev
[D] _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED2Ev
Link to the full log: https://github.com/uxlfoundation/oneDAL/actions/runs/23718739687/job/69097133621?pr=3507
Those symbols correspond to the following destructors:
oneapi::dal::covariance::v1::compute_input<oneapi::dal::covariance::task::v1::compute>::~compute_input()oneapi::dal::covariance::v1::partial_compute_input<oneapi::dal::covariance::task::v1::compute>::~partial_compute_input()In the
mainbranch as well as in the #3507 feature branch those destructors left unimplemented, they are generated by the compiler automatically.But the PR #3507 somehow changes the binding types of those symbols in .so files as can be seen with
readelf.The output of the
readelf -s --wide __release_lnx/daal/latest/lib/intel64/libonedal.so | grep _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEEDmain branch
3954: 0000000000148ef0 282 FUNC WEAK DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED0Ev
4198: 0000000000148de0 270 FUNC WEAK DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED2Ev
16346: 0000000000148ef0 282 FUNC WEAK DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED0Ev
16977: 0000000000148de0 270 FUNC WEAK DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED2Ev
feature branch
7420: 0000000000148ed0 282 FUNC LOCAL DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED0Ev
8785: 0000000000148dc0 270 FUNC LOCAL DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED2Ev
The logs show that the binding types were changed from "WEAK" to "LOCAL" for the destructors, which means that in the feature branch the destructors' symbols are only available within the .so file and not exported from the .so as it was done in the
mainbranch.Why did this happen?
There are two factors:
-fvisibility=hidden.Those facts give compiler the ability to define the binding type of the destructors by itself, which is rather fragile as the binding type could change leading to ABI brakeage even with no changes to the classes' implementations, as could be seen in #3507.
Solution
This PR explicitly defines the destructors implementations in the affected classes and in all the *_input classes in the algorithms that might have the CPU-distributed implementations in the future.
This forces the compiler to always generate the symbols for the affected destructors with the 'WEAK' binding, regardless of the code in the other parts of the .so.
CI: http://intel-ci.intel.com/f131bc28-06e8-f18d-90e6-a4bf010d0e2d
Checklist:
Completeness and readability
Testing
Performance
This is an automatic backport of pull request #3591 done by [Mergify](https://mergify.com).