Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Duplication and size of binaries in generated toolchain
@ 2009-03-05 14:13 Thomas Petazzoni
  2009-03-05 14:22 ` Olaf Rempel
  2009-03-05 14:22 ` Peter Korsgaard
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2009-03-05 14:13 UTC (permalink / raw)
  To: buildroot

Hi,

After compiling a toolchain with Buildroot (no packages, no kernel, see
attached configuration file), I end up with duplicated binaries in the
STAGING_DIR.

For example, for the 'ar' binutil. The first copy is in :

$ ls -l usr/bin/arm-linux-uclibcgnueabi-ar 
-rwxr-xr-x 2 thomas thomas 2500708 2009-03-05 14:19 usr/bin/arm-linux-uclibcgnueabi-ar
$ md5sum usr/bin/arm-linux-uclibcgnueabi-ar 
82a898a705b8313ff156ee2287552a60  usr/bin/arm-linux-uclibcgnueabi-ar

And the second copy is in :

$ ls -l usr/arm-linux/bin/ar 
-rwxr-xr-x 2 thomas thomas 2500708 2009-03-05 14:19 usr/arm-linux/bin/ar
$ md5sum usr/arm-linux/bin/ar 
82a898a705b8313ff156ee2287552a60  usr/arm-linux/bin/ar

Same story for as, c++, g++, gcc, ld, nm, objcopy, objdump, ranlib,
strip. In total, it's 24 MB of binaries that are duplicated.

I'm not sure why the binaries without the arm-linux prefix are needed
in usr/arm-linux/bin. But if they are, couldn't they be symbolic links.

Last question: why are the individual binutils so big ? For example,
the strip program is 2.9 MB, ar is 2.4 MB. This looks ridiculously big
for such simple tools. First of all, they are not stripped and they
include debugging symbols, is it really necessary ? Even after
stripping, strip itself is still ~650 KB. Is it because of the static
linking against libbfd ?

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config
Type: application/octet-stream
Size: 17514 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20090305/b7fd5497/attachment-0001.obj>

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

* [Buildroot] Duplication and size of binaries in generated toolchain
  2009-03-05 14:13 [Buildroot] Duplication and size of binaries in generated toolchain Thomas Petazzoni
@ 2009-03-05 14:22 ` Olaf Rempel
  2009-03-05 14:22 ` Peter Korsgaard
  1 sibling, 0 replies; 5+ messages in thread
From: Olaf Rempel @ 2009-03-05 14:22 UTC (permalink / raw)
  To: buildroot

On Thu, 5 Mar 2009 15:13:59 +0100
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> Hi,
> 
> After compiling a toolchain with Buildroot (no packages, no kernel, see
> attached configuration file), I end up with duplicated binaries in the
> STAGING_DIR.
> 
> For example, for the 'ar' binutil. The first copy is in :
> 
> $ ls -l usr/bin/arm-linux-uclibcgnueabi-ar 
> -rwxr-xr-x 2 thomas thomas 2500708 2009-03-05 14:19 usr/bin/arm-linux-uclibcgnueabi-ar
             ^
These files are hardlinked, so the data ist stored only once.

Regards
Olaf

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

* [Buildroot] Duplication and size of binaries in generated toolchain
  2009-03-05 14:13 [Buildroot] Duplication and size of binaries in generated toolchain Thomas Petazzoni
  2009-03-05 14:22 ` Olaf Rempel
@ 2009-03-05 14:22 ` Peter Korsgaard
  2009-03-05 14:47   ` Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2009-03-05 14:22 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 Thomas> After compiling a toolchain with Buildroot (no packages, no
 Thomas> kernel, see attached configuration file), I end up with
 Thomas> duplicated binaries in the STAGING_DIR.

 Thomas> Same story for as, c++, g++, gcc, ld, nm, objcopy, objdump, ranlib,
 Thomas> strip. In total, it's 24 MB of binaries that are duplicated.

 Thomas> I'm not sure why the binaries without the arm-linux prefix are needed
 Thomas> in usr/arm-linux/bin. But if they are, couldn't they be symbolic links.

They are hard links to the same file:

find -type f -name \*ar|xargs stat
  File: `./usr/bin/powerpc-linux-uclibc-ar'
  Size: 3675834         Blocks: 7192       IO Block: 4096   regular file
Device: fe00h/65024d    Inode: 3638102     Links: 2
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/    peko)   Gid: ( 1000/    peko)
Access: 2009-03-05 13:39:31.000000000 +0100
Modify: 2009-03-05 13:39:31.000000000 +0100
Change: 2009-03-05 13:39:32.000000000 +0100
  File: `./usr/powerpc-linux-uclibc/bin/ar'
  Size: 3675834         Blocks: 7192       IO Block: 4096   regular file
Device: fe00h/65024d    Inode: 3638102     Links: 2
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/    peko)   Gid: ( 1000/    peko)
Access: 2009-03-05 13:39:31.000000000 +0100
Modify: 2009-03-05 13:39:31.000000000 +0100
Change: 2009-03-05 13:39:32.000000000 +0100

 Thomas> Last question: why are the individual binutils so big ? For example,
 Thomas> the strip program is 2.9 MB, ar is 2.4 MB. This looks ridiculously big
 Thomas> for such simple tools. First of all, they are not stripped and they
 Thomas> include debugging symbols, is it really necessary ? Even after
 Thomas> stripping, strip itself is still ~650 KB. Is it because of the static
 Thomas> linking against libbfd ?

I don't actually know. Bernhard?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] Duplication and size of binaries in generated toolchain
  2009-03-05 14:22 ` Peter Korsgaard
@ 2009-03-05 14:47   ` Thomas Petazzoni
  2009-03-05 14:56     ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2009-03-05 14:47 UTC (permalink / raw)
  To: buildroot

Le Thu, 05 Mar 2009 15:22:52 +0100,
Peter Korsgaard <jacmet@uclibc.org> a ?crit :

>  Thomas> I'm not sure why the binaries without the arm-linux prefix
>  Thomas> are needed in usr/arm-linux/bin. But if they are, couldn't
>  Thomas> they be symbolic links.
> 
> They are hard links to the same file:

Ok, I missed that. But why are they needed in the first place ?

Sincerly,

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

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

* [Buildroot] Duplication and size of binaries in generated toolchain
  2009-03-05 14:47   ` Thomas Petazzoni
@ 2009-03-05 14:56     ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2009-03-05 14:56 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 >> They are hard links to the same file:

 Thomas> Ok, I missed that. But why are they needed in the first place ?

They are not really needed for us, but gcc afaik creates them
automatically for cross compilers.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2009-03-05 14:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-05 14:13 [Buildroot] Duplication and size of binaries in generated toolchain Thomas Petazzoni
2009-03-05 14:22 ` Olaf Rempel
2009-03-05 14:22 ` Peter Korsgaard
2009-03-05 14:47   ` Thomas Petazzoni
2009-03-05 14:56     ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox