forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtserver_lto.sh
executable file
·43 lines (36 loc) · 1 KB
/
tserver_lto.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
#!/usr/bin/env bash
. "${BASH_SOURCE%/*}/common-build-env.sh"
activate_virtualenv
set_pythonpath
# usage:
# for release build : ./tserver_lto.sh
# for prof_gen build : ./tserver_lto.sh prof_gen
# for prof_use build : ./tserver_lto.sh prof_use path/to/pgo/data
if [[ $# -gt 0 ]]; then
build_type=$1
validate_build_type "$build_type"
shift
if [[ $build_type == "prof_use" ]]; then
expect_num_args 1 "$@"
pgo_data_path="$1"
shift
fi
else
build_type="release"
fi
if [[ $( uname -m ) == "x86_64" ]]; then
build_root_basename="$build_type-clang13-linuxbrew-full-lto-ninja"
else
build_root_basename="$build_type-clang12-full-lto-ninja"
fi
dep_graph_cmd=(
"${YB_SRC_ROOT}/python/yb/dependency_graph.py"
"--build-root=${YB_SRC_ROOT}/build/${build_root_basename}"
"--file-regex=^.*/yb-tserver$"
)
if [[ $build_type == "prof_use" ]]; then
dep_graph_cmd+=( "--build-args=--pgo-data-path ${pgo_data_path}" )
fi
dep_graph_cmd+=( link-whole-program "$@" )
set -x
"${dep_graph_cmd[@]}"