diff options
author | Patrick Gartung <gartung@fnal.gov> | 2020-02-13 11:34:20 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 11:34:20 -0600 |
commit | 4dc67b79aa914fea0e9d71488adfbde2d039e442 (patch) | |
tree | adf16e0e60d9081c1685901d58a123b0e2a64d9f /lib | |
parent | 681ad2ac441aa2efeeec1c7d5d139d5c358489fd (diff) | |
download | spack-4dc67b79aa914fea0e9d71488adfbde2d039e442.tar.gz spack-4dc67b79aa914fea0e9d71488adfbde2d039e442.tar.bz2 spack-4dc67b79aa914fea0e9d71488adfbde2d039e442.tar.xz spack-4dc67b79aa914fea0e9d71488adfbde2d039e442.zip |
Replace direct call to patchelf with get_existing_elf_rpaths which handles exceptions. (#14929)
* Replace direct call to patchelf with get_existing_elf_rpaths which handles exceptions.
* Remove unused patchelf definition.
* Convert to set.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/relocate.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index d722e587da..87de08c9b2 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -684,13 +684,6 @@ def file_is_relocatable(file, paths_to_relocate=None): strings = Executable('strings') - # if we're relocating patchelf itself, use it - - if file[-13:] == "/bin/patchelf": - patchelf = Executable(file) - else: - patchelf = Executable(get_patchelf()) - # Remove the RPATHS from the strings in the executable set_of_strings = set(strings(file, output=str).split()) @@ -700,8 +693,8 @@ def file_is_relocatable(file, paths_to_relocate=None): if platform.system().lower() == 'linux': if m_subtype == 'x-executable' or m_subtype == 'x-sharedlib': - rpaths = patchelf('--print-rpath', file, output=str).strip() - set_of_strings.discard(rpaths.strip()) + rpaths = set(get_existing_elf_rpaths(file)) + set_of_strings.discard(rpaths) if platform.system().lower() == 'darwin': if m_subtype == 'x-mach-binary': rpaths, deps, idpath = macho_get_paths(file) |