New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Compiling Chromium! Will it finish? Will it work?
Hello!
I am trying to learn a little more about Linux and Operating System programming. Recently I tried to compile the X Window System. While compiling X, I learned about the Ninja build system.
Today, I'm compiling Chromium, because I read that Chromium's builds use Ninja. Here's what my build terminal and top
looked like a few minutes ago.
cdd9495a5d0758f19ffc...
Downloading 1 files took 2.598771 second(s)
Hook 'python3 src/testing/generate_location_tags.py --out src/testing/location_tags.json' took 12.60 secs
Hook 'python3 src/third_party/depot_tools/download_from_google_storage.py --no_auth --quiet --bucket chromium-style-perftest -d src/third_party/blink/renderer/core/css/perftest_data' took 27.25 secs
Running hooks: 57% (96/166) configure_reclient_cfgs
________ running 'python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance projects/rbe-chrome-untrusted/instances/default_instance --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project --skip_remoteexec_cfg_fetch' in '/home/Not_Oles/chromium'
generate reproxy.cfg using /home/Not_Oles/chromium/src/buildtools/reclient_cfgs/reproxy_cfg_templates/reproxy.cfg.template
Running hooks: 100% (166/166), done.
[Not_Oles@polonium src]$ time gn gen out/Default
Done. Made 19029 targets from 3626 files in 2644ms
real 0m2.742s
user 0m10.187s
sys 0m2.200s
[Not_Oles@polonium src]$ time autoninja -C out/Default chrome
ninja: Entering directory `out/Default'
[38127/57968] CXX obj/chrome/browser/ui/ui/read_later_side_panel_web_view.o
top - 23:18:02 up 1 day, 3:13, 2 users, load average: 14.02, 14.01, 14.00
Tasks: 242 total, 15 running, 227 sleeping, 0 stopped, 0 zombie
%Cpu(s): 94.1 us, 5.3 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.6 hi, 0.1 si, 0.0 st
MiB Mem : 64153.5 total, 10824.1 free, 6743.8 used, 47298.8 buff/cache
MiB Swap: 8192.0 total, 8192.0 free, 0.0 used. 57409.7 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
89491 Not_Oles 20 0 482348 429016 50816 R 95.0 0.7 0:06.79 clang++
89495 Not_Oles 20 0 398632 342704 47488 R 93.0 0.5 0:04.82 clang++
89493 Not_Oles 20 0 514464 452684 50176 R 90.4 0.7 0:06.96 clang++
89492 Not_Oles 20 0 470200 416216 50176 R 87.4 0.6 0:06.38 clang++
89490 Not_Oles 20 0 656232 597340 52864 R 86.7 0.9 0:09.64 clang++
89496 Not_Oles 20 0 379532 321772 48384 R 86.7 0.5 0:04.39 clang++
89499 Not_Oles 20 0 294284 239116 45824 R 84.1 0.4 0:03.19 clang++
89488 Not_Oles 20 0 691876 634592 53888 R 82.7 1.0 0:10.33 clang++
89487 Not_Oles 20 0 674376 616480 56448 R 82.1 0.9 0:10.00 clang++
89500 Not_Oles 20 0 254032 198280 45696 R 81.7 0.3 0:02.46 clang++
89494 Not_Oles 20 0 441616 385956 49536 R 81.4 0.6 0:05.87 clang++
89497 Not_Oles 20 0 331468 273332 46336 R 79.4 0.4 0:03.58 clang++
89498 Not_Oles 20 0 274036 217928 44672 R 63.5 0.3 0:02.77 clang++
89501 Not_Oles 20 0 143568 89792 39424 R 21.3 0.1 0:00.64 clang++
18 root 20 0 0 0 0 I 0.3 0.0 0:08.06 rcu_preempt
384 root 20 0 0 0 0 I 0.3 0.0 0:00.42 kworker/7:1-events
Recently I've been reading some of 21st Centruy C, older C stuff, and some current and even forward looking C stuff.
If somebody here wants to hop on, help, and teach me, that would be great! There is considerable excess server capacity.
Hope you guys also enjoy a very fun day! Best wishes!
Comments
good lucky
For me it takes ≈8 hours. Never ever compiled it again :D
install gentoo.
Yeah, our boy Ole here is a little crazy
Gentoo is great!
Congrats. So you now have
-march=native -mtune=native -O3
chromium or was it just for the experience?Or OpenBSD. One command makes everything incl. kernel and userland.
I found your problem. The project uses C++. That's a bug right there.
But seriously, C++ is notorious for long compile times.
Even more seriously, I hate C++.
Most seriously, C++ raped me, and got away with it because it is rich and powerful.
Compiling for Android costs me about 8hrs on a netcup 4-core VDS, and about 6hrs on a legacy E3 v3.
ps, do remember add ffmpeg support, or you won't be able to watch any video.
Is chromium available on OpenBSD? I initially wanted to point to NetBSD but then realized chromium wasn't ported. I guess that probably applies to all BSDs then? I figure porting from Open- to NetBSD shouldn't be that hard and chromium isn't exactly an unpopular application.
In regards to C++ you couldn't be more spot on. I'd write C over C++ any day but sadly even the newest C standards don't bring enough features to fully skip C++. There is C3 but sadly the author doesn't seem to really realize where C is actually lacking and rather fiddles with disallowing multiple variable declarations in a single statement.
It's in ports but I haven't tried it. TBH I never used OpenBSD as a desktop much.
I've tried it about a year ago. It performed pretty well while messing about. That being said I didn't do anything particularly taxing.
@Not_Oles Chromium takes FOREVER to build, so just be patient with it
Thanks! Looks like ffmpeg was built and linked.
Looks like a little over four hours on a Xeon E-2276G.
Cool. What's the size of the product? Just found it, rather huge, isn't it? Have you tried to strip all these debug symbols?
Nope! This is my first time compiling Chromium, so just running the default build. Besides, maybe I can play a little while with the debug symbols.
Is it
-O3
was stable enough on chromium? I have couple apps compile with-O3
flags sometimes have unexpected behaviour. And yes I use -bin on gentoo for chromium, so cant test enough is it valid or not.Memory-order related issues, I presume? AFAIK, modern gcc (>=8.0) works quite well with
-O3
on well-written codes.Well, i've never built chromium as i don't use it but i know that
-O3
has kind of a bad reputation. It never gave me any problems though and i've compiled while whole systems with it. In general i'd say if-O3
breaks some code it probably was relying on undefined behavior (like it should have been compiled with-fno-strict-aliasing
right from the start but didn't show because optimizing wasn't aggressive enough to trigger it) or is simply somehow bugged (missing initializations, overflows or whatever). It's perfectly possible that such cases exist though.Didn't know excalty, I tried restoring some old apps running on C, just poke the code little bit with my miserable experience and it was running on
-O2
but sometimes-O3
it crashes, strange enough but its good experience.I have the classic 1988 book by Brian Kernighan and Dennis Ritchie (C Programming Lang, 2nd Ed) collecting dust, just have to find some motivation to finish it
Once you have a good grasp of C, the next step is to dip into actual systems programming.
TLPI (The Linux Programming Interface) by Michael Kerrisk is highly recommended though a bit outdated at this point, hope he releases a 2nd edition 🤞
Pavin.
Had compiled chromium a few times. Took 30 hours once on a 2 core/8 GB VDS from RamNode. Worked nevertheless.