SimonKagstrom / kcov

Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options
http://simonkagstrom.github.io/kcov/
GNU General Public License v2.0
710 stars 109 forks source link

Doesn't work on Ubuntu 21.04 #378

Closed ksaito1125 closed 2 months ago

ksaito1125 commented 2 years ago

I installed kcov by following the steps below.

apt update && apt install -y curl binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
curl -fsSL https://github.com/SimonKagstrom/kcov/releases/download/v40/kcov-amd64.tar.gz -o /tmp/kcov.tar.gz
tar xvfz /tmp/kcov.tar.gz -C /

It worked correctly on Ubuntu20.04. However, on Ubuntu21.04, I get the following error:

root@4479b2cac632:/# curl -fsSL https://github.com/SimonKagstrom/kcov/releases/download/v40/kcov-amd64.tar.gz -o /tmp/kcov.tar.gz
root@4479b2cac632:/# tar xvfz /tmp/kcov.tar.gz -C /
usr/local/bin/kcov
usr/local/bin/kcov-system-daemon
usr/local/share/doc/kcov/COPYING
usr/local/share/doc/kcov/COPYING.externals
usr/local/share/doc/kcov/ChangeLog
usr/local/share/man/man1/kcov.1
root@4479b2cac632:/# kcov --help
kcov: error while loading shared libraries: libopcodes-2.34-system.so: cannot open shared object file: No such file or directory
root@4479b2cac632:/# cat /etc/os-release
NAME="Ubuntu"
VERSION="21.04 (Hirsute Hippo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 21.04"
VERSION_ID="21.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=hirsute
UBUNTU_CODENAME=hirsute
root@4479b2cac632:/#
SimonKagstrom commented 2 years ago

The binary is built via github actions, which I believe uses the latest Ubuntu LTS as a build target. However, probably ubuntu 21.04 has an incompatible binutils library (since I guess you did install binutils-dev first?), so in that case you probably have to built it from source.