-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathfullbuild.sh
executable file
·54 lines (46 loc) · 2.29 KB
/
fullbuild.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
RED='\033[0;31m'
NC='\033[0m'
# comment this when you have modified args.gn
echo "First, please modify args.gn to to set ${RED}clang_base_path = {UFO_DIR}/build${NC}"; exit;
UFO_HOME=$PWD
# install git and cmake
sudo apt install git cmake
# build LLVM+UFO
export BRANCH=release_70
git clone http://llvm.org/git/llvm.git -b $BRANCH
git clone http://llvm.org/git/clang.git llvm/tools/clang -b $BRANCH
git clone http://llvm.org/git/clang-tools-extra.git llvm/tools/clang/tools/extra -b $BRANCH
mv ufo-rt llvm/projects/
mkdir build && cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TESTS=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=OFF ../llvm
make -j8
export PATH=$UFO_HOME/build/bin:$PATH
# get src for chromium 70.0.3537.2 (last build to use clang 7.0.0)
cd $UFO_HOME && mkdir chromium && cd chromium
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$UFO_HOME/chromium/depot_tools:$PATH
fetch --nohooks chromium
cd src && ./build/install-build-deps.sh
git checkout tags/70.0.3537.2 -b v70.0.3537.2
# NOTE: if gclient sync terminates bc of error 57 (unstaged changes), you should
# follow the steps found in this thread:
# https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/SgwR4kEMZ7I
# Then, you can run the commands STARTING from gclient sync
gclient sync
gn gen out/ufo
mv $UFO_HOME/args.gn ./out/ufo/
mv $UFO_HOME/BUILD.gn ./build/config/compiler/
# alternatively, instead of adding to the tail of $PATH, we could copy chromium's
# lld and its symbolic links into our ufo/build/bin directory. You should change
# to the alternative if you have lld defined already in your path somewhere.
export PATH=$PATH:$UFO_HOME/chromium/src/third_party/llvm-build/Release+Asserts/bin/
# build chromium
autoninja -C out/ufo chrome
# SANDBOX
# NOTE: "The Linux SUID sandbox is almost but not completely removed"
# you may only need to do this when building older versions of Chromium
# https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md
# alternatively, instead of building sandbox you can pass '--no-sandbox' to chrome binary
autoninja -C out/ufo chrome_sandbox
echo 'export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox' >> ~/.bashrc