Skip to content

Conversation

@susematz
Copy link

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)

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)
@pmatilai
Copy link
Member

Just noting that there's significant overlap with #1038

@susematz
Copy link
Author

Wow, looks really similar indeed. It was a result of a specific local project and I didn't know about #1038, so let that be an indication that something like this would be really welcome.

@Conan-Kudo
Copy link
Member

Yep, I worked on #1038 to solve this and several other problems I was having in OpenMandriva. Alas, it's stuck for now. 😭

@susematz
Copy link
Author

susematz commented May 3, 2021

So, how to move forward? I'd like to at least have the possibility to enable such dependencies, with default behaviour as traditional (i.e. "(64bit)" markers), but for that at least the changes to elfdeps.c need to be done. I've consciously left out changes for elf.attr and elflib.attr .

@pmatilai
Copy link
Member

Lets continue in #1038 as there's more background and context there.

@pmatilai pmatilai closed this Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants