Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Building Chromium on 32-bit x86(?)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Sep 27, 2016 11:11 pm    Post subject: Building Chromium on 32-bit x86(?) Reply with quote

The Chromium ebuild says I need 3GB of RAM. My laptop only has 2GB (maximum the chipset will recognise). But I wouldn't be much of a Gentoo user if I just took a warning saying it's impossible at face value. And besides, I used to build older versions of this with only 1GB.

So I'm trying to do it anyway, haven't had much success so far. Thankfully ccache takes away 90% of the compilation time, but the first few runs consistently explode at what looks like the very end:
Code:
[21397/21397] i686-pc-linux-gnu-g++ -pie -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -pthread -m32 -Wl,-O1 -Wl,--gc-sections -Wl,--no-as-needed -lpthread -Wl,--as-needed -Wl,-rpath-link=../Release -Wl,--disable-new-dtags -Wl,--export-dynamic -Wl,--sort-common,--hash-style=gnu,-z,combreloc,--no-keep-memory -o "./chrome" -Wl,--start-group @"./chrome.rsp"  -Wl,--end-group  -ldl -lrt -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo -lX11 -lXcomposite -lXcursor -lXdamage -lXext -lXfixes -lXi -lXrender -lXtst -lgmodule-2.0 -lgthread-2.0 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lexpat -lxml2 -lfontconfig -ldbus-1 -latomic -lresolv -lgio-2.0 -lz -lfreetype -lXss -lharfbuzz-icu -lharfbuzz -lpng16 -ljpeg -lXrandr -lre2 -lsnappy -latk-1.0 -lavcodec -lavformat -lavutil -lvpx -lm -lasound -lFLAC -lminizip -lgtk-x11-2.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lwebp -lwebpdemux -lxslt
FAILED: chrome
i686-pc-linux-gnu-g++ -pie -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -pthread -m32 -Wl,-O1 -Wl,--gc-sections -Wl,--no-as-needed -lpthread -Wl,--as-needed -Wl,-rpath-link=../Release -Wl,--disable-new-dtags -Wl,--export-dynamic -Wl,--sort-common,--hash-style=gnu,-z,combreloc,--no-keep-memory -o "./chrome" -Wl,--start-group @"./chrome.rsp"  -Wl,--end-group  -ldl -lrt -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo -lX11 -lXcomposite -lXcursor -lXdamage -lXext -lXfixes -lXi -lXrender -lXtst -lgmodule-2.0 -lgthread-2.0 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lexpat -lxml2 -lfontconfig -ldbus-1 -latomic -lresolv -lgio-2.0 -lz -lfreetype -lXss -lharfbuzz-icu -lharfbuzz -lpng16 -ljpeg -lXrandr -lre2 -lsnappy -latk-1.0 -lavcodec -lavformat -lavutil -lvpx -lm -lasound -lFLAC -lminizip -lgtk-x11-2.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lwebp -lwebpdemux -lxslt
/usr/lib/gcc/i686-pc-linux-gnu/5.4.0/../../../../i686-pc-linux-gnu/bin/ld: fatal error: ./chrome: mmap: failed to allocate 194546060 bytes for output file: Cannot allocate memory
collect2: error: ld returned 1 exit status
distcc[2152] ERROR: compile (null) on localhost failed
ninja: build stopped: subcommand failed.

ld is running out of memory trying to mmap, which is a problem. I can't give it more. The warning says 3GB though, and I've got 2GB RAM + 2.75GB swap. It seems like it's ignoring the swap space completely and not even trying.

Things I haven't tried:
  • ld.bfd — maybe it'll be more swap-friendly than ld.gold
  • Adding LDFLAGS="-Wl,--reduce-memory-overheads" (which doesn't seem to be a valid ld.gold option) — the 40% reduction in the manpage sounds promising.

(Doing a build with the latter now, will update with results...)
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Wed Sep 28, 2016 1:02 am    Post subject: Reply with quote

It works!
Code:
>>> Verifying ebuild manifests
>>> Running pre-merge checks for www-client/chromium-54.0.2840.34
 * Checking for at least 3 GiB RAM ...
 * There is NOT at least 3 GiB RAM
 * Checking for at least 5 GiB disk space at "/var/tmp/portage/www-client/chromium-54.0.2840.34/temp" ...
 *
 * Space constraints set in the ebuild were not met!
 * The build will most probably fail, you should enhance the space
 * as per failed tests.
 *
>>> Emerging (1 of 1) www-client/chromium-54.0.2840.34::gentoo
>>> Installing (1 of 1) www-client/chromium-54.0.2840.34::gentoo
>>> Recording www-client/chromium in "world" favorites file...
>>> Jobs: 1 of 1 complete                           Load avg: 1.45, 1.41, 1.63

~ # qlop -tHl chromium
Wed Sep 28 01:47:57 2016 >>> www-client/chromium-54.0.2840.34
chromium: 1 hour, 35 minutes, 58 seconds for 1 merges

~ # lscpu
Architecture:          i686
CPU op-mode(s):        32-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    2
Core(s) per socket:    1
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 28
Model name:            Intel(R) Atom(TM) CPU N270   @ 1.60GHz
Stepping:              2
CPU MHz:               1600.000
CPU max MHz:           1600.0000
CPU min MHz:           800.0000
BogoMIPS:              3193.12
L1d cache:             24K
L1i cache:             32K
L2 cache:              512K
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts aperfmperf eagerfpu pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm movbe lahf_lm dtherm

~ # free -m
              total        used        free      shared  buff/cache   available
Mem:           2013          32        1392           0         588        1720
Swap:          2740          12        2728


For reference, here's everything I ended up adding:
/etc/portage/package.use/chromium.conf:
www-client/chromium -hangouts -suid -tcmalloc

/etc/portage/package.env/chromium-x86.conf:
www-client/chromium ccache.conf chromium-lowmem.conf

/etc/portage/env/ccache.conf:
FEATURES=ccache

/etc/portage/env/chromium-lowmem.conf:
I_KNOW_WHAT_I_AM_DOING=1
LDFLAGS="-Wl,--sort-common,--hash-style=gnu,-z,combreloc,--no-keep-memory,--reduce-memory-overheads"

--reduce-memory-overheads, or the combination of that plus ld.bfd, was what got it to work. The rest probably doesn't factor into fixing the OOM problem but it's here in case.

Anyway, I hope burning 36 hours of CPU time for science helps someone else out there.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Wed Sep 28, 2016 5:50 am    Post subject: Re: Building Chromium on 32-bit x86(?) Reply with quote

Ant P. wrote:
I can't give it more. The warning says 3GB though, and I've got 2GB RAM + 2.75GB swap. It seems like it's ignoring the swap space completely and not even trying.

Just for info read this post of Hu
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum