Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Compiling Chromium! Will it finish? Will it work?
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.

Compiling Chromium! Will it finish? Will it work?

Not_OlesNot_Oles Moderator, Patron Provider

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! :)

Thanked by 2ariq01 tmntwitw

Comments

  • good lucky

    Thanked by 1Not_Oles
  • tentortentor Member, Patron Provider

    For me it takes ≈8 hours. Never ever compiled it again :D

  • There is considerable excess server capacity.

    install gentoo.

    Thanked by 1Not_Oles
  • @tentor said:
    For me it takes ≈8 hours. Never ever compiled it again :D

    Yeah, our boy Ole here is a little crazy ;)

  • Not_OlesNot_Oles Moderator, Patron Provider

    @lowenduser1 said:

    There is considerable excess server capacity.

    install gentoo.

    Gentoo is great! :)

  • Not_OlesNot_Oles Moderator, Patron Provider
    edited January 24
    [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'
    [57968/57968] LINK ./chrome
    
    real    249m21.723s
    user    2786m50.197s
    sys     176m24.382s
    [Not_Oles@polonium src]$ echo $?
    0
    [Not_Oles@polonium src]$ ls -l out/Default/chrome
    -rwxr-xr-x. 1 Not_Oles Not_Oles 1262954248 Jan 24 01:45 out/Default/chrome
    [Not_Oles@polonium src]$ ldd out/Default/chrome | wc -l
    518
    [Not_Oles@polonium src]$ 
    
  • edited January 24

    @Not_Oles said:
    ... [log] ...

    Congrats. So you now have -march=native -mtune=native -O3 chromium or was it just for the experience?

  • raindog308raindog308 Administrator, Veteran

    @lowenduser1 said: install gentoo.

    Or OpenBSD. One command makes everything incl. kernel and userland.

    @Not_Oles said: clang++

    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.

    #MeToo++
    
    Thanked by 1totally_not_banned
  • noisycodenoisycode Member
    edited January 24

    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.

    Thanked by 1Not_Oles
  • edited January 24

    @raindog308 said:

    @lowenduser1 said: install gentoo.

    Or OpenBSD

    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.

    Thanked by 1raindog308
  • raindog308raindog308 Administrator, Veteran

    @totally_not_banned said: Is chromium available on OpenBSD?

    It's in ports but I haven't tried it. TBH I never used OpenBSD as a desktop much.

    Thanked by 1totally_not_banned
  • DartNodeDartNode Member, Patron Provider

    @raindog308 said:

    @totally_not_banned said: Is chromium available on OpenBSD?

    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.

    Thanked by 1Not_Oles
  • @Not_Oles Chromium takes FOREVER to build, so just be patient with it B)

    Thanked by 1Not_Oles
  • Not_OlesNot_Oles Moderator, Patron Provider

    @noisycode said: ps, do remember add ffmpeg support, or you won't be able to watch any video.

    Thanks! Looks like ffmpeg was built and linked.

    [Not_Oles@polonium Default]$ ls | grep ffmpeg
    ffmpeg_regression_tests.runtime_deps
    libffmpeg.so
    libffmpeg.so.TOC
    [Not_Oles@polonium Default]$ ldd chrome | grep ffmpeg
            libffmpeg.so => /home/Not_Oles/chromium/src/out/Default/./libffmpeg.so (0x00007ff45b800000)
    [Not_Oles@polonium Default]$ 
    
  • Not_OlesNot_Oles Moderator, Patron Provider

    @chitree said:
    @Not_Oles Chromium takes FOREVER to build, so just be patient with it B)

    Looks like a little over four hours on a Xeon E-2276G. :)

    @Not_Oles said:

    [Not_Oles@polonium src]$ time autoninja -C out/Default chrome
    ninja: Entering directory `out/Default'
    [57968/57968] LINK ./chrome

    real 249m21.723s
    user 2786m50.197s
    sys 176m24.382s
    [Not_Oles@polonium src]$

  • noisycodenoisycode Member
    edited January 24

    @Not_Oles said: Thanks! Looks like ffmpeg was built and linked.

    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?

    Thanked by 1Not_Oles
  • Not_OlesNot_Oles Moderator, Patron Provider

    @noisycode said: 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. :)

  • @totally_not_banned said:
    Congrats. So you now have -march=native -mtune=native -O3 chromium or was it just for the experience?

    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.

  • noisycodenoisycode Member
    edited January 24

    @ailice said:

    @totally_not_banned said:
    Congrats. So you now have -march=native -mtune=native -O3 chromium or was it just for the experience?

    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.

    Thanked by 1totally_not_banned
  • ariq01ariq01 Member
    edited January 24

    @lowenduser1 said:

    There is considerable excess server capacity.

    install gentoo.

    Thanked by 1Not_Oles
  • edited January 24

    @ailice said:

    @totally_not_banned said:
    Congrats. So you now have -march=native -mtune=native -O3 chromium or was it just for the experience?

    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.

    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.

  • @noisycode said:
    Memory-order related issues, I presume? AFAIK, modern gcc (>=8.0) works quite well with -O3 on well-written codes.

    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. :D

    Thanked by 1Not_Oles
  • mailcheapmailcheap Member, Host Rep

    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 :D

    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.

    Thanked by 1Not_Oles
  • Had compiled chromium a few times. Took 30 hours once on a 2 core/8 GB VDS from RamNode. Worked nevertheless.

    Thanked by 1Not_Oles
Sign In or Register to comment.