Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 438522 - sys-devel/binutils: --enable-64-bit-bfd causes significant performance degradation on 32bit platforms
Summary: sys-devel/binutils: --enable-64-bit-bfd causes significant performance degrad...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: ARM Linux
: Normal enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-15 22:52 UTC by Siarhei Siamashka
Modified: 2012-12-23 23:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Siarhei Siamashka 2012-10-15 22:52:33 UTC
The linker needs more memory if binutils is configured with --enable-64-bit-bfd option. Avoiding --enable-64-bit-bfd for binutils might be a better choice for native compilation on some embedded 32-bit platforms such as ARM.

Reproducible: Always

Steps to Reproduce:
1. Take some ARM device (1.4GHz quad Cortex-A9 with 1GB of RAM in my case, swap on SD card)
2. Disable swap
3. Try to emerge www-client/firefox-15.0.1 and wait until it finishes compiling and runs out of memory on the linking step
4. Enable swap and re-run the failed link command, measure time and watch swap usage:

real	12m14.108s
user	1m15.655s
sys	0m25.470s

Swap usage peaks at ~1310MB. Hence the total memory usage is ~2.3GB (1GB RAM + ~1.3GB swap) 

5. Edit /usr/portage/eclass/toolchain-binutils.eclass and remove the line which enforces --enable-64-bit-bfd option, emerge binutils

6. Run the same mozilla link command again, measure time and watch swap usage:

real	8m27.364s
user	1m12.890s
sys	0m19.815s

Swap usage peaks at ~760MB. Hence the total memory usage is ~1.8GB (1GB RAM + ~0.8GB swap). 

Looks like quite a measurable improvement. Memory footprint goes down by nearly 30%. It might be even possible to successfully emerge firefox with 2GB VMSPLIT kernel configuration.
Comment 1 SpanKY gentoo-dev 2012-10-17 06:13:38 UTC
was first introduced here:
http://sources.gentoo.org/sys-devel/binutils/binutils-2.11.92.0.12.3-r1.ebuild

unfortunately, there's no changelog and the commit message is useless, and there's no reference as to why the flag was added.

we can probably restrict the flag so it only gets passed with USE=multitarget.

i'll have to noodle on it, but i can't think of reasons off the top of my head as to why not enabling this for 32bit hosts/targets would be a problem.