* [Buildroot] Libraries built with buildroot can only be used by buildroot itself.
@ 2013-07-30 4:40 Woody Wu
2013-07-30 4:54 ` Alexander Lukichev
2013-07-30 6:22 ` Thomas De Schampheleire
0 siblings, 2 replies; 7+ messages in thread
From: Woody Wu @ 2013-07-30 4:40 UTC (permalink / raw)
To: buildroot
Hi,
** In below example, I will talk directfb libraries, but I am afraid it it
not specific to directfb but a more general case.
Using buildroot and BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201203, I got
build with some graphics libraries (in my case, these are direct frame
buffer libraries, i.e., BR2_PACKAGE_DIRECTFB). Then I want to use these
cross compiled libraries to cross compile my own written very simple
directfb application code.
What I did is:
crossroot=/home/woody/buildroot-2013.05/
output/host/usr/arm-buildroot-linux-gnueabi/sysroot
rm -f *.o hline
arm-none-linux-gnueabi-gcc -I ${crossroot}/usr/include/directfb \
-D_GNU_SOURCE -o hline.o -c hline.c
arm-none-linux-gnueabi-gcc -I ${crossroot}/usr/include/directfb \
-D_GNU_SOURCE -o hline hline.o -ldirectfb -L ${crossroot}/usr/lib
In case one, I set my path to use the gcc from my own Codesourcery
installation, which is the same version as that buildroot is using.
Actually, this Codesourcery installation is a direct uncompress from the
tarball that buildroot downloaded from net to its download directory.
In case two, I set my path to use the gcc directly in buildroot, i.e,
under /home/woody/buildroot-2013.05/host/usr/bin
In case two, it built with success. But case one, it did not:
/home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
/home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/libc.so.6
/home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a
/home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /usr/lib/libc_nonshared.a
/home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/ld-linux.so.3
collect2: ld returned 1 exit status
I don't understand why the error happened. It seems the cross compiler
of buildroot understood things correctly, but the same cross compiler
install by myself did not.
Can anyone please give me hint?
--
I can't go back to yesterday - because I was a different person then
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] Libraries built with buildroot can only be used by buildroot itself.
2013-07-30 4:40 [Buildroot] Libraries built with buildroot can only be used by buildroot itself Woody Wu
@ 2013-07-30 4:54 ` Alexander Lukichev
2013-07-30 9:00 ` Woody Wu
2013-07-30 6:22 ` Thomas De Schampheleire
1 sibling, 1 reply; 7+ messages in thread
From: Alexander Lukichev @ 2013-07-30 4:54 UTC (permalink / raw)
To: buildroot
Hello, Woody!
2013/7/30 Woody Wu <narkewoody@gmail.com>In case one, I set my path to use
the gcc from my own Codesourcery
> installation, which is the same version as that buildroot is using.
> Actually, this Codesourcery installation is a direct uncompress from the
> tarball that buildroot downloaded from net to its download directory.
>
> In case two, I set my path to use the gcc directly in buildroot, i.e,
> under /home/woody/buildroot-2013.05/host/usr/bin
>
> In case two, it built with success. But case one, it did not:
>
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> cannot find /lib/libc.so.6
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> skipping incompatible /usr/lib/libc_nonshared.a when searching for
> /usr/lib/libc_nonshared.a
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> cannot find /usr/lib/libc_nonshared.a
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> cannot find /lib/ld-linux.so.3
> collect2: ld returned 1 exit status
>
It looks like in case one ld installed to /home/woody/arm-2012.03 is used
to reading binaries for another architecture. Are you absolutely sure that
this is a _cross_ toolchain?
--
Best regards,
Alexander Lukichev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130730/7b6ecded/attachment.html>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] Libraries built with buildroot can only be used by buildroot itself.
2013-07-30 4:40 [Buildroot] Libraries built with buildroot can only be used by buildroot itself Woody Wu
2013-07-30 4:54 ` Alexander Lukichev
@ 2013-07-30 6:22 ` Thomas De Schampheleire
2013-07-30 8:57 ` Woody Wu
1 sibling, 1 reply; 7+ messages in thread
From: Thomas De Schampheleire @ 2013-07-30 6:22 UTC (permalink / raw)
To: buildroot
Hi,
On Tue, Jul 30, 2013 at 6:40 AM, Woody Wu <narkewoody@gmail.com> wrote:
> Hi,
>
> ** In below example, I will talk directfb libraries, but I am afraid it it
> not specific to directfb but a more general case.
>
> Using buildroot and BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201203, I got
> build with some graphics libraries (in my case, these are direct frame
> buffer libraries, i.e., BR2_PACKAGE_DIRECTFB). Then I want to use these
> cross compiled libraries to cross compile my own written very simple
> directfb application code.
>
>
> What I did is:
>
> crossroot=/home/woody/buildroot-2013.05/
> output/host/usr/arm-buildroot-linux-gnueabi/sysroot
> rm -f *.o hline
> arm-none-linux-gnueabi-gcc -I ${crossroot}/usr/include/directfb \
> -D_GNU_SOURCE -o hline.o -c hline.c
> arm-none-linux-gnueabi-gcc -I ${crossroot}/usr/include/directfb \
> -D_GNU_SOURCE -o hline hline.o -ldirectfb -L ${crossroot}/usr/lib
>
> In case one, I set my path to use the gcc from my own Codesourcery
> installation, which is the same version as that buildroot is using.
> Actually, this Codesourcery installation is a direct uncompress from the
> tarball that buildroot downloaded from net to its download directory.
>
> In case two, I set my path to use the gcc directly in buildroot, i.e,
> under /home/woody/buildroot-2013.05/host/usr/bin
>
> In case two, it built with success. But case one, it did not:
>
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/libc.so.6
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /usr/lib/libc_nonshared.a
> /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/ld-linux.so.3
> collect2: ld returned 1 exit status
>
>
> I don't understand why the error happened. It seems the cross compiler
> of buildroot understood things correctly, but the same cross compiler
> install by myself did not.
>
> Can anyone please give me hint?
Buildroot creates a toolchain wrapper when using external toolchains.
This wrapper passes some extra arguments to the toolchain, telling it
where the sysroot is containing the headers and libraries, which
architecture to build for etc. This wrapper is what you see in
output/host/usr/bin.
You can verify that this is the case by running strace on it, or, if
you have a very recent buildroot version (containing commit
aaa06aaa82787b77ea56a7664cb4b0a22eca5c31, you can get a list of all
options passed by setting the environment variable BR_DEBUG_WRAPPER
when running the toolchain.
For your reference, the wrapper source is at
toolchain/toolchain-external/ext-toolchain-wrapper.c
So the behavior you are seeing is expected. You should always use the
toolchain through output/host/usr/bin/.
Best regards,
Thomas
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] Libraries built with buildroot can only be used by buildroot itself.
2013-07-30 6:22 ` Thomas De Schampheleire
@ 2013-07-30 8:57 ` Woody Wu
2013-07-30 9:19 ` Thomas Petazzoni
0 siblings, 1 reply; 7+ messages in thread
From: Woody Wu @ 2013-07-30 8:57 UTC (permalink / raw)
To: buildroot
On Tue, Jul 30, 2013 at 08:22:19AM +0200, Thomas De Schampheleire wrote:
> Hi,
>
> On Tue, Jul 30, 2013 at 6:40 AM, Woody Wu <narkewoody@gmail.com> wrote:
> > Hi,
> >
> > ** In below example, I will talk directfb libraries, but I am afraid it it
> > not specific to directfb but a more general case.
> >
> > Using buildroot and BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201203, I got
> > build with some graphics libraries (in my case, these are direct frame
> > buffer libraries, i.e., BR2_PACKAGE_DIRECTFB). Then I want to use these
> > cross compiled libraries to cross compile my own written very simple
> > directfb application code.
> >
> >
> > What I did is:
> >
> > crossroot=/home/woody/buildroot-2013.05/
> > output/host/usr/arm-buildroot-linux-gnueabi/sysroot
> > rm -f *.o hline
> > arm-none-linux-gnueabi-gcc -I ${crossroot}/usr/include/directfb \
> > -D_GNU_SOURCE -o hline.o -c hline.c
> > arm-none-linux-gnueabi-gcc -I ${crossroot}/usr/include/directfb \
> > -D_GNU_SOURCE -o hline hline.o -ldirectfb -L ${crossroot}/usr/lib
> >
> > In case one, I set my path to use the gcc from my own Codesourcery
> > installation, which is the same version as that buildroot is using.
> > Actually, this Codesourcery installation is a direct uncompress from the
> > tarball that buildroot downloaded from net to its download directory.
> >
> > In case two, I set my path to use the gcc directly in buildroot, i.e,
> > under /home/woody/buildroot-2013.05/host/usr/bin
> >
> > In case two, it built with success. But case one, it did not:
> >
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/libc.so.6
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /usr/lib/libc_nonshared.a
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/ld-linux.so.3
> > collect2: ld returned 1 exit status
> >
> >
> > I don't understand why the error happened. It seems the cross compiler
> > of buildroot understood things correctly, but the same cross compiler
> > install by myself did not.
> >
> > Can anyone please give me hint?
>
> Buildroot creates a toolchain wrapper when using external toolchains.
> This wrapper passes some extra arguments to the toolchain, telling it
> where the sysroot is containing the headers and libraries, which
> architecture to build for etc. This wrapper is what you see in
> output/host/usr/bin.
>
> You can verify that this is the case by running strace on it, or, if
> you have a very recent buildroot version (containing commit
> aaa06aaa82787b77ea56a7664cb4b0a22eca5c31, you can get a list of all
> options passed by setting the environment variable BR_DEBUG_WRAPPER
> when running the toolchain.
>
> For your reference, the wrapper source is at
> toolchain/toolchain-external/ext-toolchain-wrapper.c
>
>
> So the behavior you are seeing is expected. You should always use the
> toolchain through output/host/usr/bin/.
Okay, Thomas. But I found fully copy of output/host/usr/bin (just in
another directory) also does not work. Is this also expected behavior?
>
> Best regards,
> Thomas
--
I can't go back to yesterday - because I was a different person then
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] Libraries built with buildroot can only be used by buildroot itself.
2013-07-30 4:54 ` Alexander Lukichev
@ 2013-07-30 9:00 ` Woody Wu
0 siblings, 0 replies; 7+ messages in thread
From: Woody Wu @ 2013-07-30 9:00 UTC (permalink / raw)
To: buildroot
On Tue, Jul 30, 2013 at 07:54:51AM +0300, Alexander Lukichev wrote:
> Hello, Woody!
>
> 2013/7/30 Woody Wu <narkewoody@gmail.com>In case one, I set my path to use
> the gcc from my own Codesourcery
>
> > installation, which is the same version as that buildroot is using.
> > Actually, this Codesourcery installation is a direct uncompress from the
> > tarball that buildroot downloaded from net to its download directory.
> >
> > In case two, I set my path to use the gcc directly in buildroot, i.e,
> > under /home/woody/buildroot-2013.05/host/usr/bin
> >
> > In case two, it built with success. But case one, it did not:
> >
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> > skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> > cannot find /lib/libc.so.6
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> > skipping incompatible /usr/lib/libc_nonshared.a when searching for
> > /usr/lib/libc_nonshared.a
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> > cannot find /usr/lib/libc_nonshared.a
> > /home/woody/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:
> > cannot find /lib/ld-linux.so.3
> > collect2: ld returned 1 exit status
> >
>
> It looks like in case one ld installed to /home/woody/arm-2012.03 is used
> to reading binaries for another architecture. Are you absolutely sure that
> this is a _cross_ toolchain?
not sure i am sure ... but the toolchains is exactly the tarball that
buildroot downloaded for me:
arm-2012.03-57-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
>
> --
> Best regards,
> Alexander Lukichev
--
I can't go back to yesterday - because I was a different person then
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] Libraries built with buildroot can only be used by buildroot itself.
2013-07-30 8:57 ` Woody Wu
@ 2013-07-30 9:19 ` Thomas Petazzoni
2013-07-31 8:57 ` Woody Wu
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2013-07-30 9:19 UTC (permalink / raw)
To: buildroot
Dear Woody Wu,
On Tue, 30 Jul 2013 16:57:49 +0800, Woody Wu wrote:
> > So the behavior you are seeing is expected. You should always use the
> > toolchain through output/host/usr/bin/.
>
> Okay, Thomas. But I found fully copy of output/host/usr/bin (just in
> another directory) also does not work. Is this also expected behavior?
Copying output/host/usr/bin alone doesn't make any sense because
you're moving the compiler and other tools but not the sysroot. Copying
the entire output/host directory elsewhere would make more sense, but
unfortunately, Buildroot doesn't support a relocatable sysroot for now.
So you should *not* move this directory.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] Libraries built with buildroot can only be used by buildroot itself.
2013-07-30 9:19 ` Thomas Petazzoni
@ 2013-07-31 8:57 ` Woody Wu
0 siblings, 0 replies; 7+ messages in thread
From: Woody Wu @ 2013-07-31 8:57 UTC (permalink / raw)
To: buildroot
On Tue, Jul 30, 2013 at 11:19:15AM +0200, Thomas Petazzoni wrote:
> Dear Woody Wu,
>
> On Tue, 30 Jul 2013 16:57:49 +0800, Woody Wu wrote:
>
> > > So the behavior you are seeing is expected. You should always use the
> > > toolchain through output/host/usr/bin/.
> >
> > Okay, Thomas. But I found fully copy of output/host/usr/bin (just in
> > another directory) also does not work. Is this also expected behavior?
>
> Copying output/host/usr/bin alone doesn't make any sense because
> you're moving the compiler and other tools but not the sysroot. Copying
> the entire output/host directory elsewhere would make more sense, but
> unfortunately, Buildroot doesn't support a relocatable sysroot for now.
> So you should *not* move this directory.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
Hi, Thomas
Many thanks for your explainations.
--
I can't go back to yesterday - because I was a different person then
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-07-31 8:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-30 4:40 [Buildroot] Libraries built with buildroot can only be used by buildroot itself Woody Wu
2013-07-30 4:54 ` Alexander Lukichev
2013-07-30 9:00 ` Woody Wu
2013-07-30 6:22 ` Thomas De Schampheleire
2013-07-30 8:57 ` Woody Wu
2013-07-30 9:19 ` Thomas Petazzoni
2013-07-31 8:57 ` Woody Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox