Skip to content

Commit f72cc1f

Browse files
committed
tools: filter V8 scripts for build toolchain
Patch the build scripts for V8 when running the V8 CI for Linux on ppc64le and s390x to workaround inconsistencies between the nightly build toolchain used by V8 and the released versions that we use from the Linux distribution. Signed-off-by: Richard Lau <[email protected]>
1 parent 9c01018 commit f72cc1f

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tools/make-v8.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then
3535
GN_COMPILER_OPTS="is_clang=true clang_base_path=\"/usr\" clang_use_chrome_plugins=false treat_warnings_as_errors=false use_custom_libcxx=false clang_version=\"${CLANG_VERSION}\""
3636
GN_RUST_ARGS="rustc_version=\"${RUST_VERSION}\" rust_sysroot_absolute=\"/usr\" rust_bindgen_root=\"/usr\""
3737
export RUSTC_BOOTSTRAP=1
38+
39+
# Filter out options supported in clang >= 20 when using clang 19.
40+
if [ "${CLANG_VERSION}" -eq "19" ]; then
41+
find build/ \( -name "*.gn" -o -name "*.gni" \) -exec sed -i \
42+
-e '/-Wno-nontrivial-memcall/d' {} \;
43+
fi
44+
# Filter out compiler options not supported by non-nightly clang builds
45+
if [ "${CLANG_VERSION}" -ge "19" ]; then
46+
find build/ \( -name "*.gn" -o -name "*.gni" \) -exec sed -i \
47+
-e '/-Wno-unsafe-buffer-usage-in-static-sized-array/d' \
48+
-e '/-Wno-uninitialized-const-pointer/d' \
49+
-e '/-Wno-unused-but-set-global/d' \
50+
-e '/-fno-lifetime-dse/d' \
51+
-e '/-fsanitize-ignore-for-ubsan-feature/d' \
52+
-e '/-fdiagnostics-show-inlining-chain/d' {} \;
53+
fi
54+
# Patch to match libadler/libadler2 based on what is present.
55+
LIBADLER=$(basename "$(find "$(rustc --print sysroot)/lib/rustlib/" -type f -name "libadler*")" | cut -d '-' -f 1)
56+
case "$LIBADLER" in
57+
libadler2) sed -i -e 's/"adler"/"adler2"/g' build/rust/std/BUILD.gn
58+
;;
59+
libadler) sed -i -e 's/"adler2"/"adler"/g' build/rust/std/BUILD.gn
60+
;;
61+
esac
3862
;;
3963
*) GN_COMPILER_OPTS="treat_warnings_as_errors=false use_custom_libcxx=false" ;;
4064
esac

0 commit comments

Comments
 (0)