All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Using Buildroot tool chain as external Toolchain
@ 2013-05-14  9:08 john
  2013-05-14  9:25 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: john @ 2013-05-14  9:08 UTC (permalink / raw)
  To: buildroot

Hi,

I have been following various archived mails on this issue in an effort
to get this working. The most useful was
http://buildroot-busybox.2317881.n4.nabble.com/Can-I-use-the-toolchain-build-with-buildroot-as-an-external-toolchain-td26855.html

I followed this process:
1. I downloaded a copy of buildroot-2012.05
2. Configured it and built it for my system
3. Confirmed that everything built and ran sucessfully
4. Copied the contents of buildroot-2012.05/output/host/usr
to /apps/buildroot_toolchain/usr
5. In toolchain->options I set type to external toolchain
6. Selected toolchain-> custom toolchain
7. Set Toolchain path to /apps/buildroot_toolchain/usr
8. Set prefix to $(ARCH)-unknown-linux-uclibcgnueabi
9. Ensured that the options largefile support,RPC,WCHAR etc all matched
my previous settings when building the original toolchain
10. Saved my config and ran make clean 

But after following this process I have a problem, after doing a make
clean I get:


checking whether build environment is sane... yes
checking for
arm-linux-strip... /home/xxx/xxx/xxx/buildroot-2012.05/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for
arm-linux-gcc... /home/xxx/xxx/xxx/buildroot-2012.05/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc
checking whether the C compiler works... no
configure: error: in
`/home/xxx/xxx/xxx/buildroot-2012.05/output/build/alsa-lib-1.0.25':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: ***
[/home/xxx/xxx/xxx/buildroot-2012.05/output/build/alsa-lib-1.0.25/.stamp_configured]
Error 77

Should the above process work? Is it a possible permissions issue, I
have tried changing the permissions on /apps/buildroot_toolchain/usr but
to no avail.
In the link I posted above Thomas has suggested that the tool chain
location be initially configured for In Build options, set the host dir
to /opt/your-toolchain-name etc
Is this necessary to make this work or should the process I use also
work?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Using Buildroot tool chain as external Toolchain
  2013-05-14  9:08 [Buildroot] Using Buildroot tool chain as external Toolchain john
@ 2013-05-14  9:25 ` Thomas Petazzoni
  2013-05-14  9:51   ` john
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2013-05-14  9:25 UTC (permalink / raw)
  To: buildroot

Dear john,

On Tue, 14 May 2013 10:08:04 +0100, john wrote:

> I followed this process:
> 1. I downloaded a copy of buildroot-2012.05
> 2. Configured it and built it for my system
> 3. Confirmed that everything built and ran sucessfully
> 4. Copied the contents of buildroot-2012.05/output/host/usr
> to /apps/buildroot_toolchain/usr

This doesn't work. By default, gcc is linked dynamically against mpc,
mpfr and al, and that doesn't work nicely if you move things around.

Two choices:

 *) Build mpc and mpfr statically, so that gcc is linked statically
    against them. Ideally, we should allow them to be built
    dynamically, but gcc/binutils have binaries in multiple locations
    in the tree, so we can't use the $ORIGIN/../lib trick to support a
    relocatable rpath.

 *) Set BR2_HOST_DIR directly to /apps/buildroot_toolchain/ so that
    your toolchain gets built and installed directly in this location.

> arm-linux-gcc... /home/xxx/xxx/xxx/buildroot-2012.05/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc
> checking whether the C compiler works... no
> configure: error: in
> `/home/xxx/xxx/xxx/buildroot-2012.05/output/build/alsa-lib-1.0.25':
> configure: error: C compiler cannot create executables
> See `config.log' for more details
> make: ***
> [/home/xxx/xxx/xxx/buildroot-2012.05/output/build/alsa-lib-1.0.25/.stamp_configured]
> Error 77

See output/build/alsa-lib-1.0.25/config.log for the details of the
error; Would be useful to have this information to confirm that my
analysis above is correct.

Thanks,

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] 6+ messages in thread

* [Buildroot] Using Buildroot tool chain as external Toolchain
  2013-05-14  9:25 ` Thomas Petazzoni
@ 2013-05-14  9:51   ` john
  2013-05-14  9:54     ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: john @ 2013-05-14  9:51 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Thank you for the reply.
I have attached the config.log

On Tue, 2013-05-14 at 11:25 +0200, Thomas Petazzoni wrote:
> Dear john,
> 
> On Tue, 14 May 2013 10:08:04 +0100, john wrote:
> 
> > I followed this process:
> > 1. I downloaded a copy of buildroot-2012.05
> > 2. Configured it and built it for my system
> > 3. Confirmed that everything built and ran sucessfully
> > 4. Copied the contents of buildroot-2012.05/output/host/usr
> > to /apps/buildroot_toolchain/usr
> 
> This doesn't work. By default, gcc is linked dynamically against mpc,
> mpfr and al, and that doesn't work nicely if you move things around.
> 
> Two choices:
> 
>  *) Build mpc and mpfr statically, so that gcc is linked statically
>     against them. Ideally, we should allow them to be built
>     dynamically, but gcc/binutils have binaries in multiple locations
>     in the tree, so we can't use the $ORIGIN/../lib trick to support a
>     relocatable rpath.
> 
>  *) Set BR2_HOST_DIR directly to /apps/buildroot_toolchain/ so that
>     your toolchain gets built and installed directly in this location.
> 
> > arm-linux-gcc... /home/xxx/xxx/xxx/buildroot-2012.05/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc
> > checking whether the C compiler works... no
> > configure: error: in
> > `/home/xxx/xxx/xxx/buildroot-2012.05/output/build/alsa-lib-1.0.25':
> > configure: error: C compiler cannot create executables
> > See `config.log' for more details
> > make: ***
> > [/home/xxx/xxx/xxx/buildroot-2012.05/output/build/alsa-lib-1.0.25/.stamp_configured]
> > Error 77
> 
> See output/build/alsa-lib-1.0.25/config.log for the details of the
> error; Would be useful to have this information to confirm that my
> analysis above is correct.
> 
> Thanks,
> 
> Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.log
Type: text/x-log
Size: 14572 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130514/14e14f5b/attachment.bin>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Using Buildroot tool chain as external Toolchain
  2013-05-14  9:51   ` john
@ 2013-05-14  9:54     ` Thomas Petazzoni
  2013-05-14 12:50       ` john
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2013-05-14  9:54 UTC (permalink / raw)
  To: buildroot

Dear john,

On Tue, 14 May 2013 10:51:57 +0100, john wrote:
> Hi Thomas,
> 
> Thank you for the reply.
> I have attached the config.log

So indeed the problem is:

/apps/buildroot_toolchain/usr/bin/../libexec/gcc/arm-unknown-linux-uclibcgnueabi/4.5.3/cc1:
error while loading shared libraries: libmpc.so.2: cannot open shared
object file: No such file or directory

Which is what I was referring to.

You can apply the below patch as a workaround:

commit b18bb4667fa5773c55e084c8b2d2df68735d3130
Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date:   Fri Aug 24 20:39:52 2012 +0000

    mpc, mpfr, gmp: build statically for the host
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

diff --git a/package/gmp/gmp.mk b/package/gmp/gmp.mk
index 5bcc6c1..9746150 100644
--- a/package/gmp/gmp.mk
+++ b/package/gmp/gmp.mk
@@ -14,5 +14,7 @@ ifeq ($(ARCH),arm)
 GMP_MAKE_OPT += CFLAGS="$(TARGET_CFLAGS) -marm"
 endif
 
+HOST_GMP_CONF_OPT += --enable-static --disable-shared
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
diff --git a/package/mpc/mpc.mk b/package/mpc/mpc.mk
index a366db7..4723220 100644
--- a/package/mpc/mpc.mk
+++ b/package/mpc/mpc.mk
@@ -12,6 +12,7 @@ MPC_INSTALL_STAGING = YES
 MPC_DEPENDENCIES = gmp mpfr
 MPC_AUTORECONF = YES
 HOST_MPC_AUTORECONF = YES
+HOST_MPC_CONF_OPT += --disable-shared --enable-static
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
diff --git a/package/mpfr/mpfr.mk b/package/mpfr/mpfr.mk
index 9caf3ac..fd8ff08 100644
--- a/package/mpfr/mpfr.mk
+++ b/package/mpfr/mpfr.mk
@@ -11,5 +11,7 @@ MPFR_INSTALL_STAGING = YES
 MPFR_DEPENDENCIES = gmp
 MPFR_MAKE_OPT = RANLIB=$(TARGET_RANLIB)
 
+HOST_MPFR_CONF_OPT += --enable-static --disable-shared
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] Using Buildroot tool chain as external Toolchain
  2013-05-14  9:54     ` Thomas Petazzoni
@ 2013-05-14 12:50       ` john
  2013-05-14 12:52         ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: john @ 2013-05-14 12:50 UTC (permalink / raw)
  To: buildroot

Thanks Thomas,

That fixed my problem, I appreciate your help

On Tue, 2013-05-14 at 11:54 +0200, Thomas Petazzoni wrote:
> Dear john,
> 
> On Tue, 14 May 2013 10:51:57 +0100, john wrote:
> > Hi Thomas,
> > 
> > Thank you for the reply.
> > I have attached the config.log
> 
> So indeed the problem is:
> 
> /apps/buildroot_toolchain/usr/bin/../libexec/gcc/arm-unknown-linux-uclibcgnueabi/4.5.3/cc1:
> error while loading shared libraries: libmpc.so.2: cannot open shared
> object file: No such file or directory
> 
> Which is what I was referring to.
> 
> You can apply the below patch as a workaround:
> 
> commit b18bb4667fa5773c55e084c8b2d2df68735d3130
> Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Date:   Fri Aug 24 20:39:52 2012 +0000
> 
>     mpc, mpfr, gmp: build statically for the host
>     
>     Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> diff --git a/package/gmp/gmp.mk b/package/gmp/gmp.mk
> index 5bcc6c1..9746150 100644
> --- a/package/gmp/gmp.mk
> +++ b/package/gmp/gmp.mk
> @@ -14,5 +14,7 @@ ifeq ($(ARCH),arm)
>  GMP_MAKE_OPT += CFLAGS="$(TARGET_CFLAGS) -marm"
>  endif
>  
> +HOST_GMP_CONF_OPT += --enable-static --disable-shared
> +
>  $(eval $(autotools-package))
>  $(eval $(host-autotools-package))
> diff --git a/package/mpc/mpc.mk b/package/mpc/mpc.mk
> index a366db7..4723220 100644
> --- a/package/mpc/mpc.mk
> +++ b/package/mpc/mpc.mk
> @@ -12,6 +12,7 @@ MPC_INSTALL_STAGING = YES
>  MPC_DEPENDENCIES = gmp mpfr
>  MPC_AUTORECONF = YES
>  HOST_MPC_AUTORECONF = YES
> +HOST_MPC_CONF_OPT += --disable-shared --enable-static
>  
>  $(eval $(autotools-package))
>  $(eval $(host-autotools-package))
> diff --git a/package/mpfr/mpfr.mk b/package/mpfr/mpfr.mk
> index 9caf3ac..fd8ff08 100644
> --- a/package/mpfr/mpfr.mk
> +++ b/package/mpfr/mpfr.mk
> @@ -11,5 +11,7 @@ MPFR_INSTALL_STAGING = YES
>  MPFR_DEPENDENCIES = gmp
>  MPFR_MAKE_OPT = RANLIB=$(TARGET_RANLIB)
>  
> +HOST_MPFR_CONF_OPT += --enable-static --disable-shared
> +
>  $(eval $(autotools-package))
>  $(eval $(host-autotools-package))
> 
> Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Using Buildroot tool chain as external Toolchain
  2013-05-14 12:50       ` john
@ 2013-05-14 12:52         ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2013-05-14 12:52 UTC (permalink / raw)
  To: buildroot

Dear john,

On Tue, 14 May 2013 13:50:13 +0100, john wrote:

> Thanks Thomas,
> 
> That fixed my problem, I appreciate your help

Ok, good.

Perhaps I should submit this patch. I don't think there's any other
solution than this one, since the $ORIGIN/../lib trick cannot work.

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] 6+ messages in thread

end of thread, other threads:[~2013-05-14 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-14  9:08 [Buildroot] Using Buildroot tool chain as external Toolchain john
2013-05-14  9:25 ` Thomas Petazzoni
2013-05-14  9:51   ` john
2013-05-14  9:54     ` Thomas Petazzoni
2013-05-14 12:50       ` john
2013-05-14 12:52         ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.