Skip to content

Commit c1c4fe9

Browse files
richardlautargos
authored andcommitted
tools: fix tools/make-v8.sh for clang
Update `tools/make-v8.sh` so that it can work with either `gcc` or `clang`. Adds: - clang settings when CC/CXX environment variables set to clang/clang++. - Turns off warnings as errors. Removes: - goma settings. - Machine specific settings (moved to Jenkins job configuration). Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5541431 PR-URL: #59893 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent a2bd709 commit c1c4fe9

File tree

1 file changed

+7
-25
lines changed

1 file changed

+7
-25
lines changed

tools/make-v8.sh

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,19 @@ if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then
2020
if [ "$ARCH" = "ppc64le" ]; then
2121
TARGET_ARCH="ppc64"
2222
fi
23-
# set paths manually for now to use locally installed gn
24-
export BUILD_TOOLS=/home/iojs/build-tools
25-
export LD_LIBRARY_PATH="$BUILD_TOOLS:$LD_LIBRARY_PATH"
26-
rm -f "$BUILD_TOOLS/g++"
27-
rm -f "$BUILD_TOOLS/gcc"
28-
# V8's build config looks for binaries called `gcc` and `g++` if not using
29-
# clang. Ensure that `gcc` and `g++` point to the compilers we want to
30-
# invoke, creating symbolic links placed at the front of PATH, if needed.
31-
# Avoid linking to ccache symbolic links as ccache decides which binary
32-
# to run based on the name of the link (i.e. `gcc`/`g++` in our case).
33-
# shellcheck disable=SC2154
34-
if [ "$CC" != "" ] && [ "$CC" != "gcc" ]; then
35-
CC_PATH=$(command -v "$CC" gcc | grep -v ccache | head -n 1)
36-
ln -s "$CC_PATH" "$BUILD_TOOLS/gcc"
37-
fi
38-
# shellcheck disable=SC2154
39-
if [ "$CXX" != "" ] && [ "$CXX" != "g++" ]; then
40-
CXX_PATH=$(command -v "$CXX" g++ | grep -v ccache | head -n 1)
41-
ln -s "$CXX_PATH" "$BUILD_TOOLS/g++"
42-
fi
43-
export PATH="$BUILD_TOOLS:$PATH"
4423
# Propagate ccache to gn.
24+
# shellcheck disable=SC2154
4525
case "$CXX" in
4626
*ccache*) CC_WRAPPER="cc_wrapper=\"ccache\"" ;;
4727
*) ;;
4828
esac
4929

50-
g++ --version
51-
gcc --version
52-
export PKG_CONFIG_PATH=$BUILD_TOOLS/pkg-config
53-
gn gen -v "out.gn/$BUILD_ARCH_TYPE" --args="is_component_build=false is_debug=false use_goma=false goma_dir=\"None\" use_custom_libcxx=false v8_target_cpu=\"$TARGET_ARCH\" target_cpu=\"$TARGET_ARCH\" v8_enable_backtrace=true $CC_WRAPPER"
30+
# shellcheck disable=SC2154
31+
case "$CXX" in
32+
*clang*) GN_COMPILER_OPTS="is_clang=true clang_base_path=\"/usr\" clang_use_chrome_plugins=false treat_warnings_as_errors=false use_custom_libcxx=false" ;;
33+
*) GN_COMPILER_OPTS="treat_warnings_as_errors=false use_custom_libcxx=false" ;;
34+
esac
35+
gn gen -v "out.gn/$BUILD_ARCH_TYPE" --args="$GN_COMPILER_OPTS is_component_build=false is_debug=false v8_target_cpu=\"$TARGET_ARCH\" target_cpu=\"$TARGET_ARCH\" v8_enable_backtrace=true $CC_WRAPPER"
5436
ninja -v -C "out.gn/$BUILD_ARCH_TYPE" "${JOBS_ARG}" d8 cctest inspector-test
5537
else
5638
DEPOT_TOOLS_DIR="$(cd depot_tools && pwd)"

0 commit comments

Comments
 (0)