All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] preparing rootfs with gcc in buildroot
@ 2012-06-21 12:16 Kevin Wilson
  2012-06-21 12:28 ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Wilson @ 2012-06-21 12:16 UTC (permalink / raw)
  To: buildroot

Hi,

I have buildroot-2012.02.
The host is x86, the target is arm.
I work with it, prepare fs , boot it ok, etc.

Now it doesen't have gcc.
I want to prepare a rootfilesystem with gcc
(output/images/rootfs.tar)

I run:
make menuconfig
  Package selection for target
     Development tools
        "gcc needs development files in target filesystems"


rgs,
Kevin

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

* [Buildroot] preparing rootfs with gcc in buildroot
  2012-06-21 12:16 [Buildroot] preparing rootfs with gcc in buildroot Kevin Wilson
@ 2012-06-21 12:28 ` Thomas Petazzoni
  2012-06-21 16:38   ` Kevin Wilson
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2012-06-21 12:28 UTC (permalink / raw)
  To: buildroot

Le Thu, 21 Jun 2012 15:16:14 +0300,
Kevin Wilson <wkevils@gmail.com> a ?crit :

> I run:
> make menuconfig
>   Package selection for target
>      Development tools
>         "gcc needs development files in target filesystems"

Yes, you have to enable BR2_HAVE_DEVFILES (in Build options).

However, beware that the usage of the native toolchain on the target is
rarely used and tested by Buildroot developers. Buildroot is here to
cross-compile all your applications and libraries, so it generally
doesn't make much sense to have a native toolchain on the target, so we
don't pay too much attention to this.

What would you like to build on your target? Why don't you
cross-compile it?

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] preparing rootfs with gcc in buildroot
  2012-06-21 12:28 ` Thomas Petazzoni
@ 2012-06-21 16:38   ` Kevin Wilson
  2012-06-21 16:55     ` Grant Edwards
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Wilson @ 2012-06-21 16:38 UTC (permalink / raw)
  To: buildroot

Hi, Thomas
Thanks for your quick answer!

I do admit that I am a bit of (heavy) hacker and
I am intending to use buildroot  a bit beyond its usual usage.

I though of things like -
  1) Adding tests programs of my own
   2) Adding some code to packages (let's say, iptables, openswan)
Partly for hacking, partly for adding code for my own development needs.

It seems to mt that though it is possible to do it in buildroot cross
compiling,  in the end , for each and every change in
iptables/openswan, I will have to
install all the rootfs.tar; I don't think there is a way to prepare something
like a package.
(unless there is a way to tell
buildroot that my target rootfs is located in , lets say, /home/....)
And for each change in iptables/openswan I will
need to repeat this.
copying manually only the binaries (libs, executable, config file) can
be quite a task, especially when you work with bigger and bigger
packages, where these files can be scattered over many places.

 (It could be that there some other way, something
which uses DEST_DIR, I don't know and I will be happy to hear).

KV







On Thu, Jun 21, 2012 at 3:28 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Le Thu, 21 Jun 2012 15:16:14 +0300,
> Kevin Wilson <wkevils@gmail.com> a ?crit :
>
>> I run:
>> make menuconfig
>> ? Package selection for target
>> ? ? ?Development tools
>> ? ? ? ? "gcc needs development files in target filesystems"
>
> Yes, you have to enable BR2_HAVE_DEVFILES (in Build options).
>
> However, beware that the usage of the native toolchain on the target is
> rarely used and tested by Buildroot developers. Buildroot is here to
> cross-compile all your applications and libraries, so it generally
> doesn't make much sense to have a native toolchain on the target, so we
> don't pay too much attention to this.
>
> What would you like to build on your target? Why don't you
> cross-compile it?
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] preparing rootfs with gcc in buildroot
  2012-06-21 16:38   ` Kevin Wilson
@ 2012-06-21 16:55     ` Grant Edwards
  2012-06-21 20:31       ` Arnout Vandecappelle
  0 siblings, 1 reply; 7+ messages in thread
From: Grant Edwards @ 2012-06-21 16:55 UTC (permalink / raw)
  To: buildroot

On 2012-06-21, Kevin Wilson <wkevils@gmail.com> wrote:

> Thanks for your quick answer!
>
> I do admit that I am a bit of (heavy) hacker and I am intending to
> use buildroot a bit beyond its usual usage.
>
> I though of things like -
>
>   1) Adding tests programs of my own
>
>   2) Adding some code to packages (let's say, iptables, openswan)
>      Partly for hacking, partly for adding code for my own development
>      needs.
>
> It seems to mt that though it is possible to do it in buildroot cross
> compiling, in the end, for each and every change in
> iptables/openswan, I will have to install all the rootfs.tar; I don't
> think there is a way to prepare something like a package.

It was suggested that its easier to cross-compile your application. 
That doesn't mean you have to do it inside the buildroot framework.
It's trivial to cross-compile simple applications outside of
buildroot.  If all you're using is libc, then all you have to do is

   arm-linux-gcc -o foo file1.c file2.c file3.c

Building something that uses libc and autoconf stuff is almost as
easy.
   
Then you can 'scp foo target:' and run it.  Or you can NFS mount the
host directory where you do the edit/build and it's even simpler.

If you want to build things that use libraries that were built as part
of buildroot, then you have to add a couple more command line options
to tell the compiler/linker where to find the include and library
files created by buildroot (e.g. <wherever>/output/target.

In my project, the stuff I cross-compile outside of buildroot is
eventually packaged as .ipk files (sort of a stripped-down version of
Debian's .deb packages), and then I use ipkg-cl on the target to
install and update the "non-buildroot" applications.

-- 
Grant Edwards               grant.b.edwards        Yow! Don't hit me!!  I'm in
                                  at               the Twilight Zone!!!
                              gmail.com            

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

* [Buildroot] preparing rootfs with gcc in buildroot
  2012-06-21 16:55     ` Grant Edwards
@ 2012-06-21 20:31       ` Arnout Vandecappelle
  2012-06-21 21:24         ` Grant Edwards
  0 siblings, 1 reply; 7+ messages in thread
From: Arnout Vandecappelle @ 2012-06-21 20:31 UTC (permalink / raw)
  To: buildroot

On 06/21/12 18:55, Grant Edwards wrote:
> If you want to build things that use libraries that were built as part
> of buildroot, then you have to add a couple more command line options
> to tell the compiler/linker where to find the include and library
> files created by buildroot (e.g.<wherever>/output/target.

  And even that is not necessary if you use output/host/usr/bin/xxx-gcc
as the cross-compiler - that one has the sysroot hard-coded.

  By the way, you should point to <wherever>/output/staging, not
<wherever>/output/target.  target doesn't normally contain header
files or static libraries.

  Regards,
  Arnout
-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] preparing rootfs with gcc in buildroot
  2012-06-21 20:31       ` Arnout Vandecappelle
@ 2012-06-21 21:24         ` Grant Edwards
  2012-06-21 21:55           ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Grant Edwards @ 2012-06-21 21:24 UTC (permalink / raw)
  To: buildroot

On 2012-06-21, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 06/21/12 18:55, Grant Edwards wrote:
>> If you want to build things that use libraries that were built as part
>> of buildroot, then you have to add a couple more command line options
>> to tell the compiler/linker where to find the include and library
>> files created by buildroot (e.g.<wherever>/output/target.
>
> And even that is not necessary if you use output/host/usr/bin/xxx-gcc
> as the cross-compiler - that one has the sysroot hard-coded.

Right -- if you have buildroot build your compiler.  If you're using
an external compiler (e.g. one built separately with crosstool-ng),
you need to tell it where buildroot's libraries and include files are.

> By the way, you should point to <wherever>/output/staging, not
><wherever>/output/target.  target doesn't normally contain header
> files or static libraries.

Yup, my mistake.

-- 
Grant

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

* [Buildroot] preparing rootfs with gcc in buildroot
  2012-06-21 21:24         ` Grant Edwards
@ 2012-06-21 21:55           ` Thomas Petazzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2012-06-21 21:55 UTC (permalink / raw)
  To: buildroot

Le Thu, 21 Jun 2012 21:24:31 +0000 (UTC),
Grant Edwards <grant.b.edwards@gmail.com> a ?crit :

> Right -- if you have buildroot build your compiler.  If you're using
> an external compiler (e.g. one built separately with crosstool-ng),
> you need to tell it where buildroot's libraries and include files are.

No.

When you use an external toolchain in Buildroot, we generate a wrapper
that ensures that the external toolchain cross-compiler is always
properly called with the right argument.

Look at host/usr/bin/<arch>-linux-gcc, and you'll notice it's a symlink
to ext-toolchain-wrapper, which in turns calls the compiler. This
ext-toolchain-wrapper adds the --sysroot option.

So, regardless of whether you're using the internal toolchain backend,
the external toolchain backend, or the crosstool-ng toolchain backend,
you don't have to specify where the libraries and headers are. This was
done on purpose.

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

end of thread, other threads:[~2012-06-21 21:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-21 12:16 [Buildroot] preparing rootfs with gcc in buildroot Kevin Wilson
2012-06-21 12:28 ` Thomas Petazzoni
2012-06-21 16:38   ` Kevin Wilson
2012-06-21 16:55     ` Grant Edwards
2012-06-21 20:31       ` Arnout Vandecappelle
2012-06-21 21:24         ` Grant Edwards
2012-06-21 21:55           ` 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.