Installation of Valgrind
First, fix a bug, which has been exposed by glibc-2.26:
sed -i '1904s/4/5/' coregrind/m_syswrap/syswrap-linux.c
Install Valgrind by running the
following commands:
sed -i 's|/doc/valgrind||' docs/Makefile.in &&
./configure --prefix=/usr \
--datadir=/usr/share/doc/valgrind-3.13.0 &&
make
Note
To run the tests for this package, valgrind requires a version of
the /lib/ld-2.26.so (or later) library with debugging symbols
present. Normally in LFS these debugging symbols are stripped at
the end of Chapter 6. To get this library, glibc must be rebuilt
with the current glibc version using the same compiler that was
used to build LFS. The ld.so can then be renamed to
ld-2.26.so.dbg and copied to /lib. Then a symlink needs to be
changed:
ln -sfv ld-2.26.so.dbg /lib/ld-linux-x86-64.so.2
Adjust the above instruction as needed for a 32-bit system or for
a different version of glibc.
In addition, other glibc libraries with debugging symbols present
may be needed for some tests.
To test the results, issue: make
regtest. The tests may hang forever if GDB-8.1 is not
installed. Some tests are known to hang also, depending on the
version of glibc. Problematic tests can be disabled by changing the
prereq:
line in the
corresponding .vgtest
file to
prereq: false
. For
example:
sed -e 's@prereq:.*@prereq: false@' \
-i {helgrind,drd}/tests/pth_cond_destroy_busy.vgtest
Note
The OpenMP tests are skipped if
libgomp has been compiled with --enable-linux-futex
(the default). If needed,
just recompile the libgomp library from the gcc build tree,
passing --disable-linux-futex
to
configure, storing the library to some place and changing the
link from /usr/lib/libgomp.so.1
to
point to the new library.
Now, as the root
user:
make install