14

I have downloaded the sources from the Valgrind trunk and built it for using on an embedded Linux system(Montavista Linux) powered by an ARM926(ARMv5t architecture). Everything went well until I tried to run it to check some application I've made; Valgrind tells me:

"valgrind: failed to start tool 'memcheck' for platform 'arm-linux': No such file or directory".

Trying to run any other tool gives the same message. For make install I used the --prefix option pointing to the embedded system's filesystem which is mounted through NFS(e.g. --prefix=/home/NFS_mounted/opt/valgrind). I checked the installation location and the lib directory there contains the proper tools; I also checked the corresponding pkgconfig file for Valgrind and it seems to be OK so I'm kind of clueless right now and can't figure out what's going wrong. 2 questions:

  1. Is it correct to use/install a cross-compiled Valgrind like that? Maybe I'm doing something wrong regarding the setup, or maybe there is something involving the host system that I'm missing(gdb/gdbserver like).
  2. Has anyone tried running it on ARM architectures? I'm aware that the support is fairly recent so I'm wondering if I could get decent results.
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
celavek
  • 745
  • 3
  • 8
  • 11

5 Answers5

17

Run this command in your target device

export VALGRIND_LIB=~/valgrind/lib/valgrind/

where ./valgrind is installed directory path (given in ./configure)

don_crissti
  • 79,330
  • 30
  • 216
  • 245
bhargav
  • 171
  • 1
  • 3
  • Could you expand a bit? Is it the prefix given in configure? Form me valgrind is in the "coregrind" folder, should I give valgrind/coregrind? – MappaM Jan 09 '21 at 19:51
4

The problem is that 'valgrind' is looking for a different executable to run the real checking. It uses the install path you specified when you configured it, which is not the same path as on the target.

You should be able to confirm this by creating a symlink /home/NFS_mounted on your target that points to '/'.

Kristof Provost
  • 544
  • 4
  • 11
  • How does it look for that path? The pkgconfig contains the correct target path so from where does it try to take it? – celavek Sep 06 '10 at 22:23
  • I think it's compiled in. The ./configure script generates a config.h header file, which should contain the prefix path. – Kristof Provost Sep 07 '10 at 08:23
2

Put in VALGRIND_LIB the parent directory of amd64-linux directory. E.g.:

export VALGRIND_LIB=/u/gallinar/downloaded/valgrind-3.2.3/.in_place

it worked for me today :).

Hemant
  • 6,834
  • 5
  • 38
  • 42
0

VALGRIND_LIB needs to be pointing to the folder that has memcheck tool and other dependent x compiled libs

  • You're right but it shouldn't be should it? Why would valgrind executables like helgrind/memcheck be co-located with vgpreload_core-XXX.so in libs instead of the bin/ directory? At least for me 'file helgrind-arm-linux' returns ELF 32-bit LSB executable... – JoeManiaci Jun 12 '20 at 18:22
0

None of the solutions proposed worked for me, so I enabled all optional modules:

./configure --enable-only64bit --enable-inner --enable-lto --enable-tls

et voila, it worked.

Michał Leon
  • 272
  • 2
  • 10