Building Chromium for CrOS (amd64-generic)

185 views
Skip to first unread message

Adam Kearn

unread,
May 7, 2019, 4:01:08 PM5/7/19
to Chromium-dev
Hello, I am trying to include my chromium (browser) build into my OS image.
I have Chromium working and have tested it in the OZone thing and it workes just how I like it,  But when I try to include it into my build it doesn't seem to be doing anything...

These are the command I have run:
cd ${HOME}/chromiumos/tot
cros_sdk --chrome_root=${HOME}/chromium

export BOARD=amd64-generic
cros_workon --board=${BOARD} start chromeos-chrome
emerge-${BOARD} chromeos-chrome

That gives me this screen:
Calculating dependencies... done!

>>> Emerging (1 of 1) chromeos-base/chromeos-chrome-9999::chromiumos for /build/amd64-generic/
 * Running stacked hooks for pre_pkg_setup
 *    sysroot_build_bin_dir ...                                                                                                         [ ok ]
 * Running stacked hooks for post_pkg_setup
 *    python_eclass_hack ...                                                                                                            [ ok ]
 * Running stacked hooks for pre_src_unpack
 *    python_multilib_setup ...                                                                                                         [ ok ]
>>> Unpacking source...

 * If you want to develop or hack on the browser itself, you should follow the
 * simple chrome workflow instead of using emerge:

 * CHROME_ORIGIN VALUE is LOCAL_SOURCE
 * Using GN from /home/adam/chrome_root/src/buildtools/linux64/gn
>>> Source unpacked in /build/amd64-generic/tmp/portage/chromeos-base/chromeos-chrome-9999/work
 * Running stacked hooks for post_src_unpack
 *    asan_init ...                                                                                                                     [ ok ]
 * Running stacked hooks for pre_src_prepare
 *    enable_cxx_exceptions ...                                                                                                         [ ok ]
>>> Preparing source in /build/amd64-generic/tmp/portage/chromeos-base/chromeos-chrome-9999/work/chromeos-chrome-9999 ...
 * /home/adam/chrome_root should be set here properly
>>> Source prepared.
>>> Configuring source in /build/amd64-generic/tmp/portage/chromeos-base/chromeos-chrome-9999/work/chromeos-chrome-9999 ...
 * Building with the compiler settings:
 *   CFLAGS = -pipe -march=x86-64 -msse3 -fno-split-dwarf-inlining -fdebug-info-for-profiling -faddrsig -Wno-unknown-warning-option
 *   CXXFLAGS = -pipe -march=x86-64 -msse3 -fno-split-dwarf-inlining -fdebug-info-for-profiling -D__google_stl_debug_vector=1 -faddrsig -Wno-unknown-warning-option -stdlib=libc++
 *   CPPFLAGS = 
 *   LDFLAGS = -Wl,-O2 -Wl,--as-needed -stdlib=libc++
/mnt/host/depot_tools/gclient runhooks --force
Hook '/usr/bin/python2.7 src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync --extract' took 12.52 secs
Running hooks: 100% (75/75), done.
 * GN_ARGS = is_official_build=true is_debug=false  use_v4l2_codec=true use_v4lplugin=false use_vaapi=true use_ozone=true use_evdev_gestures=true use_xkbcommon=true linux_use_bundled_binutils=false use_debug_fission=false enable_remoting=true enable_nacl=true icu_use_data_file=true use_cras=true use_system_harfbuzz=false use_system_freetype=false use_system_libsync=true use_cups=true use_jumbo_build=false use_bundled_fontconfig=false use_new_tcmalloc=false enable_kiosk_next=false is_asan=false is_clang=true cros_host_is_clang=true cros_v8_snapshot_is_clang=true clang_use_chrome_plugins=false use_thin_lto=true use_lld=true is_cfi=true use_cfi_cast=true ozone_auto_platforms=false ozone_platform_gbm=true use_system_minigbm=true use_system_libdrm=true treat_warnings_as_errors=false use_debug_fission=true symbol_level=2 target_sysroot="/build/amd64-generic" system_libdir="lib64" pkg_config="/build/amd64-generic/build/bin/pkg-config" target_os="chromeos" host_pkg_config="x86_64-pc-linux-gnu-pkg-config" ozone_platform="gbm" target_cpu="x64" cros_target_ar="llvm-ar" cros_target_cc="x86_64-cros-linux-gnu-clang" cros_target_cxx="x86_64-cros-linux-gnu-clang++" host_toolchain="//build/toolchain/cros:host" custom_toolchain="//build/toolchain/cros:target" v8_snapshot_toolchain="//build/toolchain/cros:v8_snapshot" cros_target_ld="x86_64-cros-linux-gnu-clang++" cros_target_nm="llvm-nm" cros_target_readelf="x86_64-cros-linux-gnu-readelf" cros_target_extra_cflags="-pipe -march=x86-64 -msse3 -fno-split-dwarf-inlining -fdebug-info-for-profiling -faddrsig -Wno-unknown-warning-option " cros_target_extra_cppflags="" cros_target_extra_cxxflags="-pipe -march=x86-64 -msse3 -fno-split-dwarf-inlining -fdebug-info-for-profiling -D__google_stl_debug_vector=1 -faddrsig -Wno-unknown-warning-option -stdlib=libc++ " cros_target_extra_ldflags="-Wl,-O2 -Wl,--as-needed -stdlib=libc++ -Wl,-plugin-opt,-import-instr-limit=30 -Wl,-z,keep-text-section-prefix" cros_host_cc="x86_64-pc-linux-gnu-clang -B/usr/bin" cros_host_cxx="x86_64-pc-linux-gnu-clang++ -B/usr/bin" cros_host_ar="llvm-ar" cros_host_ld="x86_64-pc-linux-gnu-clang++" cros_host_nm="llvm-nm" cros_host_readelf="x86_64-pc-linux-gnu-readelf" cros_host_extra_cflags=" -Wno-unknown-warning-option" cros_host_extra_cxxflags=" -Wno-unknown-warning-option" cros_host_extra_cppflags="" cros_host_extra_ldflags="" cros_v8_snapshot_cc="x86_64-pc-linux-gnu-clang -B/usr/bin" cros_v8_snapshot_cxx="x86_64-pc-linux-gnu-clang++ -B/usr/bin" cros_v8_snapshot_ar="llvm-ar" cros_v8_snapshot_ld="x86_64-pc-linux-gnu-clang++" cros_v8_snapshot_nm="llvm-nm" cros_v8_snapshot_readelf="x86_64-pc-linux-gnu-readelf" cros_v8_snapshot_extra_cflags=" -Wno-unknown-warning-option" cros_v8_snapshot_extra_cxxflags=" -Wno-unknown-warning-option" cros_v8_snapshot_extra_cppflags="" cros_v8_snapshot_extra_ldflags=""
Done. Made 14368 targets from 2177 files in 32860ms
>>> Source configured.
>>> Compiling source in /build/amd64-generic/tmp/portage/chromeos-base/chromeos-chrome-9999/work/chromeos-chrome-9999 ...
ninja: Entering directory `c/Release'
[1/2] LINK ./chrome


I am slightly worried because it says    "* GN_ARGS = is_official_build=true"  is that why it is stuck trying to link?  Is it trying to build the official chrome even though I don't have access to goma??



Christian Biesinger

unread,
May 7, 2019, 4:06:29 PM5/7/19
to adamk...@gmail.com, Chromium-dev
It is almost certainly not stuck -- but linking chrome takes a
relatively long time (and a lot of memory) when using
is_official_build. You likely just have to be more patient.

Christian
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
> ---
> You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/262fb040-94bf-48db-8d0f-4460c75815ff%40chromium.org.

Adam Kearn

unread,
May 7, 2019, 4:10:45 PM5/7/19
to Chromium-dev
Thanks for the quick reply Christian!!

Ok,   just to clarify I am not trying to build the official build but my own custom one.
Also is it normal to see the CPU not doing anything?  Also, the RAM usage hasn't moved for ages it's stuck on 57%.


Thanks 
Adam

screenshot.png

Christian Biesinger

unread,
May 7, 2019, 4:15:08 PM5/7/19
to adamk...@gmail.com, Chromium-dev
I don't know what that tool shows. If you run "top", how much VIRT memory does ld use?

I was only referring to the is_official_build=true flag which you are using. I am not familiar with ChromeOS builds, so I don't know where that comes from (chromium-os-dev is usually a better mailing list for that).

Christian

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

Adam Kearn

unread,
May 7, 2019, 4:23:17 PM5/7/19
to Chromium-dev, adamk...@gmail.com
I am not sure how to use the TOP command,  I normally use the GNOME System Monter


screenshot.JPG

Christian Biesinger

unread,
May 7, 2019, 4:27:24 PM5/7/19
to adamk...@gmail.com, Chromium-dev
OK, so lld is using 47 GB of virtual address space.With only 16 GB of RAM, it makes sense that the CPU is fairly idle because most of the time is spent loading data from disk (presumably mostly .o/.a files)

You'll really want more memory if you want to use is_official_build (or find a way to turn that off)

Christian

Reply all
Reply to author
Forward
0 new messages