Package: valgrind Version: 1:3.11.0-1 Severity: normal I'm rebuilding PETSc (petsc-dev 3.6.1). During build configuration, it says that building petsc with valgrind support is HIGHLY recommended, and they provide simple configuration flags to do so.
petsc with valgrind support switched on compiles successfully but fails on linking, with the error: /usr/bin/ld: /usr/lib/valgrind/libcoregrind-amd64-linux.a(libcoregrind_amd64_linux_a-m_main.o): relocation R_X86_64_32S against `vgPlain_interim_stack' can not be used when making a shared object; recompile with -fPIC /usr/lib/valgrind/libcoregrind-amd64-linux.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status The petsc configuration adds the -fPIC flag, so I think the error indicates that valgrind has not been build with -fPIC. petsc has an option to switch off -fPIC, but it refuses to apply that to a shared library build. There's some technical reading at http://people.redhat.com/drepper/dsohowto.pdf which says -fPIC should always be used with shared libraries. Ought valgrind therefore be built using the -fPIC flag? Cheers, Drew -- System Information: Debian Release: stretch/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.2.0-1-amd64 (SMP w/8 CPU cores) Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages valgrind depends on: ii libc6 2.19-22 ii libc6-dbg 2.19-22 Versions of packages valgrind recommends: ii gdb 7.10-1 ii valgrind-dbg 1:3.11.0-1 Versions of packages valgrind suggests: pn alleyoop <none> pn kcachegrind <none> ii valgrind-mpi 1:3.11.0-1 pn valkyrie <none> -- no debconf information