Re: [Valgrind-users] Building and Installing vlagrind 3.15.0 in an embedded Linux cross-compile environment

2019-10-16 Thread John Knight
Thanks Pat for this info.  I hadn't read the README_DEVELOPERS file... I guess 
I should have!

John

-Original Message-
From: Patrick J. LoPresti 
Sent: Tuesday, October 15, 2019 6:12 PM
To: John Knight 
Cc: valgrind-users@lists.sourceforge.net
Subject: Re: [Valgrind-users] Building and Installing vlagrind 3.15.0 in an 
embedded Linux cross-compile environment

> If I run strings against the valgrind binary, I see the full pathname to 
> valgrinds library …/output/debug/valgrind/install/lib/valgrind which of 
> course is not right, it needs to be /lib/valgrind.

FWIW, I have had no problem relocating a Valgrind installation tree and then 
setting the VALGRIND_LIB environment variable so it can find its support files.

This is (sort of) documented in the README_DEVELOPERS file in the distribution.

 - Pat

__ Confidential 
This e-mail and any files transmitted with it are the property of Belkin 
International, Inc. and/or its affiliates, are confidential, and are intended 
solely for the use of the individual or entity to whom this e-mail is 
addressed. If you are not one of the named recipients or otherwise have reason 
to believe that you have received this e-mail in error, please notify the 
sender and delete this message immediately from your computer. Any other use, 
retention, dissemination, forwarding, printing or copying of this e-mail is 
strictly prohibited. Pour la version française: 
http://www.belkin.com/email-notice/French.html Für die deutsche Übersetzung: 
http://www.belkin.com/email-notice/German.html 
__

___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] Building and Installing vlagrind 3.15.0 in an embedded Linux cross-compile environment

2019-10-15 Thread Patrick J. LoPresti
> If I run strings against the valgrind binary, I see the full pathname to 
> valgrinds library …/output/debug/valgrind/install/lib/valgrind which of 
> course is not right, it needs to be /lib/valgrind.

FWIW, I have had no problem relocating a Valgrind installation tree
and then setting the VALGRIND_LIB environment variable so it can find
its support files.

This is (sort of) documented in the README_DEVELOPERS file in the distribution.

 - Pat


___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] Building and Installing vlagrind 3.15.0 in an embedded Linux cross-compile environment

2019-10-15 Thread John Reiser

I am having some issues with the valgrind 3.15.0 build and install in a 
cross-compile environment where the resultant code is to run on a router which 
is embedded Linux.


You must create an absolute path name (starts with '/') that is the same
(as a character string) on the machine which does the cross-compiling
as on the target embedded environment.  Use that as --prefix= for ./configure .

On both machines that path will be a symlink ("ln -s").  On the cross-
compiling machine, set the symlink to be some directory that you can write;
such as:
mkdir $HOME/cross-valgrind-output
ln -s $HOME/cross-valgrind-output /common/absolute/pathname
and check via
ls -l /common/absolute/pathname  # on the cross-compiling machine
  /common/absolute/pathname -> $HOME/cross-valgrind-output

In the image being created for the target embedded environment,
set the symlink to be some directory such as:
ln -s /opt/valgrind /common/absolute/pathname
and check via
ls -l /common/absolute/pathname  # in the target embedded environment
  /common/absolute/pathname -> /opt/valgrind
As part of building the target embedded image, then copy the directory tree(s)
from $HOME/cross-valgrind-output/* to the image directory /opt/valgrind/ .


[Notice that this would be simpler if "--prefix=/opt/valgrind".
If you do not have permissions to "mkdir /opt/valgrind" on the cross-compiling
machine, then procure a second-hand x86_64 box, install your favorite
linux distribution on it, and use that box to do the cross-compiling.]


___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


[Valgrind-users] Building and Installing vlagrind 3.15.0 in an embedded Linux cross-compile environment

2019-10-15 Thread John Knight
Hi all,

I am having some issues with the valgrind 3.15.0 build and install in a 
cross-compile environment where the resultant code is to run on a router which 
is embedded Linux.

In this environment, the build tools are cross compiled… meaning that the 
target CPU is an arm v7 processor, which differs from the Linux PC processor 
that is compiling the code.  The buildtools are arm-openwrt-linux.  When I try 
to build the code, the configure script errors out with the message “checking 
for a supported CPU… no (arm)” followed by “confiure: error: Unsupported host 
architecture. Sorry”.  Looking and configure, there is a case statement based 
on “$host-cpu” and it is specifically looking for armv7*, not arm.  If I edit 
the configure script and change the armv7 to arm it will build OK, so I can in 
fact work around this… but I will need to patch this to apply my workaround.  
The build tools we use have been used for armv7 processors for some time now, 
and we cannot change the name to accommodate valgrind.

The second issue I am having I do not have a workaround, so I am hoping someone 
can help.  When I run configure, normally we would provide a –prefix parameter 
that would tell where to put the output for the install.  Being an imbedded 
product, we do not put the output in a directory that contains the native Linux 
PC build tools which are PC 386 processor based.  Instead, the installation 
directory is a temporary directory to contain all of the output from the build… 
then when building the image, they are relocated to the final install location. 
 For valgrind for example, valgrind executable would be stored at 
…/output/debug/valgrind/install/bin directory and its library would be stored 
at …/output/debug/valgrind/install/lib directory.  Now in the README file, I 
see at the bottom of it… “Important!  Do not move the valgrind installation 
into a place different from that specified by –prefix at build time.  This will 
cause things to break in subtle ways, mostly when valgrind handles fork/exec 
files.”  So, in the routers image, if I specify the prefix needed to build the 
image so that the build system can correctly collect the binaries, I specify 
–prefix as …/output/debug/valgrind/install, but it appears that valgrind binary 
will use this as the pathname to find its library and of course, there is no 
…/output/debug/valgrind/install/lib directory on the router… the target 
directory needs to be /lib on the router.  If I run strings against the 
valgrind binary, I see the full pathname to valgrinds library 
…/output/debug/valgrind/install/lib/valgrind which of course is not right, it 
needs to be /lib/valgrind.

I have noticed if I do ./configure –help, it spits out help for other commands 
to be used as refinement for install directories instead of –prefix.  However, 
if I specify –libdir=$(PACKAGE_INSTALL)/lib, where PACKAGE_INSTALL is my 
…/output/debug/valgrind/install directory, I get the same results as I would 
get had I set –prefix=$(PACKAGE_INSTALL).  The strings valgrind tells the story.

So, it looks to me that the install mechanism is very inflexible when it comes 
to cross-compile environment.  If I do not specify –prefix, make install will 
fail with the error:  /bin/mkdir -p ‘/usr/local/lib/valgrind’ /bin/mkdir: 
cannot create directory ‘/usr/local/lib/valgrind’: Permission denied.  The 
build environment will not work properly if the files are stored outside of the 
build workspace.  This would also pollute my cross-compile build tools.

As it is now, I cannot integrate valgrind into the embedded Linux image.  Not 
sure how to overcome this issue. Does anyone have a suggestion for working 
around this issue?

Thanks for any and all help.

Regards,
John


__ Confidential 
This e-mail and any files transmitted with it are the property of Belkin 
International, Inc. and/or its affiliates, are confidential, and are intended 
solely for the use of the individual or entity to whom this e-mail is 
addressed. If you are not one of the named recipients or otherwise have reason 
to believe that you have received this e-mail in error, please notify the 
sender and delete this message immediately from your computer. Any other use, 
retention, dissemination, forwarding, printing or copying of this e-mail is 
strictly prohibited. Pour la version française: 
http://www.belkin.com/email-notice/French.html Für die deutsche Übersetzung: 
http://www.belkin.com/email-notice/German.html 
__
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users