Code: Select all
musl libc (x86_64)
Version 1.2.1
Dynamic Program Loader
Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname [args]
- libc.so => /tailix/usr/lib/libc.so
- libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
Code: Select all
musl libc (x86_64)
Version 1.2.1
Dynamic Program Loader
Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname [args]
Code: Select all
ld -o hello /tailix/usr/lib/crt1.o hello.o -lc -L/tailix/usr/lib -rpath=/tailix/usr/lib
Code: Select all
libc.so => /tailix/usr/lib/libc.so
Code: Select all
sudo chroot /tailix /lib/ld-musl-x86_64.so.1 -- /hello
Something's wrong inside your chroot, and I think it's the dynamic linker. Your command there runs the program `/lib/ld-musl-x86_64.so.1` with arguments `-- /hello`. In Linux, a dynamically linked program is like a script: the dynamic linker is run with the program as its argument. I think your chroot contains a dynamic linker for the wrong libc. If I remember right, the dynamic linker is `/lib/ld.so`, so I think this will work:kotovalexarian wrote:I can run it inside chroot withHowever, it's almost useless because applications should be executed without such wrapper.Code: Select all
sudo chroot /tailix /lib/ld-musl-x86_64.so.1 -- /hello
Code: Select all
cp /tailix/lib/ld-musl-x86_64.so.1 /tailix/lib/ld.so
Code: Select all
ln -s /tailix/tailix .
That's exactly what my command is doing.eekee wrote:Your command there runs the program /lib/ld-musl-x86_64.so.1 with arguments -- /hello. In Linux, a dynamically linked program is like a script: the dynamic linker is run with the program as its argument.
I thought so, but this doesn't work.nullplan wrote:So, you could get your stuff started, if you justCode: Select all
ln -s /tailix/tailix .
Yes, I finally decided to use static linking for now.nullplan wrote:To get started, maybe static linking is easier, at least until you have enough of an environment inside your chroot jail to build everything with dynamic linking support.