* [Buildroot] buildroot noob help!
@ 2011-10-15 20:12 Jed Evnull
2011-10-15 20:53 ` Bjørn Forsman
0 siblings, 1 reply; 8+ messages in thread
From: Jed Evnull @ 2011-10-15 20:12 UTC (permalink / raw)
To: buildroot
I need to compile packages for arm with uclibc and statically link them. Am
I selecting the right tool with buildroot? I compiled buildroot-2011.08
with qemu_arm_versatile_defconfig. The generated cross-compiler compiles
simple hello world programs w/o problems, but fails with typical autoconf
source packages.
I tried to chroot into the generated image (chroot myimage /bin/sh --login)
to compile from there, but chroot fails with /bin/sh not found. I can
cross-compile with code sourcery's toolchain, but the binaries are h-u-g-e.
I did something similar years ago with scratchbox and maemo. Please help a
noob!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20111015/6a093780/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] buildroot noob help!
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
0 siblings, 1 reply; 8+ messages in thread
From: Bjørn Forsman @ 2011-10-15 20:53 UTC (permalink / raw)
To: buildroot
On 15 October 2011 22:12, Jed Evnull <jedevnull@gmail.com> wrote:
> I need to compile packages for arm with uclibc and statically link them. Am
> I selecting the right tool with buildroot?
I haven't done static linking with Buildroot. Is your reason for wanting static
linking that you will not use the rest of the rootfs Buildroot gives you?
> I compiled? buildroot-2011.08
> with qemu_arm_versatile_defconfig.? The generated cross-compiler compiles
> simple hello world programs w/o problems, but fails with typical autoconf
> source packages.
How did you try to build those packages? You will probably have most success
if you integrate the package in Buildroot. This is done by (typically)
writing two
small files in packages/<yourpackage>/. See the buildroot docs for the details.
> I tried to chroot into the generated image (chroot myimage /bin/sh --login)
> to compile from there, but chroot fails with /bin/sh not found.
AFAIK, few people use Buildroot to build a compiler into the rootfs,
so this is not
that well supported. It's better to use Buildroot as a cross-compile system, not
native-compile.
Best regards,
Bj?rn Forsman
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] buildroot noob help!
2011-10-15 20:53 ` Bjørn Forsman
@ 2011-10-15 21:06 ` Michael S. Zick
2011-10-15 21:59 ` Jed Evnull
0 siblings, 1 reply; 8+ messages in thread
From: Michael S. Zick @ 2011-10-15 21:06 UTC (permalink / raw)
To: buildroot
On Sat October 15 2011, Bj?rn Forsman wrote:
> On 15 October 2011 22:12, Jed Evnull <jedevnull@gmail.com> wrote:
> > I need to compile packages for arm with uclibc and statically link them. Am
> > I selecting the right tool with buildroot?
>
> I haven't done static linking with Buildroot. Is your reason for wanting static
> linking that you will not use the rest of the rootfs Buildroot gives you?
>
> > I compiled? buildroot-2011.08
> > with qemu_arm_versatile_defconfig.? The generated cross-compiler compiles
> > simple hello world programs w/o problems, but fails with typical autoconf
> > source packages.
>
> How did you try to build those packages? You will probably have most success
> if you integrate the package in Buildroot. This is done by (typically)
> writing two
> small files in packages/<yourpackage>/. See the buildroot docs for the details.
>
> > I tried to chroot into the generated image (chroot myimage /bin/sh --login)
> > to compile from there, but chroot fails with /bin/sh not found.
>
???
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.
Mike
> AFAIK, few people use Buildroot to build a compiler into the rootfs,
> so this is not
> that well supported. It's better to use Buildroot as a cross-compile system, not
> native-compile.
>
> Best regards,
> Bj?rn Forsman
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] buildroot noob help!
2011-10-15 21:06 ` Michael S. Zick
@ 2011-10-15 21:59 ` Jed Evnull
2011-10-16 23:57 ` Grant Edwards
2011-10-17 10:50 ` Arnout Vandecappelle
0 siblings, 2 replies; 8+ messages in thread
From: Jed Evnull @ 2011-10-15 21:59 UTC (permalink / raw)
To: buildroot
On Sat, Oct 15, 2011 at 5:06 PM, Michael S. Zick <minimod@morethan.org>wrote:
> On Sat October 15 2011, Bj?rn Forsman wrote:
> > On 15 October 2011 22:12, Jed Evnull <jedevnull@gmail.com> wrote:
> > > I need to compile packages for arm with uclibc and statically link
> them. Am
> > > I selecting the right tool with buildroot?
> >
> > I haven't done static linking with Buildroot. Is your reason for wanting
> static
> > linking that you will not use the rest of the rootfs Buildroot gives you?
> >
> > > I compiled buildroot-2011.08
> > > with qemu_arm_versatile_defconfig. The generated cross-compiler
> compiles
> > > simple hello world programs w/o problems, but fails with typical
> autoconf
> > > source packages.
> >
> > How did you try to build those packages? You will probably have most
> success
> > if you integrate the package in Buildroot. This is done by (typically)
> > writing two
> > small files in packages/<yourpackage>/. See the buildroot docs for the
> details.
> >
> > > I tried to chroot into the generated image (chroot myimage /bin/sh
> --login)
> > > to compile from there, but chroot fails with /bin/sh not found.
> >
>
> ???
>
> 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.
>
> Mike
> > AFAIK, few people use Buildroot to build a compiler into the rootfs,
> > so this is not
> > that well supported. It's better to use Buildroot as a cross-compile
> system, not
> > native-compile.
> >
> > Best regards,
> > Bj?rn Forsman
>
>
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.
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.
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'.
Thanks for the replies. I'm re-reading docs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20111015/7ff4ef2e/attachment-0001.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] buildroot noob help!
2011-10-15 21:59 ` Jed Evnull
@ 2011-10-16 23:57 ` Grant Edwards
2011-10-17 10:50 ` Arnout Vandecappelle
1 sibling, 0 replies; 8+ messages in thread
From: Grant Edwards @ 2011-10-16 23:57 UTC (permalink / raw)
To: buildroot
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 ...
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] buildroot noob help!
2011-10-15 21:59 ` Jed Evnull
2011-10-16 23:57 ` Grant Edwards
@ 2011-10-17 10:50 ` Arnout Vandecappelle
2011-10-17 14:21 ` Grant Edwards
1 sibling, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2011-10-17 10:50 UTC (permalink / raw)
To: buildroot
On Saturday 15 October 2011 23:59:07, Jed Evnull wrote:
> 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.
If you want them as small as possible, you should _not_ link them statically...
However, I guess the real problem is that you don't have access to the cross-compilation shared libraries and headers for your tablet. In that case linking statically is indeed a good solution. Follow Grant's suggestion to use crosstool-NG. Keep in mind though that for quite a few existing packages, linking statically doesn't work well (GStreamer and it's dependents, for instance).
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: 31BB CF53 8660 6F88 345D 54CC A836 5879 20D7 CF43
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] buildroot noob help!
2011-10-17 10:50 ` Arnout Vandecappelle
@ 2011-10-17 14:21 ` Grant Edwards
2011-10-17 19:41 ` Jed Evnull
0 siblings, 1 reply; 8+ messages in thread
From: Grant Edwards @ 2011-10-17 14:21 UTC (permalink / raw)
To: buildroot
On 2011-10-17, Arnout Vandecappelle <arnout@mind.be> wrote:
>
> On Saturday 15 October 2011 23:59:07, Jed Evnull wrote:
>> 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.
>
> If you want them as small as possible, you should _not_ link them
> statically...
>
> However, I guess the real problem is that you don't have access to
> the cross-compilation shared libraries and headers for your tablet.
> In that case linking statically is indeed a good solution. Follow
> Grant's suggestion to use crosstool-NG. Keep in mind though that for
> quite a few existing packages, linking statically doesn't work well
> (GStreamer and it's dependents, for instance).
Yep. Anything that uses "plugins" (object files that are fouand,
selected, and loaded dynamically under program control after the
program is running) is going to be allergic to static linking.
--
Grant Edwards grant.b.edwards Yow! An Italian is COMBING
at his hair in suburban DES
gmail.com MOINES!
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] buildroot noob help!
2011-10-17 14:21 ` Grant Edwards
@ 2011-10-17 19:41 ` Jed Evnull
0 siblings, 0 replies; 8+ messages in thread
From: Jed Evnull @ 2011-10-17 19:41 UTC (permalink / raw)
To: buildroot
On Oct 17, 2011 10:22 AM, "Grant Edwards" <grant.b.edwards@gmail.com> wrote:
>
> On 2011-10-17, Arnout Vandecappelle <arnout@mind.be> wrote:
> >
> > On Saturday 15 October 2011 23:59:07, Jed Evnull wrote:
> >> 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.
> >
> > If you want them as small as possible, you should _not_ link them
> > statically...
> >
> > However, I guess the real problem is that you don't have access to
> > the cross-compilation shared libraries and headers for your tablet.
> > In that case linking statically is indeed a good solution. Follow
> > Grant's suggestion to use crosstool-NG. Keep in mind though that for
> > quite a few existing packages, linking statically doesn't work well
> > (GStreamer and it's dependents, for instance).
>
> Yep. Anything that uses "plugins" (object files that are fouand,
> selected, and loaded dynamically under program control after the
> program is running) is going to be allergic to static linking.
>
> --
> Grant Edwards grant.b.edwards Yow! An Italian is
COMBING
> at his hair in suburban DES
> gmail.com MOINES!
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Thanks for all the replies, it's been a great help. I'm building a toolchain
with ct-ng now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20111017/2adaa764/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-10-17 19:41 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-10-17 10:50 ` Arnout Vandecappelle
2011-10-17 14:21 ` Grant Edwards
2011-10-17 19:41 ` Jed Evnull
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox