해당 파일이나 디렉토리는 없지만 ldd는 모두 존재한다고 보고합니다.

해당 파일이나 디렉토리는 없지만 ldd는 모두 존재한다고 보고합니다.

docker와 qemu를 사용하여 amd64 워크스테이션에서 PiCore64용 canboat를 컴파일했습니다. 특히 이것은 내 빌드 스크립트입니다.

#!/bin/sh

set -e

NAME=canboat

cd canboat
make all
cd ..

mkdir -p ./root/usr/local/bin/
cp canboat/rel/linux-aarch64/* ./root/usr/local/bin/

patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/actisense-serial
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/analyzer
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/analyzer-explain
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/analyzer-explain-j1939
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/analyzer-j1939
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/candump2analyzer
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/command-group-function
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/ikonvert-serial
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/iptee
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/n2kd
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/nmea0183-serial
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/replay
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/request-group-function
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/socketcan-writer
#exit 1

mksquashfs ./root "$DEST"/"$NAME".tcz -all-root
md5sum "$DEST"/"$NAME".tcz > "$DEST"/"$NAME".tcz.md5.txt
cp "$NAME".tcz.dep "$DEST"
cp "$NAME".tcz.info "$DEST"

도커파일:

FROM arm64v8/alpine:3.19

RUN apk add gcc g++ python3 musl-dev make py3-pip py3-virtualenv libxslt libxml2-utils\
            squashfs-tools py3-yaml py3-urllib3 npm linux-headers patchelf

PiCore64 14.1.0에서 이 확장을 로드하면 다음과 같은 출력이 나타납니다.

$ /tmp/tcloop/canboat/usr/local/bin/actisense-serial
-sh: /tmp/tcloop/canboat/usr/local/bin/actisense-serial: not found

진단:

$ ls /tmp/tcloop/canboat/usr/local/bin/actisense-serial
/tmp/tcloop/canboat/usr/local/bin/actisense-serial
$ ldd /tmp/tcloop/canboat/usr/local/bin/actisense-serial
linux-vdso.so.1 (0x0000007f81963000)
libc.so.6 => /lib/libc.so.6 (0x0000007f81720000)
ld-linux-aarch64.so.1 => /lib/ld-linux-aarch64.so.1 (0x0000007f881926000)
$ readelf -l /tmp/tcloop/canboat/usr/local/bin/actisense-serial | grep interpr
[Requesting program interpreter: ld-linux-aarch64.so.1]
$ ls /lib
...
ld-linux-aarch64.so.1
...
libc.so.6
...
$ env
USER=tc
SHLVL=1
HOME=/home/tc
PAGER=less -EM
PS1=...
ENV=/home/tc/.ashrc
BACKUP=1
LOGNAME=tc
TERM=linux
PATH=/home/tc/.local/bin:/usr/local/sbin:/usr/local/bin:/apps/bin:/usr/sbin:/usr/bin:/sbin:/bin:/etc/sysconfig/tcedir/ondemand
G_FILENAME_ENCODING=iso8859-1
LANG=C
MANPAGER=less -isR
SHELL=/bin/sh
FLWM_TITLEBAR_COLOR=58:7D:AA
PWD=/home/tc
EDITOR=vi
$ strace /tmp/tcloop/canboat/usr/local/bin/actisense-serial
execve("/tmp/tcloop/canboat/usr/local/bin/actisense-serial", ["/tmp/tcloop/canboat/usr/local/bi"...], 0x7fd7ba350 /* 17 vars */) = -1 ENOENT (No such file or directory)
strace: exec: No such file or directory
+++ exited with 1 +++

(...: 간결함 또는 나의 게으름을 위해 축약됨)

따라서 필요한 모든 공유 라이브러리가 발견되었지만 왜 오류가 발생하는지 여전히 혼란스럽습니다. 찾고 있지만 찾을 수 없는 것을 찾을 수 있는 방법이 있습니까? 무엇이 빠졌나요?

관련 정보