Vous êtes sur la page 1sur 4

PREPERATORY WORK:

LATEST VESION OF PERL:


Make sure you have the latest version of perl in SJ hub( version
5.6 and above) - This is required for the "make install"
If you have lower versions,you can update using the command "mod
ule update perl"
Check the version in SJ hub using the command "perl -v"
SPECIFY THE GNU TOOL CHAIN:
Load the bash shell from the path /bin/bash
"export CC=/project/builds/rbnlinux/build_env/ppc_lc2_devboard4.3.0.1/export/sysroot/fsl_p3041-glibc_std/x86-linux2/ppc_e500mc-target-linux-gn
u-gcc"
"export LD=/project/builds/rbnlinux/build_env/ppc_lc2_devboard4.3.0.1/export/sysroot/fsl_p3041-glibc_std/x86-linux2/ppc_e500mc-target-linux-gn
u-ld"
"export CXX=/project/builds/rbnlinux/build_env/ppc_lc2_devboard
-4.3.0.1/export/sysroot/fsl_p3041-glibc_std/x86-linux2/ppc_e500mc-target-linux-g
nu-g++ "
"export AR=/project/builds/rbnlinux/build_env/ppc_lc2_devboard4.3.0.1/export/sysroot/fsl_p3041-glibc_std/x86-linux2/ppc_e500mc-target-linux-gn
u-ar"
"export CPP=/project/builds/rbnlinux/build_env/ppc_lc2_devboard
-4.3.0.1/export/sysroot/fsl_p3041-glibc_std/x86-linux2/ppc_e500mc-target-linux-g
nu-cpp"
PROCEDURE:
STEP 1 to STEP 8 in SJ Hub
STEP 1:
Download the valgrind source code from http://valgrind.org/downloads/cu
rrent.html and untar it using the command
"tar jxf valgrind-3.10.1.tar.bz2"
STEP 2:
"cd valgrind-3.10.1"
STEP 3:
(Sometimes Valgrind will abort with an error saying that it could not re
direct the glibc's strlen function.
You have to patch certain lines in valgrind-3.10.1/coregrind/m_redir.c.)
cd coregrind/
vi m_redir.c
The lines with a plus symbol in the end needs to be added
--- coregrind/m_redir.c Fri Jan 3 17:13:23 2014
*************** void VG_(redir_initialise) ( void )
*** 1212,1224 ****
--- 1212,1226 ---mandatory = complain_about_stripped_glibc_ldso;

endif
add_hardwired_spec(
"ld-linux.so.2", "index",
(Addr)&VG_(x86_linux_REDIR_FOR_index), mandat

ory);
+ #if 0
add_hardwired_spec(
"ld-linux.so.2", "strlen",
(Addr)&VG_(x86_linux_REDIR_FOR_strlen), manda
tory);
+ #endif
}
# elif defined(VGP_amd64_linux)
/* Redirect vsyscalls to local versions */
add_hardwired_active(
*************** void VG_(redir_initialise) ( void )
*** 1256,1265 ****
--- 1258,1268 ---# elif defined(VGP_ppc32_linux)
/* If we're using memcheck, use these intercepts ri
ght from
the start, otherwise ld.so makes a lot of noise.
*/
if (0==VG_(strcmp)("Memcheck", VG_(details).name))
{
+ #if 0
/* this is mandatory - can't sanely continue wit
hout it */
add_hardwired_spec(
"ld.so.1", "strlen",
(Addr)&VG_(ppc32_linux_REDIR_FOR_strlen),
complain_about_stripped_glibc_ldso
*************** void VG_(redir_initialise) ( void )
*** 1274,1283 ****
--- 1277,1287 ---"ld.so.1", "index",
(Addr)&VG_(ppc32_linux_REDIR_FOR_strchr),
NULL /* not mandatory - so why bother at all?
*/
/* glibc-2.6.1 (openSUSE 10.3, ppc32) seems f
ine without it */
);
+ #endif
}
# elif defined(VGP_ppc64_linux)
/* If we're using memcheck, use these intercepts ri
ght from
the start, otherwise ld.so makes a lot of noise.
*/
Save changes.
STEP 4:
Return from the coregrind directory.
From the directory valgrind-3.10.1

"./configure --host=powerpc-wrs-linux-gnu --prefix=/home/<your_signum>/


valgrind_lc/build "
(--the prefix is very important.Don't change the prefix after building
--host is very essential to build it for powerpc architecture
Very important:Valgrind built for SSR will not run on Line cards.)
STEP 5:
Run "make install"
STEP 6:
Stamp the valgrind with md5 checksum
"<project_directory>/pkt/sw/se/tools/release/md5release -f build/bin/val
grind"
STEP 7:
Return from the folder : "cd .."
Tar the folder valgrind_lc
"tar -czf /home/<signum>/valgrind-md5.tgz /home/<signum>/valgrind_lc"
STEP 8:
Secure copy valgrind-md5.tgz to lxapp server
"scp valgrind-md5.tgz <signum>@lxapp-2.sj.us.am.ericsson.se:/home/<signu
m>/"
STEP 9 in LXAPP server
STEP 9:
Telnet login to a SSR router
"telnet sjl3-ecp-ssr04.eld" username:test password:test
STEP 10 to STEP 14 in SSR
STEP 10:
"start shell"
STEP 11:
Enter superuser mode
"su - root" password:root
You'll be now in root directory.
Go to md directory.(sometimes copying to root directory throws an error
that there is no space available)
"cd /md"
STEP 12:
Secure copy from lxapp server to SSR
"scp <signum>@10.10.10.22:/home/<signum>/valgrind-md5.tgz ."
STEP 13:
Secure copy from SSR to LC
"scp valgrind-md5.tgz root@lc-4:/md/"

STEP 14:
SSH Login to your respective Line card
"ssh root@lc-4" password:root
STEP 15 to STEP 19 in Linecard
STEP 15:
"cd /md"
STEP 16:
Untar it
"tar -xvzf valgrind-md5.tgz"
STEP 17:
Try executing valgrind
"/md/home/<signum>/valgrind_lc/build/bin/valgrind"
if you get error like this
valgrind: failed to start tool 'memcheck' for platform 'ppc32-linux': No
such file or directory
The link must be possible broken
STEP 18:
Go to the Valgrind Library Folder
"cd /md/home/<signum>/valgrind_lc/build/lib/valgrind"
cd /md/home/esrsank/valgrind_lc/build/lib/valgrind
and then type the command
"export VALGRIND_LIB=$PWD"
STEP 19:
Execute Valgrind
"/md/home/esrsank/valgrind_lc/build/bin/valgrind"
/md/home/esrsank/valgrind_lc/build/bin/valgrind
Hope you'll get something like this
valgrind: no program specified
valgrind: Use --help for more information.
HOLA.Valgrind is now ready to use.

Vous aimerez peut-être aussi