Skip to content

Commit f235eea

Browse files
richardlauBethGriggs
authored andcommittedMar 2, 2020
tools: unify make-v8.sh for ppc64le and s390x
Refactor `tools/make-v8.sh` to minimise differences between the `ppc64le` and `s390x` paths to allow us to enable `ccache` on the `ppc64le` machines in the CI. PR-URL: #31628 Refs: nodejs/build#1927 Refs: nodejs/build#1940 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
1 parent 61e2d48 commit f235eea

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed
 

‎tools/make-v8.sh

+12-19
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,28 @@ tools/node/fetch_deps.py .
88

99
ARCH="`arch`"
1010
if [[ "$ARCH" == "s390x" ]] || [[ "$ARCH" == "ppc64le" ]]; then
11+
TARGET_ARCH=$ARCH
12+
if [[ "$ARCH" == "ppc64le" ]]; then
13+
TARGET_ARCH="ppc64"
14+
fi
1115
# set paths manually for now to use locally installed gn
1216
export BUILD_TOOLS=/home/iojs/build-tools
1317
export LD_LIBRARY_PATH=$BUILD_TOOLS:$LD_LIBRARY_PATH
14-
export PATH=$BUILD_TOOLS:$PATH
15-
if [[ X"$CXX" != X ]]; then
16-
CXX_PATH=`which $CXX |grep g++`
17-
fi
18-
if [[ X"$CC" != X ]]; then
19-
CC_PATH=`which $CC |grep gcc`
20-
fi
18+
# Avoid linking to ccache symbolic links as ccache decides which
19+
# binary to run based on the name of the link (we always name them gcc/g++).
20+
CC_PATH=`which -a $CC gcc | grep -v ccache | head -n 1`
21+
CXX_PATH=`which -a $CXX g++ | grep -v ccache | head -n 1`
2122
rm -f "$BUILD_TOOLS/g++"
2223
rm -f "$BUILD_TOOLS/gcc"
23-
fi
24-
if [[ "$ARCH" == "s390x" ]]; then
2524
ln -s $CXX_PATH "$BUILD_TOOLS/g++"
2625
ln -s $CC_PATH "$BUILD_TOOLS/gcc"
26+
export PATH=$BUILD_TOOLS:$PATH
27+
2728
g++ --version
29+
gcc --version
2830
export PKG_CONFIG_PATH=$BUILD_TOOLS/pkg-config
29-
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="s390x" target_cpu="s390x"'
31+
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\""
3032
ninja -v -C out.gn/$BUILD_ARCH_TYPE d8 cctest inspector-test
31-
elif [[ "$ARCH" == "ppc64le" ]]; then
32-
if [[ X"$CXX" != X ]]; then
33-
ln -s /usr/bin/$CXX "$BUILD_TOOLS/g++"
34-
ln -s /usr/bin/$CC "$BUILD_TOOLS/gcc"
35-
fi
36-
g++ --version
37-
export PKG_CONFIG_PATH=$BUILD_TOOLS/pkg-config-files
38-
gn gen 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="ppc64" target_cpu="ppc64"'
39-
ninja -C out.gn/$BUILD_ARCH_TYPE d8 cctest inspector-test
4033
else
4134
PATH=~/_depot_tools:$PATH tools/dev/v8gen.py $BUILD_ARCH_TYPE --no-goma $V8_BUILD_OPTIONS
4235
PATH=~/_depot_tools:$PATH ninja -C out.gn/$BUILD_ARCH_TYPE/ d8 cctest inspector-test

0 commit comments

Comments
 (0)
Please sign in to comment.