Cross Compile Valgrind on ARMv7 Error

3,170 views
Skip to first unread message

syazatul maryam azhar

unread,
Feb 7, 2011, 3:57:25 AM2/7/11
to panda...@googlegroups.com
Hi,

I'm getting this error while trying to cross compile valgrind for PandaBoard (armv7 architecture).

m_debuglog.c: In function ‘add_to_buf’:
m_debuglog.c:242: error: unknown register name ‘r7’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r2’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r1’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r0’ in ‘asm’
m_debuglog.c: In function ‘vgPlain_debugLog’:
m_debuglog.c:261: error: unknown register name ‘r7’ in ‘asm’
m_debuglog.c:261: error: unknown register name ‘r0’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r7’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r2’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r1’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r0’ in ‘asm’


This is my configure options:

./configure --prefix=/opt/valgrind --host=armv7-none-linux-
gnueabi --target=arm-none-linux-gnueabi

It failed in the make process. Does anyone have some ideas about these errors? Thanks a lot.

Regards,
Fairuz

Joshi, Vikas

unread,
Feb 7, 2011, 6:53:29 AM2/7/11
to panda...@googlegroups.com

Pandaboard is ARM Cortex A9 based.

 


Gordan Bobic

unread,
Feb 7, 2011, 7:01:04 AM2/7/11
to panda...@googlegroups.com
Isn't Cortex A9 an ARMv7 architecture processor?

Joshi, Vikas wrote:
> Pandaboard is ARM Cortex A9 based.
>
>
>

> ------------------------------------------------------------------------
>
> *From:* panda...@googlegroups.com [mailto:panda...@googlegroups.com]
> *On Behalf Of *syazatul maryam azhar
> *Sent:* Monday, February 07, 2011 2:27 PM
> *To:* panda...@googlegroups.com
> *Subject:* [pandaboard] Cross Compile Valgrind on ARMv7 Error


>
>
>
> Hi,
>
> I'm getting this error while trying to cross compile valgrind for
> PandaBoard (armv7 architecture).
>

> m_debuglog.c: In function �add_to_buf�:
> m_debuglog.c:242: error: unknown register name �r7� in �asm�
> m_debuglog.c:242: error: unknown register name �r2� in �asm�
> m_debuglog.c:242: error: unknown register name �r1� in �asm�
> m_debuglog.c:242: error: unknown register name �r0� in �asm�
> m_debuglog.c: In function �vgPlain_debugLog�:
> m_debuglog.c:261: error: unknown register name �r7� in �asm�
> m_debuglog.c:261: error: unknown register name �r0� in �asm�
> m_debuglog.c:242: error: unknown register name �r7� in �asm�
> m_debuglog.c:242: error: unknown register name �r2� in �asm�
> m_debuglog.c:242: error: unknown register name �r1� in �asm�
> m_debuglog.c:242: error: unknown register name �r0� in �asm�

Joshi, Vikas

unread,
Feb 7, 2011, 8:28:46 AM2/7/11
to panda...@googlegroups.com
It is.

I was thinking of pulling the code and compiling to see if the errors can be replicated.

Vikas
________________________________________
From: panda...@googlegroups.com [panda...@googlegroups.com] On Behalf Of Gordan Bobic [gor...@bobich.net]
Sent: Monday, February 07, 2011 6:01 AM
To: panda...@googlegroups.com
Subject: Re: [pandaboard] Cross Compile Valgrind on ARMv7 Error

Isn't Cortex A9 an ARMv7 architecture processor?

Joshi, Vikas wrote:
> Pandaboard is ARM Cortex A9 based.
>
>
>
> ------------------------------------------------------------------------
>
> *From:* panda...@googlegroups.com [mailto:panda...@googlegroups.com]
> *On Behalf Of *syazatul maryam azhar
> *Sent:* Monday, February 07, 2011 2:27 PM
> *To:* panda...@googlegroups.com
> *Subject:* [pandaboard] Cross Compile Valgrind on ARMv7 Error
>
>
>
> Hi,
>
> I'm getting this error while trying to cross compile valgrind for
> PandaBoard (armv7 architecture).
>

> m_debuglog.c: In function ‘add_to_buf’:
> m_debuglog.c:242: error: unknown register name ‘r7’ in ‘asm’
> m_debuglog.c:242: error: unknown register name ‘r2’ in ‘asm’
> m_debuglog.c:242: error: unknown register name ‘r1’ in ‘asm’
> m_debuglog.c:242: error: unknown register name ‘r0’ in ‘asm’
> m_debuglog.c: In function ‘vgPlain_debugLog’:

> m_debuglog.c:261: error: unknown register name ‘r7’ in ‘asm’
> m_debuglog.c:261: error: unknown register name ‘r0’ in ‘asm’
> m_debuglog.c:242: error: unknown register name ‘r7’ in ‘asm’
> m_debuglog.c:242: error: unknown register name ‘r2’ in ‘asm’
> m_debuglog.c:242: error: unknown register name ‘r1’ in ‘asm’
> m_debuglog.c:242: error: unknown register name ‘r0’ in ‘asm’

syazatul maryam azhar

unread,
Feb 7, 2011, 9:14:16 AM2/7/11
to panda...@googlegroups.com
For more information, i'm compiling valgrind with codesourcery toolchain and I've set these env variables.

CC=arm-none-linux-gnueabi-gcc
CXX=arm-none-linux-gnueabi-g++
AR=arm-none-linux-gnueabi-ar
CFLAGS="-pipe -Os -mtune=cortex-a8 -march=armv7-a -mabi=aapcs-linux -msoft-float -I<path_to_CodeSourcery>/arm-none-linux-gnueabi/libc/usr/include"
LDFLAGS="-L<path_to_CodeSourcery>/arm-none-linux-gnueabi/libc/usr/lib"



The error come from here :

#elif defined(VGP_arm_linux)

static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
   volatile Int block[2];
   block[0] = (Int)buf;
   block[1] = n;
   __asm__ volatile (
      "mov  r0, #1\n\t"
      "ldr  r1, [%0]\n\t"
      "ldr  r2, [%0, #4]\n\t"
      "mov  r7, #"VG_STRINGIFY(__NR_write)"\n\
t"
      "svc  0x0\n"          /* write() */
      "str  r0, [%0]\n\t"
      :
      : "r" (block)
      : "r0","r1","r2","r7"
   );
   if (block[0] < 0)
      block[0] = -1;
   return (UInt)block[0];
}

Does this mean that valgrind suppose that it compiling on an ARM machine?




and this is the output of ./configure

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for armv7-none-linux-gnueabi-
strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether ln -s works... yes
checking for armv7-none-linux-gnueabi-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for armv7-none-linux-gnueabi-g++... no
checking for armv7-none-linux-gnueabi-c++... no
checking for armv7-none-linux-gnueabi-gpp... no
checking for armv7-none-linux-gnueabi-aCC... no
checking for armv7-none-linux-gnueabi-CC... no
checking for armv7-none-linux-gnueabi-cxx... no
checking for armv7-none-linux-gnueabi-cc++... no
checking for armv7-none-linux-gnueabi-cl.exe... no
checking for armv7-none-linux-gnueabi-FCC... no
checking for armv7-none-linux-gnueabi-KCC... no
checking for armv7-none-linux-gnueabi-RCC... no
checking for armv7-none-linux-gnueabi-xlC_r... no
checking for armv7-none-linux-gnueabi-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for armv7-none-linux-gnueabi-ranlib... no
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for perl... /usr/bin/perl
checking for gdb... /usr/bin/gdb
checking dependency style of gcc... gcc3
checking for diff -u... yes
checking for a supported version of gcc... ok (4.4.3)
checking build system type... x86_64-unknown-linux-gnu
checking host system type... armv7-none-linux-gnueabi
checking for a supported CPU... ok (armv7)
checking for a 64-bit only build... no
checking for a 32-bit only build... no
checking for a supported OS... ok (linux-gnueabi)
checking for the kernel version... 2.6 family (2.6.32-23-server)
checking for a supported CPU/OS combination... ok (armv7-linux-gnueabi)
checking for use as an inner Valgrind... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking the GLIBC_VERSION version... 2.11 family
checking for CLOCK_MONOTONIC... yes
checking for PTHREAD_MUTEX_ADAPTIVE_NP... yes
checking for PTHREAD_MUTEX_ERRORCHECK_NP... yes
checking for PTHREAD_MUTEX_RECURSIVE_NP... yes
checking for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP... yes
checking for pthread_mutex_t::__m_kind... no
checking for pthread_mutex_t::__data.__kind... yes
checking for Altivec... no
checking for pthread_create@GLIBC2.0()... no
checking for eventfd()... yes
checking if gcc accepts -m32... yes
checking if gcc accepts -maix32... no
checking if gcc accepts -m64... yes
checking if gcc accepts -maix64... no
checking if gcc accepts -mmmx... yes
checking if gcc accepts -msse... yes
checking if gcc accepts -mpreferred-stack-boundary... no
checking if gcc accepts -Wno-pointer-sign... yes
checking if gcc accepts -Wno-empty-body... yes
checking if gcc accepts -Wno-format-zero-length... yes
checking if gcc accepts -Wno-uninitialized... yes
checking if gcc accepts -Wextra or -W... -Wextra
checking if gcc accepts -fno-stack-protector... yes
checking if gcc accepts --param inline-unit-growth... yes
checking if ppc32/64 as supports mtocrf/mfocrf... no
checking if x86/amd64 assembler speaks SSE3... yes
checking if x86/amd64 assembler speaks SSSE3... yes
checking for TLS support... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking asm/unistd.h usability... yes
checking asm/unistd.h presence... yes
checking for asm/unistd.h... yes
checking endian.h usability... yes
checking endian.h presence... yes
checking for endian.h... yes
checking mqueue.h usability... yes
checking mqueue.h presence... yes
checking for mqueue.h... yes
checking sys/endian.h usability... no
checking sys/endian.h presence... no
checking for sys/endian.h... no
checking sys/epoll.h usability... yes
checking sys/epoll.h presence... yes
checking for sys/epoll.h... yes
checking sys/eventfd.h usability... yes
checking sys/eventfd.h presence... yes
checking for sys/eventfd.h... yes
checking sys/klog.h usability... yes
checking sys/klog.h presence... yes
checking for sys/klog.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking sys/signal.h usability... yes
checking sys/signal.h presence... yes
checking for sys/signal.h... yes
checking sys/signalfd.h usability... yes
checking sys/signalfd.h presence... yes
checking for sys/signalfd.h... yes
checking sys/syscall.h usability... yes
checking sys/syscall.h presence... yes
checking for sys/syscall.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking for uid_t in sys/types.h... yes
checking for off_t... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking return type of signal handlers... void
checking for clock_gettime in -lrt... yes
checking for clock_gettime... yes
checking for epoll_create... yes
checking for epoll_pwait... yes
checking for floor... no
checking for klogctl... yes
checking for mallinfo... yes
checking for memchr... yes
checking for memset... yes
checking for mkdir... yes
checking for mremap... yes
checking for ppoll... yes
checking for pthread_barrier_init... yes
checking for pthread_condattr_setclock... yes
checking for pthread_mutex_timedlock... yes
checking for pthread_rwlock_timedrdlock... yes
checking for pthread_rwlock_timedwrlock... yes
checking for pthread_spin_lock... yes
checking for readlinkat... yes
checking for semtimedop... yes
checking for signalfd... yes
checking for sigwaitinfo... yes
checking for syscall... yes
checking for strchr... yes
checking for strdup... yes
checking for strpbrk... yes
checking for strrchr... yes
checking for strstr... yes
checking for timerfd... no
checking for utimensat... yes
checking primary target for usable MPI2-compliant C compiler and mpi.h... no
checking secondary target for usable MPI2-compliant C compiler and mpi.h... no
checking for armv7-none-linux-gnueabi-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for boost... no
checking for OpenMP... yes
checking if gcc supports __sync_bool_compare_and_swap... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating VEX/Makefile
config.status: creating valgrind.spec
config.status: creating valgrind.pc
config.status: creating glibc-2.X.supp
config.status: creating docs/Makefile
config.status: creating tests/Makefile
config.status: creating tests/vg_regtest
config.status: creating perf/Makefile
config.status: creating perf/vg_perf
config.status: creating include/Makefile
config.status: creating auxprogs/Makefile
config.status: creating mpi/Makefile
config.status: creating coregrind/Makefile
config.status: creating memcheck/Makefile
config.status: creating memcheck/tests/Makefile
config.status: creating memcheck/tests/amd64/Makefile
config.status: creating memcheck/tests/x86/Makefile
config.status: creating memcheck/tests/linux/Makefile
config.status: creating memcheck/tests/darwin/Makefile
config.status: creating memcheck/tests/x86-linux/Makefile
config.status: creating memcheck/perf/Makefile
config.status: creating cachegrind/Makefile
config.status: creating cachegrind/tests/Makefile
config.status: creating cachegrind/tests/x86/Makefile
config.status: creating cachegrind/cg_annotate
config.status: creating callgrind/Makefile
config.status: creating callgrind/callgrind_annotate
config.status: creating callgrind/callgrind_control
config.status: creating callgrind/tests/Makefile
config.status: creating helgrind/Makefile
config.status: creating helgrind/tests/Makefile
config.status: creating massif/Makefile
config.status: creating massif/tests/Makefile
config.status: creating massif/perf/Makefile
config.status: creating massif/ms_print
config.status: creating lackey/Makefile
config.status: creating lackey/tests/Makefile
config.status: creating none/Makefile
config.status: creating none/tests/Makefile
config.status: creating none/tests/amd64/Makefile
config.status: creating none/tests/ppc32/Makefile
config.status: creating none/tests/ppc64/Makefile
config.status: creating none/tests/x86/Makefile
config.status: creating none/tests/arm/Makefile
config.status: creating none/tests/linux/Makefile
config.status: creating none/tests/darwin/Makefile
config.status: creating none/tests/x86-linux/Makefile
config.status: creating exp-ptrcheck/Makefile
config.status: creating exp-ptrcheck/tests/Makefile
config.status: creating drd/Makefile
config.status: creating drd/scripts/download-and-build-splash2
config.status: creating drd/tests/Makefile
config.status: creating exp-bbv/Makefile
config.status: creating exp-bbv/tests/Makefile
config.status: creating exp-bbv/tests/x86/Makefile
config.status: creating exp-bbv/tests/x86-linux/Makefile
config.status: creating exp-bbv/tests/amd64-linux/Makefile
config.status: creating exp-bbv/tests/ppc32-linux/Makefile
config.status: creating exp-bbv/tests/arm-linux/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

         Maximum build arch: arm
         Primary build arch: arm
       Secondary build arch:
                   Build OS: linux
       Primary build target: ARM_LINUX
     Secondary build target:
         Default supp files: exp-ptrcheck.supp xfree-3.supp xfree-4.supp glibc-2.X-drd.supp glibc-2.34567-NPTL-helgrind.supp glibc-2.X.supp


Wan Mohd Fairuz Wan Ismail

unread,
Feb 7, 2011, 7:13:34 AM2/7/11
to panda...@googlegroups.com
Yes, Cortex A9 is an ARMv7 architecture processor.


For more information, i'm compiling valgrind with codesourcery toolchain and I've set these env variables.

CC=arm-none-linux-gnueabi-gcc
CXX=arm-none-linux-gnueabi-g++
AR=arm-none-linux-gnueabi-ar
CFLAGS="-pipe -Os -mtune=cortex-a8 -march=armv7-a -mabi=aapcs-linux -msoft-float -I<path_to_CodeSourcery>/arm-none-linux-gnueabi/libc/usr/include"
LDFLAGS="-L<path_to_CodeSourcery>/arm-none-linux-gnueabi/libc/usr/lib"


and this is the output of ./configure

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for armv7-none-linux-gnueabi-strip... no
On Mon, Feb 7, 2011 at 1:01 PM, Gordan Bobic <gor...@bobich.net> wrote:
Isn't Cortex A9 an ARMv7 architecture processor?


Joshi, Vikas wrote:
Pandaboard is ARM Cortex A9 based.

 
------------------------------------------------------------------------

*From:* panda...@googlegroups.com [mailto:panda...@googlegroups.com] *On Behalf Of *syazatul maryam azhar
*Sent:* Monday, February 07, 2011 2:27 PM
*To:* panda...@googlegroups.com
*Subject:* [pandaboard] Cross Compile Valgrind on ARMv7 Error

 
Hi,

I'm getting this error while trying to cross compile valgrind for PandaBoard (armv7 architecture).

m_debuglog.c: In function ‘add_to_buf’:
m_debuglog.c:242: error: unknown register name ‘r7’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r2’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r1’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r0’ in ‘asm’
m_debuglog.c: In function ‘vgPlain_debugLog’:
m_debuglog.c:261: error: unknown register name ‘r7’ in ‘asm’
m_debuglog.c:261: error: unknown register name ‘r0’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r7’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r2’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r1’ in ‘asm’
m_debuglog.c:242: error: unknown register name ‘r0’ in ‘asm’



This is my configure options:

./configure --prefix=/opt/valgrind --host=armv7-none-linux-

gnueabi --target=arm-none-linux-gnueabi

It failed in the make process. Does anyone have some ideas about these errors? Thanks a lot.

Regards,
Fairuz





--
Wan Mohd Fairuz WAN ISMAIL
Masters in Electronics Engineering,
Majoring in Embedded System Engineering,
Polytech Nice Sophia Antipolis, FRANCE.

+33(0)643461339
+60172071591
15 Le Palais des Fleurs,
74 Boulevard Raymond Poincare,
06160 Juan les Pins, FRANCE.
http://www.watt.com.my

Wan Mohd Fairuz Wan Ismail

unread,
Feb 7, 2011, 9:04:36 AM2/7/11
to panda...@googlegroups.com
The error come from here :

#elif defined(VGP_arm_linux)

static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
   volatile Int block[2];
   block[0] = (Int)buf;
   block[1] = n;
   __asm__ volatile (
      "mov  r0, #1\n\t"
      "ldr  r1, [%0]\n\t"
      "ldr  r2, [%0, #4]\n\t"
      "mov  r7, #"VG_STRINGIFY(__NR_write)"\n\t"
      "svc  0x0\n"          /* write() */
      "str  r0, [%0]\n\t"
      :
      : "r" (block)
      : "r0","r1","r2","r7"
   );
   if (block[0] < 0)
      block[0] = -1;
   return (UInt)block[0];
}

Does this mean that valgrind suppose that it compiling on an ARM machine?



On Mon, Feb 7, 2011 at 2:28 PM, Joshi, Vikas <v-jo...@ti.com> wrote:

syazatul maryam azhar

unread,
Feb 7, 2011, 10:27:13 AM2/7/11
to panda...@googlegroups.com
I make the problem disappeared by modifying the configure.in file. I changed armv7* to arm*. BTW, I have other errors =)

arm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -DVGA_arm=1 -DVGO_linux=1 -DVGP_arm_linux=1 -I../coregrind -DVG_LIBDIR="\"/home/x0152532/valgrind/lib/valgrind"\" -DVG_PLATFORM="\"arm-linux\""  -I.. -I../include -I../VEX/pub -DVGA_arm=1 -DVGO_linux=1 -DVGP_arm_linux=1 -I../coregrind -DVG_LIBDIR="\"/home/x0152532/valgrind/lib/valgrind"\" -DVG_PLATFORM="\"arm-linux\""  -g -Wno-long-long -MT libcoregrind_arm_linux_a-dispatch-arm-linux.o -MD -MP -MF .deps/libcoregrind_arm_linux_a-dispatch-arm-linux.Tpo -c -o libcoregrind_arm_linux_a-dispatch-arm-linux.o `test -f 'm_dispatch/dispatch-arm-linux.S' || echo './'`m_dispatch/dispatch-arm-linux.S

m_dispatch/dispatch-arm-linux.S: Assembler messages:
m_dispatch/dispatch-arm-linux.S:61: Error: selected processor does not support `fmxr fpscr,r4'
m_dispatch/dispatch-arm-linux.S:217: Error: selected processor does not support `fmrx r4,fpscr'
make[3]: *** [libcoregrind_arm_linux_a-dispatch-arm-linux.o] Error 1
make[3]: Leaving directory `/home/x0152532/sources/valgrind-3.6.0~svn20100212/coregrind'

Any ideas? thanks a lot.


On Mon, Feb 7, 2011 at 3:47 PM, syazatul maryam azhar <sya...@gmail.com> wrote:
Hi again,

I look up the Makefile generated by configure and found that the value of CC is gcc and not arm-none-linux-gnueabi-gcc. Is this normal?

syazatul maryam azhar

unread,
Feb 7, 2011, 9:47:13 AM2/7/11
to panda...@googlegroups.com
Hi again,

I look up the Makefile generated by configure and found that the value of CC is gcc and not arm-none-linux-gnueabi-gcc. Is this normal?

On Mon, Feb 7, 2011 at 3:14 PM, syazatul maryam azhar <sya...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages