RE: libtool is not wanting to play nicely with cross compiler

2015-04-07 Thread Andy Falanga (afalanga)
> -Original Message-
> From: Bob Friesenhahn [mailto:bfrie...@simple.dallas.tx.us]
> Sent: Tuesday, April 07, 2015 7:26 AM
> To: Andy Falanga (afalanga)
> Cc: libtool@gnu.org
> Subject: Re: libtool is not wanting to play nicely with cross compiler
> 
> On Mon, 6 Apr 2015, Andy Falanga (afalanga) wrote:
> 
> > I'm working on compiling some code for an ARM processor on a Xilinx
> > board.  I did not do the work of configuring the cross compiler and
> so
> > am ignorant about some parts of this process.
> 
> I recommend reading the Autoconf manual as pertains to cross-
> compilation.
> 
> How are your cross-tools named?  Tool naming is important.
> 
> What are the arguments that you passed to configure?

Sorry, I should have supplied them in the email.  Here they are:

CPPFLAGS=-I/src/afalanga/crisscross/tmp/sysroots/zc706-zynq7/usr/include/python2.7
 LDFLAGS=-L/src/afalanga/crisscross/tmp/sysroots/zc706-zynq7/usr/lib 
LIBS=-lpython2.7 ./configure --build=x86_64-linux --host=arm-poky-linux-gnueabi

The extra stuff in CPPFLAGS, LDFLAGS and LIBS is needed in order for the 
boost.m4 macro 
system I'm using for finding Boost libraries to find python which was built by 
yocto.


> 
> > I've finally gotten my configure script to complete and was running
> > the main compilation when I ran into this error:
> >
> > libtool: link: warning:
> > `/src/afalanga/crisscross/tmp/sysroots/zc706-
> zynq7/usr/lib/libstdc++.l
> > a' seems to be moved
> > libtool: link: warning:
> > `/src/afalanga/crisscross/tmp/sysroots/zc706-
> zynq7/usr/lib/libstdc++.l
> > a' seems to be moved
> > libtool: link: warning:
> > `/src/afalanga/crisscross/tmp/sysroots/zc706-
> zynq7/usr/lib/libstdc++.l
> > a' seems to be moved
> > /bin/grep: /usr/lib/libstdc++.la: No such file or directory
> > /bin/sed: can't read /usr/lib/libstdc++.la: No such file or directory
> > libtool: link: `/usr/lib/libstdc++.la' is not a valid libtool archive
> 
> The .la files are just text files which libtool uses to remember build
> information to be re-used when using the associated library.  The
> complaint about being moved is because these files are located in a
> different place than when they were originally installed (by whoever
> built/packaged them).  The .la file contains paths which are not
> correct for your current library installation.

I had read other posts about this problem, or warning message, and that
this is the reason for why.  I figured that the path as specified in
libstdc++.la was fine because that path is what's put into the image put
on the Xilinx board.  In other words, I know the path isn't correct for
the build system, but it correct for the host system.  Perhaps my
understanding is incorrect.

> 
> >
> > However, it seems that libtool decides that it will look in
> '/uar/lib'
> > for libstdc++.la anyway and ignore that it found the file where it
> was
> > told it would.  Well, just as is indicated, there isn't a
> libstdc++.la
> > file in '/usr/lib'.  How do I make libtool happy with the la archive
> > (is that what they're called) that it should be using?
> 
> Libtool does work for cross-compilation mode but tools must be named
> appropriately, autoconf arguments must be supplied appropriately, and
> the build toolchain needs to be smart enough to use its own sysroot for
> cross-compilation rather than accidentally using host system
> libraries/headers.

I do question if this is the case.  As the build is scrolling by, I see
paths to the local, build, system root rather than the sysroot as you
stated.

> 
> Not every configure script is appropriately prepared for cross-
> compilation since some tests are impossible when cross-compiling and so
> appropriate defaults need to be supplied.

What is it that I must ensure is done properly?

Andy

___
https://lists.gnu.org/mailman/listinfo/libtool


Re: libtool is not wanting to play nicely with cross compiler

2015-04-07 Thread Bob Friesenhahn

On Mon, 6 Apr 2015, Andy Falanga (afalanga) wrote:

I'm working on compiling some code for an ARM processor on a Xilinx 
board.  I did not do the work of configuring the cross compiler and 
so am ignorant about some parts of this process.


I recommend reading the Autoconf manual as pertains to 
cross-compilation.


How are your cross-tools named?  Tool naming is important.

What are the arguments that you passed to configure?

I've finally gotten my configure script to complete and was running 
the main compilation when I ran into this error:


libtool: link: warning: 
`/src/afalanga/crisscross/tmp/sysroots/zc706-zynq7/usr/lib/libstdc++.la' seems 
to be moved
libtool: link: warning: 
`/src/afalanga/crisscross/tmp/sysroots/zc706-zynq7/usr/lib/libstdc++.la' seems 
to be moved
libtool: link: warning: 
`/src/afalanga/crisscross/tmp/sysroots/zc706-zynq7/usr/lib/libstdc++.la' seems 
to be moved
/bin/grep: /usr/lib/libstdc++.la: No such file or directory
/bin/sed: can't read /usr/lib/libstdc++.la: No such file or directory
libtool: link: `/usr/lib/libstdc++.la' is not a valid libtool archive


The .la files are just text files which libtool uses to remember build 
information to be re-used when using the associated library.  The 
complaint about being moved is because these files are located in a 
different place than when they were originally installed (by whoever 
built/packaged them).  The .la file contains paths which are not 
correct for your current library installation.


libtool is pointed in the right direction because the file 
libstdc++.la, in the directory indicated, is the one it should be 
using for cross compilation.  However, the file contains this:


libdir='/usr/lib'

I know this is the source of the warning, but why would I be getting 
the warning?  If my understanding is correct, the stuff in this 
directory is made into the image what it placed onto the embedded 
system.  Thus, when that OS is running, libstdc++.la would actually 
be in '/usr/lib'.


However, it seems that libtool decides that it will look in 
'/uar/lib' for libstdc++.la anyway and ignore that it found the file 
where it was told it would.  Well, just as is indicated, there isn't 
a libstdc++.la file in '/usr/lib'.  How do I make libtool happy with 
the la archive (is that what they're called) that it should be 
using?


Libtool does work for cross-compilation mode but tools must be named 
appropriately, autoconf arguments must be supplied appropriately, and 
the build toolchain needs to be smart enough to use its own sysroot 
for cross-compilation rather than accidentally using host system 
libraries/headers.


Not every configure script is appropriately prepared for 
cross-compilation since some tests are impossible when cross-compiling 
and so appropriate defaults need to be supplied.


Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/

___
https://lists.gnu.org/mailman/listinfo/libtool