@@ -18,22 +18,33 @@ if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then
18
18
# set paths manually for now to use locally installed gn
19
19
export BUILD_TOOLS=/home/iojs/build-tools
20
20
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`
27
21
rm -f " $BUILD_TOOLS /g++"
28
22
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
+ if [ " $CC " != " " ] && [ " $CC " != " gcc" ]; then
29
+ # shellcheck disable=SC2154
30
+ CC_PATH=` command -v " $CC " gcc | grep -v ccache | head -n 1`
31
+ ln -s " $CC_PATH " " $BUILD_TOOLS /gcc"
32
+ fi
33
+ if [ " $CXX " != " " ] && [ " $CXX " != " g++" ]; then
34
+ # shellcheck disable=SC2154
35
+ CXX_PATH=` command -v " $CXX " g++ | grep -v ccache | head -n 1`
36
+ ln -s " $CXX_PATH " " $BUILD_TOOLS /g++"
37
+ fi
31
38
export PATH=" $BUILD_TOOLS :$PATH "
39
+ # Propagate ccache to gn.
40
+ case " $CXX " in
41
+ * ccache* ) CC_WRAPPER=" cc_wrapper=\" ccache\" " ;;
42
+ esac
32
43
33
44
g++ --version
34
45
gcc --version
35
46
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"
47
+ 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 "
37
48
ninja -v -C " out.gn/$BUILD_ARCH_TYPE " d8 cctest inspector-test
38
49
else
39
50
DEPOT_TOOLS_DIR=" $( cd _depot_tools && pwd) "
0 commit comments