namhyung / uftrace

Function graph tracer for C/C++/Rust/Python
https://uftrace.github.io/slide/
GNU General Public License v2.0
3.06k stars 474 forks source link

Raspberry Pi OS distributions do not find libraries under libmcount path in the default build. #1730

Open paranlee opened 1 year ago

paranlee commented 1 year ago

When we compile uftrace on Raspberry Pi OS

$ ./uftrace live ./hello

ERROR: ld.so: object 'libmcount-fast.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
hello uftrace!
uftrace: /home/kim/uftrace/cmds/record.c:1437:update_session_maps
 ERROR: cannot find map files: No such file or directory

This is easily accomplished by placing the following settings in our's .bashrc.

LD_LIBRARY_PATH=$HOME/uftrace/libmcount:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

But like other distributions, it will need to be updated to be found by default.

paranlee commented 1 year ago
kim@raspberrypi:~ $ uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux
kim@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"