elfdeps: Introduce --add-arch #1660
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this adds a facility that helps with cross compilation and automatic
ELF dependencies by extending the existing mechanism to specially mark
generated ELF deps with "(lib64)" suffixes to alternatively or
additionally include an architecture name. This is enabled with
the --add-arch option.
Additionally it's possible to disable generation of unsuffixed deps
with --no-nonarch, so that the old names can gradually be phased out
(by leaving them in the generated Provides, but remove them from
the Requires). Some examples with random libs I happen to have lying
around:
% ./elfdeps --requires --add-arch --no-nonarch /matz/debian/root.riscv64/lib/riscv64-linux-gnu/libreadline.so.7
ld-linux-riscv64-lp64d.so.1(GLIBC_2.27)(riscv64)
libtinfo.so.6(NCURSES6_TINFO_5.0.19991023)(riscv64)
libc.so.6(GLIBC_2.27)(riscv64)
libtinfo.so.6()(riscv64)
libc.so.6()(riscv64)
ld-linux-riscv64-lp64d.so.1()(riscv64)
rtld(GNU_HASH)
Note how the "(lib64)" markers are not generated here (--no-nonarch), but ...
% ./elfdeps --provides --add-arch /matz/debian/root.riscv64/lib/riscv64-linux-gnu/libreadline.so.7
libreadline.so.7()(64bit)
libreadline.so.7()(riscv64)
... are generated here. Further (mixing several arch libs):
% ./elfdeps --requires --add-arch --no-nonarch /matz/debian/root.arm64/lib/libxtables.so.10 /lib64/libutil.so.1 /lib/libreadline.so.8
ld-linux-aarch64.so.1(GLIBC_2.17)(aarch64)
libdl.so.2(GLIBC_2.17)(aarch64)
libc.so.6(GLIBC_2.17)(aarch64)
libdl.so.2()(aarch64)
libc.so.6()(aarch64)
ld-linux-aarch64.so.1()(aarch64)
rtld(GNU_HASH)
libc.so.6(GLIBC_2.4)(x86_64)
libc.so.6(GLIBC_PRIVATE)(x86_64)
libc.so.6(GLIBC_2.2.5)(x86_64)
libc.so.6()(x86_64)
libtinfo.so.6(NCURSES6_TINFO_5.0.19991023)(i386)
libc.so.6(GLIBC_2.28)(i386)
libc.so.6(GLIBC_2.11)(i386)
libc.so.6(GLIBC_2.2)(i386)
libc.so.6(GLIBC_2.1.3)(i386)
libc.so.6(GLIBC_2.2.3)(i386)
libc.so.6(GLIBC_2.15)(i386)
libc.so.6(GLIBC_2.4)(i386)
libc.so.6(GLIBC_2.1)(i386)
libc.so.6(GLIBC_2.3.4)(i386)
libc.so.6(GLIBC_2.0)(i386)
libc.so.6(GLIBC_2.3)(i386)
libtinfo.so.6()(i386)
libc.so.6()(i386)