|
From: Bart V. A. <bar...@gm...> - 2009-05-09 19:33:24
|
On Fri, May 8, 2009 at 3:14 PM, Naveen Kumar <g_n...@ya...> wrote: > I am trying to run valgrind on my target platform(PPC/440) after cross compiling it and its gives a seg fault. I ran strace but it doesnt give any meaningful info as it faults after the very first execve call. I am guessing this has something to do with the load address of valgrind. Is there any way I can debug this a bit more ?? My configure options are as follows > > ./configure --prefix=/usr/local/valgrind --host=powerpc-montavista-linux --build=i386-redhat-linux AR=/opt/montavista/cge/devkit/ppc/440/bin/ppc_440-ar CC=/opt/montavista/cge/devkit/ppc/440/bin/ppc_440-gcc CXX=/opt/montavista/cge/devkit/ppc/440/bin/ppc_440-g++ LD=/opt/montavista/cge/devkit/ppc/440/bin/ppc_440-ld RANLIB=/opt/montavista/cge/devkit/ppc/440/bin/ppc_440-ranlib LDFLAGS="-L/opt/montavista/cge/devkit/ppc/440/target/usr/lib" > > The build itself looks fine and I dont see any build errors or anything amiss. On another note I had long back compiled valgrind directly on target and it had executed fine that time. I am just curious to see why the cross compiling method does not work. Cross-compilation of Valgrind works fine for many other Valgrind users so the segmentation fault you see might be caused by the environment you are using. Not that it matters, but I have been wondering why the variable LDFLAGS has been specified during cross-compilation ? The path specified above should be the default of the cross-compiler. By the way, since you are running Valgrind from another path on the target than the one it is installed to you will have to specify --prefix=/mnt/package/usr/local/valgrind at configure time and DESTDIR=/usr/local/valgrind at "make install" time. This has already been explained several times by Tom Hughes on the Valgrind users mailing list. See e.g. http://article.gmane.org/gmane.comp.debugging.valgrind/8213. Verifying whether Valgrind has been linked correctly and at which address it will be loaded is possible as follows (produces the same output as ldd): /lib/ld-linux.so.2 --list /path/to/valgrind Bart. |