1
votes

I've been trying so hard to run valgrind on my embedded system which has /proc/cpuinfo

And we're using bcm47081 (broadcom wireless chipset) which is cortex a9

# cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 0 (v7l)
BogoMIPS        : 1599.07
Features        : swp half thumb fastmult edsp 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

Hardware : Northstar Prototype Revision : 0000 Serial : 0000000000000000

and

 uname -a
Linux Air4920 2.6.36.4brcmarm+ #2 PREEMPT Mon May 29 23:20:54 +03 2017 armv7l GNU/Linux

Even though I've been able to build valgrind see valgrind --help works on my embedded system , it gives me illegal instruction error..

Here is my configuration options.


    ../../configure  --host="arm-linux" \
    --build="x86_64-pc-linux-gnu" \
    --prefix="/" \
    --exec-prefix="/" 

And this is the error I get.


    # valgrind /usr/bin/hello_world 
    ==3205== Memcheck, a memory error detector
    ==3205== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
    ==3205== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
    ==3205== Command: /usr/bin/hello_world
    ==3205== 
    ==3205== 
    ==3205== Process terminating with default action of signal 4 (SIGILL)
    ==3205==  Illegal opcode at address 0x3807E648
    ==3205==    at 0x4000E00: _start (in /lib/ld-uClibc.so.0)
    ==3205== 
    ==3205== HEAP SUMMARY:
    ==3205==     in use at exit: 0 bytes in 0 blocks
    ==3205==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
    ==3205== 
    ==3205== All heap blocks were freed -- no leaks are possible
    ==3205== 
    ==3205== For counts of detected and suppressed errors, rerun with: -v
    ==3205== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
    Illegal instruction

I'm using Valgrind 3.12.0 In order to offical site they support arm.

But I have not seen any tutorial , anyone who mentioned they could run valgrind for armv7.

Any idea , config options etc. would be appreciated

Thank you. Ozan

1
I have no experience with ARM, but could you try Valgrind from the code repo valgrind.org/downloads/repository.html ?Paul Floyd
Yep I've also tried the code from repo.Ozan
Hi Ozan. I am facing the same problem. Did you get any solution for this issue?dverma

1 Answers

0
votes

Looks like your configure might be wrong, you might be compiling for another version of arm.

Try building valgrind with this instead :

--host=armv7-a

the buildroot version is build the following way

# On ARM, Valgrind only supports ARMv7, and uses the arch part of the
# host tuple to determine whether it's being built for ARMv7 or
# not. Therefore, we adjust the host tuple to specify we're on
# ARMv7. The valgrind package is guaranteed, through Config.in, to
# only be selected on ARMv7-A platforms.
ifeq ($(BR2_ARM_CPU_ARMV7A),y)
VALGRIND_CONF_OPTS += \
    --host=$(patsubst arm-%,armv7-%,$(GNU_TARGET_NAME))
endif

from https://git.buildroot.net/buildroot/tree/package/valgrind/valgrind.mk