Libelf is a library for handling ELF (Executable and Linkable Format) files.
Libelf is part of the elfutils-0.194 package. Use the elfutils-0.194.tar.bz2 file as the source tarball.
Prepare Libelf for compilation:
./configure --prefix=/usr \
--disable-debuginfod \
--enable-libdebuginfod=dummy
Compile only Libelf:
make -C lib make -C libelf
To test the results, issue:
make -k check
The above command builds the utilities part of the package as well as the unit tests. Two tests are known to fail: dwarf_srclang_check and run-backtrace-native-core.sh.
Install only Libelf:
make -C libelf install install -vm644 config/libelf.pc /usr/lib/pkgconfig rm /usr/lib/libelf.a