file(GET_RUNTIME_DEPENDENCIES): Fix resolution of repeated ELF dependencies

When a library file name is encountered multiple times, reuse the result
from the first time.  This more closely matches the behavior of the
dynamic loader on Linux.

Fixes: #24621
This commit is contained in:
Aliaksandr Averchanka
2024-08-15 10:01:02 +03:00
parent b575a8fc8c
commit 4d4e008e69
8 changed files with 148 additions and 36 deletions
+8
View File
@@ -1169,6 +1169,14 @@ Handling Runtime Binaries
5. Otherwise, the dependency is unresolved.
.. versionchanged:: 3.31
Resolution of each encountered library file name occurs at most once
while processing a given root ELF file (executable or shared object).
If a library file name is encountered again in the dependency tree,
the original resolution is assumed. This behavior more closely matches
the dynamic loader's behavior on Linux.
On Windows platforms, library resolution works as follows:
1. DLL dependency names are converted to lowercase for matching filters.