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 +++
(...:簡潔さまたは私の怠惰のために省略されています)
したがって、必要なすべての共有ライブラリが見つかりましたが、なぜエラーが発生するのかはまだ混乱しています。探しているが見つからないものを見つける方法はありますか?何が欠けていますか?