Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Stefan Fröberg" <stefan.froberg@petroprogram.com>
To: buildroot@busybox.net
Subject: [Buildroot] Advice on buildroot implementation
Date: Wed, 20 Feb 2013 13:08:32 +0200	[thread overview]
Message-ID: <5124AEB0.5080808@petroprogram.com> (raw)
In-Reply-To: <718DFA7882181D45B8BD18F31C46D55427A6A997@MBX204.domain.local>

20.2.2013 3:24, Gregory Perry kirjoitti:
> Thank you Arnout!
> ________________________________________
> From: Arnout Vandecappelle [arnout at mind.be]
> Sent: Tuesday, February 19, 2013 6:18 PM
> To: Gregory Perry
> Cc: buildroot at busybox.net
> Subject: Re: [Buildroot] Advice on buildroot implementation
>
> On 20/02/13 00:03, Gregory Perry wrote:
>> Hello again,
>>
>> Does anyone have some advice on using buildroot to create a LiveCD filesystem?
>>
>> Here are the requirements:
>>
>> 1) Universal boot support on any x86 hardware platform;
>> 2) Read only (UnionFS or OverlayFS); and
>> 2) NFS root capabilities after kernel/initrd launch (if the ISO is PXE-boostrapped)
>   On x86, I find the easiest approach to use a cpio initramfs, with a
> syslinux boot loader. But if universal boot is required, it means you
> have to stuff all the modules bloat in the cpio image...

Grub is nice bootloader too ;-)

If every kernel module is needed it will take about 50 MB and if every
firmware is needed then it will take another 60 MB.

However, there is a git-tree of using LTO (Link time optimization) with
Linux kernel to make at least modules smaller.

https://github.com/andikleen/linux-misc/commits/lto

Besides those patches you need at least gcc 4.7.2 or greater and buld
with --enable-gold=yes --enable-lto and
also H.J. Lu's (man who had his part of doing glibc ABI specification,
or so I read) version of binutils (latest version is 2.23.51.0.9)
https://www.kernel.org/pub/linux/devel/binutils/
which also needs to be compiled with --enable-gold=yes --enable-lto

Then after those three requirements (patched kernel, latest gcc with
proper configure switches and HJ Lu's binutils with configure switches)
are met then activating LTO compiling by giving the following CFLAGS and
LDFLAGS:

CFLAGS = -flto -fwhole-program
LDFLAGS= -flto -fuse-linker-plugin

It could be also possible to compile whole system to make it smaller but
it is very delicate and experimental process and some packages
don't like some flags at all (For example zlib 1.2.7 does not like
-fwhole-program).

So Im asking everyone here:

How can I filter out flags-per-package ?
And also enable flags-per-package?
I would like to enable globally those LTO flags and filter some/all
flags from problematic packages.

Regards
Stefan

  reply	other threads:[~2013-02-20 11:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19 23:03 [Buildroot] Advice on buildroot implementation Gregory Perry
2013-02-19 23:18 ` Arnout Vandecappelle
2013-02-20  1:24   ` Gregory Perry
2013-02-20 11:08     ` Stefan Fröberg [this message]
2013-02-20 17:38       ` Arnout Vandecappelle
2013-02-21 10:38         ` Stefan Fröberg

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=5124AEB0.5080808@petroprogram.com \
    --to=stefan.froberg@petroprogram.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox