All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Edwards <grant.b.edwards@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] buildroot noob help!
Date: Sun, 16 Oct 2011 23:57:55 +0000 (UTC)	[thread overview]
Message-ID: <j7fr23$n6e$1@dough.gmane.org> (raw)
In-Reply-To: CAFo83mEQUkMazfnZLAu=UPn+xgyjY-g4qkYMTmqZDr0JC99vKQ@mail.gmail.com

On 2011-10-15, Jed Evnull <jedevnull@gmail.com> wrote:

>> If your __not__ building on non-ARM, why do you need a
>> cross-compiler?
>>
>> If you __are__ building on non-ARM, how did you expect your host
>> machine to execute the ARM binaries inside of the chroot?
>>
>> Me-thinks you need QEMU or such like to do that.
>
> Sorry, I was probably incoherent. My goal is to produce arm binaries for my
> tablet. I want them as small as possible, so I want statically linked
> packages with uclibc, rather than glibc.

Are you trying to build a bootable root filesystem or not?  If not,
then buildroot is not the right tool.  Buildroot is for building root
filesystems.  Hence the name. ;)

> My first try was to use just the buildroot cross-compile toolchain
> with ./configure CC=arm-linux-gcc, LDFLAGS=-static, etc. A 'normal'
> cross-compile, I guess. This is how I use the sourcery arm toochain
> to produce kernels for my device.  That didn't work for anything but
> simple hello world programs. Lots of different errors with autoconf.

If you just want to build statically linked ARM executables on a
normal Linux desktop (e.g. IA32 or AMD64), then I think you should
probably just build an arm-linux uclibc toolchain using crosstool-ng
and use that for your builds (remember, you might have to pass the
appropriate --sysroot option so the toolchain can find all if its
include and library files).

 http://crosstool-ng.org/

Using buildroot is going the long way 'round.

I just built a static ARM "hello world" C program using my
crosstool-ng toochain (the same one I use with Buildroot to build root
filesystems), and it's 15KB (stripped).  That's a damn sight better
than my normal Gentoo glibc toolchain does.  It generates a 515KB IA32
executable (stripped) from the same source file.  Glibc has been
_spectectacularly_ bad job for static linking for quite some time.

> So I thought I would set up qemu for chroot and directly compile from
> within the root_fs produced by buildroot, as worked with
> scratchbox/qemu. But chroot into the image fails.chroot: failed to
> run command `/bin/su'.

I don't think chroot is what you want.  What you want is gcc's
--sysroot option 

-- 
Grant Edwards               grant.b.edwards        Yow! Hmmm ... A hash-singer
                                  at               and a cross-eyed guy were
                              gmail.com            SLEEPING on a deserted
                                                   island, when ...

  reply	other threads:[~2011-10-16 23:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-15 20:12 [Buildroot] buildroot noob help! Jed Evnull
2011-10-15 20:53 ` Bjørn Forsman
2011-10-15 21:06   ` Michael S. Zick
2011-10-15 21:59     ` Jed Evnull
2011-10-16 23:57       ` Grant Edwards [this message]
2011-10-17 10:50       ` Arnout Vandecappelle
2011-10-17 14:21         ` Grant Edwards
2011-10-17 19:41           ` Jed Evnull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='j7fr23$n6e$1@dough.gmane.org' \
    --to=grant.b.edwards@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.