From 4dc67b79aa914fea0e9d71488adfbde2d039e442 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Thu, 13 Feb 2020 11:34:20 -0600 Subject: 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. --- lib/spack/spack/relocate.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3-60-g2f50