1
+ #! /bin/bash -eu
2
+ # Copyright 2025 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # ###############################################################################
17
+
18
+ # Configure arguments for gn build
19
+ ARGS=' is_asan = true
20
+ is_component_build = false
21
+ use_clang_modules = false
22
+ is_debug = true
23
+ symbol_level = 2
24
+ forbid_non_component_debug_builds = false
25
+ use_debug_fission = false
26
+ use_dwarf5 = true
27
+ target_cpu = "x64"
28
+ target_os = "linux"
29
+ use_reclient = false
30
+ use_remoteexec = false
31
+ use_siso = false
32
+ treat_warnings_as_errors = false
33
+ libcxx_is_shared = false
34
+ v8_enable_backtrace = true
35
+ v8_enable_slow_dchecks = false
36
+ v8_optimized_debug = false
37
+ v8_enable_fast_mksnapshot = true'
38
+
39
+ if [[ -n " ${INDEXER_BUILD:- } " ]]; then
40
+ ARGS=" $ARGS clang_base_path=\" /opt/toolchain\" "
41
+ fi
42
+
43
+ # Generate ninja file for build
44
+ gn gen out/fuzz --args=" $ARGS "
45
+ echo $SANITIZER
46
+ # Build binary
47
+ ninja -C out/fuzz d8 -j$( nproc)
48
+
49
+ # Copy binary to $OUT
50
+ cp ./out/fuzz/{d8,snapshot_blob.bin} $OUT
0 commit comments