Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lief #5627

Open
wants to merge 2 commits into
base: 25.1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions conda_build/os_utils/liefldd.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@
# Fallback for lief<0.15.
LOAD_COMMAND_TYPES = lief.MachO.LOAD_COMMAND_TYPES
try:
ELF_CLASS = lief.ELF.Header.CLASS
ELF64 = lief.ELF.Header.CLASS.ELF64
ELF32 = lief.ELF.Header.CLASS.ELF32
except AttributeError:
# Fallback for lief<0.15.
ELF_CLASS = lief.ELF.ELF_CLASS
ELF64 = lief.ELF.ELF_CLASS.CLASS64
ELF32 = lief.ELF.ELF_CLASS.CLASS32


except ImportError:
have_lief = False

Expand Down Expand Up @@ -203,7 +207,7 @@ def get_rpathy_thing_raw_partial(file, elf_attribute, elf_dyn_tag):
binary_format = binary.format
if binary_format == EXE_FORMATS.ELF:
binary_type = binary.type
if binary_type == ELF_CLASS.CLASS32 or binary_type == ELF_CLASS.CLASS64:
if binary_type == ELF32 or binary_type == ELF64:
rpaths = _get_elf_rpathy_thing(binary, elf_attribute, elf_dyn_tag)
elif (
binary_format == EXE_FORMATS.MACHO
Expand Down Expand Up @@ -257,7 +261,7 @@ def set_rpath(old_matching, new_rpath, file):
if not binary:
return
if binary.format == EXE_FORMATS.ELF and (
binary.type == ELF_CLASS.CLASS32 or binary.type == ELF_CLASS.CLASS64
binary.type == ELF32 or binary.type == ELF64
):
if _set_elf_rpathy_thing(
binary, old_matching, new_rpath, set_rpath=True, set_runpath=False
Expand Down Expand Up @@ -345,7 +349,7 @@ def from_os_varnames(binary_format, binary_type, input_):
.replace("@rpath", "$RPATH")
)
elif binary_format == EXE_FORMATS.ELF:
if binary_type == ELF_CLASS.CLASS64:
if binary_type == ELF64:
libdir = "/lib64"
else:
libdir = "/lib"
Expand All @@ -371,7 +375,7 @@ def get_uniqueness_key(filename, file):
elif binary.format == EXE_FORMATS.MACHO:
return filename
elif binary.format == EXE_FORMATS.ELF and ( # noqa
binary.type == ELF_CLASS.CLASS32 or binary.type == ELF_CLASS.CLASS64
binary.type == ELF32 or binary.type == ELF64
):
dynamic_entries = binary.dynamic_entries
result = [e.name for e in dynamic_entries if e.tag == ELF_DYNAMIC_TAGS.SONAME]
Expand Down Expand Up @@ -488,7 +492,7 @@ def inspect_linkages_lief(
if not binary:
default_paths = []
elif binary.format == EXE_FORMATS.ELF:
if binary.type == ELF_CLASS.CLASS64:
if binary.type == ELF64:
default_paths = [
"$SYSROOT/lib64",
"$SYSROOT/usr/lib64",
Expand Down
Loading