diff options
author | Alex Lapenkou <alex.lapenkou@chicagotrading.com> | 2022-11-29 21:04:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-12-02 14:00:06 (GMT) |
commit | 136622a2b20ee36808cdf4e8dc2bf64fdf7e2f07 (patch) | |
tree | 03b36a683e304008fa8b4052b2275d4e37c1c603 /Source/cmBinUtilsLinuxELFLinker.cxx | |
parent | 4aa3149c67165952306ed457eeaaab52a90285a5 (diff) | |
download | CMake-136622a2b20ee36808cdf4e8dc2bf64fdf7e2f07.zip CMake-136622a2b20ee36808cdf4e8dc2bf64fdf7e2f07.tar.gz CMake-136622a2b20ee36808cdf4e8dc2bf64fdf7e2f07.tar.bz2 |
file(GET_RUNTIME_DEPENDENCIES): propagate transitive parent's rpath
This fixes incorrect runtime dependency resolution when the dependency
is located in rpaths of a transitive parent. Instead of supplying only
the rpaths of the immediate parent, it combines the rpaths of all
transitive parents and passes them down.
Fixes: #24172
Diffstat (limited to 'Source/cmBinUtilsLinuxELFLinker.cxx')
-rw-r--r-- | Source/cmBinUtilsLinuxELFLinker.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmBinUtilsLinuxELFLinker.cxx b/Source/cmBinUtilsLinuxELFLinker.cxx index a69c00d..5972202 100644 --- a/Source/cmBinUtilsLinuxELFLinker.cxx +++ b/Source/cmBinUtilsLinuxELFLinker.cxx @@ -154,8 +154,13 @@ bool cmBinUtilsLinuxELFLinker::ScanDependencies( if (!this->Archive->IsPostExcluded(path)) { bool unique; this->Archive->AddResolvedPath(dep, path, unique); - if (unique && !this->ScanDependencies(path, rpaths)) { - return false; + if (unique) { + std::vector<std::string> combinedParentRpaths = parentRpaths; + combinedParentRpaths.insert(combinedParentRpaths.end(), + rpaths.begin(), rpaths.end()); + if (!this->ScanDependencies(path, combinedParentRpaths)) { + return false; + } } } } else { |