linuxarmcross-compilingvalgrindmemcheck

Valgrind ARM binary not working in ARM926EJ, giving error as not found


Problem: Not able to run Valgrind binary in ARM.


I cross compiled the Valgrind-3-13-0 successfully in Linux host. And I moved the binaries to my ARM target. I ran Valgrind in the arm it says not found.

Steps to cross-compile

During the build process, I poked the configure file, changed armv7 as arm.

./configure --host=arm-none-linux-gnueabi --prefix=/home/my_dir

and I tried this option as well

 ./configure --target=arm-none-linux-gnueabi --host=arm-none-linux-gnueabi --prefix=/my_dir

then make and make install.

I see Valgrind is located in my root file system /usr/bin, wondering why its saying not found.


This is the final output from the Valgrind cross-compilation. Below is just tree of my install dir.

target_val/
├── bin
├── include
│   └── valgrind
│       └── vki
├── lib
│   ├── pkgconfig
│   └── valgrind
└── share
    ├── doc
    │   └── valgrind
    │       └── html
    │           └── images
    └── man
        └── man1

I actually copied only five files from /bin dir to my target /usr/bin.

callgrind_annotate
callgrind_control
valgrind
valgrind-di-server
valgrind-listener

Question.

Do I need to copy the entire lib dir also?

I try to run the cross-compiled binary in host

usr:~/Desktop/ ./valgrind --version
/lib/ld-linux.so.3: No such file or directory

What I expected is it will complain like this Invalid ELF image for this architecture because I built it for the arm and running it on Linux it should complain like this but it doesn't.

Wondering about configuration flags and the ARCH?


Solution

  • As soon I posted the question in StackOverflow, I found the answer in five minutes.


    Valgrind support is available from armv7.


    Actaully my hardware doesn't support Valgrind, I just got confused by Amr7 and Armv7 both are not same. Its the same goes to ARM9E is not same as AMRv9. My bad.

    I attached the arm architecture page for reference.