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.
This commit is contained in:
parent
681ad2ac44
commit
4dc67b79aa
1 changed files with 2 additions and 9 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue