8.48. Libelf from Elfutils-0.186

Libelf is a library for handling ELF (Executable and Linkable Format) files.

Approximate build time: 0.9 SBU
Required disk space: 115 MB

8.48.1. Installation of Libelf

Libelf is part of elfutils-0.186 package. Use the elfutils-0.186.tar.bz2 as the source tarball.

Prepare Libelf for compilation:

./configure --prefix=/usr                \
            --disable-debuginfod         \
            --enable-libdebuginfod=dummy

Compile the package:

make

To test the results, issue:

make check

Install only Libelf:

make -C libelf install
install -vm644 config/libelf.pc /usr/lib/pkgconfig
rm /usr/lib/libelf.a

8.48.2. Installation of Libelf - 32bit

Clean previous build:

make distclean

Prepare Libtool for compilation:

CC="gcc -m32" ./configure \
    --host=i686-pc-linux-gnu \
    --prefix=/usr            \
    --libdir=/usr/lib32      \
    --disable-debuginfod     \
    --enable-libdebuginfod=dummy

Compile the package:

make

Install the package:

make DESTDIR=$PWD/DESTDIR -C libelf install
install -vDm644 config/libelf.pc DESTDIR/usr/lib32/pkgconfig/libelf.pc
cp -Rv DESTDIR/usr/lib32/* /usr/lib32
rm -rf DESTDIR

8.48.3. Installation of Libelf - x32bit

Clean previous build:

make distclean

Prepare Libtool for compilation:

CC="gcc -mx32" ./configure \
    --host=x86_64-pc-linux-gnux32 \
    --prefix=/usr                 \
    --libdir=/usr/libx32          \
    --disable-debuginfod          \
    --enable-libdebuginfod=dummy

Compile the package:

make

Install the package:

make DESTDIR=$PWD/DESTDIR -C libelf install
install -vDm644 config/libelf.pc DESTDIR/usr/libx32/pkgconfig/libelf.pc
cp -Rv DESTDIR/usr/libx32/* /usr/libx32
rm -rf DESTDIR

8.48.4. Contents of Libelf

Installed Library: libelf.so (symlink) and libelf-0.186.so
Installed Directory: /usr/include/elfutils

Short Descriptions

libelf

Contains API functions to handle ELF object files