25 November, 2023
0 Comments
1.1 Install depot_tools
cd ~/oh/gitdir
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH:$HOME/oh/gitdir/depot_tools"
echo 'export PATH="$PATH:$HOME/oh/gitdir/depot_tools"' >> ~/.bashrc
1.2 Get the code
mkdir ~/chromium && cd ~/chromium
fetch --nohooks --nohistory chromium
cd src
./build/install-build-deps.sh
1.2.1 fix deps
fix some deps by adding “=” to force deps version.
example:
sudo apt install libgtk-3-dev
sudo apt install gir1.2-gtk-3.0=3.24.18-1ubuntu1
sudo apt install libgtk-3-0=3.24.18-1ubuntu1
sudo apt install libatk-bridge2.0-0=2.34.1-3
sudo apt install libatk-bridge2.0-dev
1.3 Run the hooks
cd ~/chromium/src
gclient runhooks
1.4 Setting up the build
cd ~/chromium/src
gn gen out/Default
alias cd="cd -P"
echo 'alias cd="cd -P"' >> ~/.bashrc
1.5 Build Chromium
ninja -C out/Default chrome
1.5.1 build error
[enway@ubuntu20 ((04df7298c9...)):src]$ninja -C out/Default chrome
ninja: Entering directory `out/Default'
[19781/57225] CXX obj/components/gwp_asan/client/client/malloc_shims.o
FAILED: obj/components/gwp_asan/client/client/malloc_shims.o
components/gwp_asan/client/lightweight_detector/malloc_shims.cc:138:5: error: cannot initialize a member subobject of type 'GoodSizeFn *const' (aka 'unsigned long (*const)(const allocator_shim::AllocatorDispatch *, unsigned long, void *)') with an rvalue of type 'bool (*)(const AllocatorDispatch *, void *, void *)': type mismatch at 2nd parameter ('size_t' (aka 'unsigned long') vs 'void *')
138 | &ClaimedAddressFn,
| ^~~~~~~~~~~~~~~~~
components/gwp_asan/client/lightweight_detector/malloc_shims.cc:145:5: error: cannot initialize a member subobject of type 'AlignedReallocFn *const' (aka 'void *(*const)(const allocator_shim::AllocatorDispatch *, void *, unsigned long, unsigned long, void *)') with an rvalue of type 'void (*)(const AllocatorDispatch *, void *, void *)': different number of parameters (5 vs 3)
145 | &AlignedFreeFn,
1.6 confirm git log
git log --date=short --pretty='format:%C(yellow)%h %C(green)%cd %C(blue)%an %C(reset)%s'
04df7298c9 2023-11-23 Jan Keitel Mark raw pointers to child elements inside MenuItemView as not dangling.
1.6.1 confirm clang version.
third_party/llvm-build/Release+Asserts/bin/clang++ -v
clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 73e963379e4d06ca75625f63a5604c286fe37040)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/enway/chromium/src/third_party/llvm-build/Release+Asserts/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
1.7 rm chromium and try again after diff commit.
rm -rf ~/chromium
mkdir ~/chromium && cd ~/chromium
fetch --nohooks --nohistory chromium
git log --date=short --pretty='format:%C(yellow)%h %C(green)%cd %C(blue)%an %C(reset)%s'
git log history
3706357cf6 2023-11-29 Hiroshige Hayashizaki Unify blink::mojom::ControllerServiceWorkerInfo creation
build again
./build/install-build-deps.sh
gclient runhooks
gn gen out/Default
build succeed.
[enway@ubuntu20 ((3706357cf6...)):src]$ninja -C out/Default chrome
ninja: Entering directory `out/Default'
[57296/57296] LINK ./chrome
Category: tech