Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f27bcec

Browse filesBrowse files
richardlaubengl
authored andcommitted
build: use ccache in make-v8.sh on ppc64le and s390x
If `ccache` is available, use it during V8 builds on ppc64le and s390x. Only create the `gcc` and `g++` shims if necessary. PR-URL: #42204 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 1d0468f commit f27bcec
Copy full SHA for f27bcec

File tree

Expand file treeCollapse file tree

1 file changed

+22
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-10
lines changed
Open diff view settings
Collapse file

‎tools/make-v8.sh‎

Copy file name to clipboardExpand all lines: tools/make-v8.sh
+22-10Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cd deps/v8 || exit
99
find . -type d -name .git -print0 | xargs -0 rm -rf
1010
../../tools/v8/fetch_deps.py .
1111

12-
ARCH="`arch`"
12+
ARCH=$(arch)
1313
if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then
1414
TARGET_ARCH=$ARCH
1515
if [ "$ARCH" = "ppc64le" ]; then
@@ -18,22 +18,34 @@ if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then
1818
# set paths manually for now to use locally installed gn
1919
export BUILD_TOOLS=/home/iojs/build-tools
2020
export LD_LIBRARY_PATH="$BUILD_TOOLS:$LD_LIBRARY_PATH"
21-
# Avoid linking to ccache symbolic links as ccache decides which
22-
# binary to run based on the name of the link (we always name them gcc/g++).
23-
# shellcheck disable=SC2154
24-
CC_PATH=`command -v "$CC" gcc | grep -v ccache | head -n 1`
25-
# shellcheck disable=SC2154
26-
CXX_PATH=`command -v "$CXX" g++ | grep -v ccache | head -n 1`
2721
rm -f "$BUILD_TOOLS/g++"
2822
rm -f "$BUILD_TOOLS/gcc"
29-
ln -s "$CXX_PATH" "$BUILD_TOOLS/g++"
30-
ln -s "$CC_PATH" "$BUILD_TOOLS/gcc"
23+
# V8's build config looks for binaries called `gcc` and `g++` if not using
24+
# clang. Ensure that `gcc` and `g++` point to the compilers we want to
25+
# invoke, creating symbolic links placed at the front of PATH, if needed.
26+
# Avoid linking to ccache symbolic links as ccache decides which binary
27+
# to run based on the name of the link (i.e. `gcc`/`g++` in our case).
28+
# shellcheck disable=SC2154
29+
if [ "$CC" != "" ] && [ "$CC" != "gcc" ]; then
30+
CC_PATH=$(command -v "$CC" gcc | grep -v ccache | head -n 1)
31+
ln -s "$CC_PATH" "$BUILD_TOOLS/gcc"
32+
fi
33+
# shellcheck disable=SC2154
34+
if [ "$CXX" != "" ] && [ "$CXX" != "g++" ]; then
35+
CXX_PATH=$(command -v "$CXX" g++ | grep -v ccache | head -n 1)
36+
ln -s "$CXX_PATH" "$BUILD_TOOLS/g++"
37+
fi
3138
export PATH="$BUILD_TOOLS:$PATH"
39+
# Propagate ccache to gn.
40+
case "$CXX" in
41+
*ccache*) CC_WRAPPER="cc_wrapper=\"ccache\"" ;;
42+
*) ;;
43+
esac
3244

3345
g++ --version
3446
gcc --version
3547
export PKG_CONFIG_PATH=$BUILD_TOOLS/pkg-config
36-
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"
48+
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"
3749
ninja -v -C "out.gn/$BUILD_ARCH_TYPE" d8 cctest inspector-test
3850
else
3951
DEPOT_TOOLS_DIR="$(cd _depot_tools && pwd)"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.