Skip to content

kcov crashes on ubuntu-latest: kcov: error while loading shared libraries: libopcodes-2.38-system.so #441

@kforner

Description

@kforner

Here's my github actions script:

jobs:
  build:
    name: Build on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          # - os:  windows-2022
          #   compiler: msvc
          - os: windows-latest
            compiler: gcc 
          - os: ubuntu-latest
          - os: macos-latest

    steps:

    #checkout the git repo
    - uses: actions/checkout@v4
    
    # install common c++ software: here gcc, cmake, make, git...
    - name: Setup Cpp
      uses: aminya/setup-cpp@v1
      with:
        compiler: ${{ matrix.compiler }}
        cmake: true
        make: true
        kcov: true

when executing on Linux I get:

 kcov: error while loading shared libraries: libopcodes-2.38-system.so: cannot open shared object file: No such file or directory

Digging a bit I see that kcov is installed via:

   Installing kcov v42 x64 via direct downloading
  Download kcov v42
  Trying https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz #1 at 1:31:49 PM
  Extracting /home/runner/work/_temp/1758115909109-setup-cpp-kcov-amd64.tar.gz to /home/runner/kcov
  tar already installed at /usr/bin/tar
  Add /home/runner/kcov/usr/local/bin to PATH
  Installing libbinutils  via apt-get

From what I understand the libbinutils deb package is supposed to install that libopcodes-2.38-system.so lib.

But I checked on ubuntu-24.04, the libopcodes version is 2.42:
/usr/lib/x86_64-linux-gnu/libopcodes-2.42-system.so
so that is the explanation.

In order to fix it, maybe do a static build to be more independent?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions