So after too many hours finally it's been solved. It goes like this:

  1. Download libdwarf-20130207.tar.gz
  2. Extract the archive and in a new terminal type:

    cd dwarf-2013-02-07/libdwarf
    ./configure --enable-shared
    make -j$(nproc)
    
  3. If you need a 32 bit library (as in my case), just open the MakeFile and add -m32 to CFLAGS

    CFLAGS = -m32 $(PREINCS) -g -O2 $(INCLUDES) $(dwfpic) $(POSTINCS)
    
  4. At the end, just copy the libdwarf.so into /usr/lib

Answer from Petter Bjao on askubuntu.com
🌐
GitHub
github.com › davea42 › libdwarf-code
GitHub - davea42/libdwarf-code: Contains source for libdwarf, a library for reading DWARF2 and later DWARF. Contains source to create dwarfdump, a program which prints DWARF2 and later DWARF in readable format. Has a very limited DWARF writer set of functions in libdwarfp (producer library). Builds using GNU configure, meson, or cmake. · GitHub
This is always recommended as it's not necessary to have GNU autotools installed. These examples show doing a build in a directory different than the source as that is generally recommended practice. Note: if you get a build failure that mentions something about test/ and missing .Po object files add --disable-dependency-tracking to the configure command. rm -rf /tmp/build mkdir /tmp/build cd /tmp tar xf <path to>/libdwarf-0.4.2.tar.xz cd /tmp/build /tmp/libdwarf-0.4.2/configure make make check
Starred by 256 users
Forked by 87 users
Languages   C 86.3% | HTML 6.7% | C++ 3.7% | Shell 0.8% | Python 0.7% | CMake 0.6%
🌐
Prevanders
prevanders.net › dwarf.html
DWARF Page
If libdwarf and dwarfdump complete their build you have most of the functionality you need. dwarfdump (written in C) lets you dump out, in readable form, the DWARF2, DWARF3, DWARF4, and some DWARF5 data from an object file. (the DWARF5 standard was released on dwarfstd.org in February 2017). There are some prerequisites you must have installed ...
🌐
DevManuals
devmanuals.net › install › ubuntu › ubuntu-20-04-focal-fossa › installing-libdwarf-dev-on-ubuntu20-04.html
How to install libdwarf-dev on Ubuntu 20.04 (Focal Fossa)?
After downloading the latest package list with the help of above you can run the installation process. If libdwarf-dev Architecture: amd64 Version: 20200114-1 Multi-Arch: same is not installed on your compter then the command 'dpkg -L libdwarf-dev Architecture: amd64 Version: 20200114-1 Multi-Arch: ...
🌐
Debian
packages.debian.org › sid › libdwarf-dev
Debian -- Details of package libdwarf-dev in sid
This package contains developer resources for libdwarf. Install it if you want to develop software that uses the libdwarf API.
🌐
GitHub
github.com › frida › libdwarf › blob › main › INSTALL
libdwarf/INSTALL at main · frida/libdwarf
Frida uses libdwarf for resolving debug symbols on some platforms - libdwarf/INSTALL at main · frida/libdwarf
Author   frida
🌐
Prevanders
prevanders.net › libdwarfdoc
libdwarf: A Consumer Library Interface to DWARF
You can install anywhere, there is no need to install in a system directory! Creating a temporary directory and installing there suffices. If installed in appropriate system directories that works too. When compiling to link against a shared library libdwarf you must not define LIBDWARF_STATIC.
🌐
Arch Linux
archlinux.org › packages › extra › x86_64 › libdwarf
Arch Linux - libdwarf 1:2.3.1-1 (x86_64)
View the file list for libdwarf · View the soname list for libdwarf · Copyright © 2002-2026 Judd Vinet, Aaron Griffin and Levente Polyák. The Arch Linux name and logo are recognized trademarks. Some rights reserved.
Find elsewhere
🌐
Ubuntu
launchpad.net › ubuntu › bionic › +package › libdwarf-dev
libdwarf-dev : Bionic (18.04) : Ubuntu
The libdwarf package provides a library which allows reading/consuming and writing/producing of DWARF debugging information from object files, shared libraries, and executables. . This package contains developer resources for libdwarf. Install it if you want to develop software that uses the ...
🌐
Installati.one
installati.one › home › how to install libdwarf-dev on ubuntu 20.04
How To Install libdwarf-dev on Ubuntu 20.04 | Installati.one
June 13, 2023 - There are three methods to install libdwarf-dev on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method.
🌐
Prevanders
prevanders.net › libdwarfreadme.html
This is libdwarf README.md
January 28, 2026 - No libraries other than libc are needed to build or use libdwarf or dwarfdump. Ubuntu: sudo apt install xz pkgconf zlib1g zlib1g-dev libzstd1 sudo apt install libzstd-dev # Use of libzstd1 is new in 0.4.3 # zlib1g zlib1g-dev libzstd1 are all optional but # are required to read any DWARF data ...
🌐
Dwarfstd
wiki.dwarfstd.org › index.php
Libdwarf And Dwarfdump - wiki.dwarfstd.org
Download the tar file. tar xzf libdwarf-<version date extension>.tar.gz cd dwarf-<version date extension> ./configure make cd ../dwarfdump ./configure make · If you use 'git clone' to get the source read the README before attempting a build. The script scripts/FIX-CONFIGURE-TIMES is necessary ...
🌐
Debian
packages.debian.org › unstable › libdwarf-dev
Details of package libdwarf-dev in sid
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Dwarfstd
wiki.dwarfstd.org › Libdwarf_And_Dwarfdump.md
Libdwarf And Dwarfdump - Wiki - DWARF Debugging Standard
Download the tar file. tar xzf libdwarf-<version date extension>.tar.gz cd dwarf-<version date extension> ./configure make cd ../dwarfdump ./configure make · If you use ‘git clone’ to get the source read the README before attempting a build. The script scripts/FIX-CONFIGURE-TIMES is necessary ...
🌐
Anaconda.org
anaconda.org › conda-forge › libdwarf-dev
libdwarf-dev - conda-forge | Anaconda.org
Install libdwarf-dev with Anaconda.org. a library for manipulating DWARF Debugging Information Format (headers & dev stuff)
🌐
FreshPorts
freshports.org › devel › libdwarf
FreshPorts -- devel/libdwarf: Library to analyze DWARF debugging information in ELF files
The libdwarf library is the base for the dwarfdump utility by the same author. It implements routines to access the DWARF debugging information found in ELF object files.
🌐
Ubuntu
launchpad.net › ubuntu › jammy › amd64 › libdwarf-dev › 20201201-1
20201201-1 : libdwarf-dev : amd64 : Jammy (22.04) : Ubuntu
The libdwarf package provides a library which allows reading/consuming and writing/producing of DWARF debugging information from object files, shared libraries, and executables. . This package contains developer resources for libdwarf. Install it if you want to develop software that uses the ...