From e277394eaf830d4067191a1e44b5cf8c0c1ea090 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 1 May 2026 16:48:58 +0000 Subject: [PATCH] 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 --- tools/make-v8.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/make-v8.sh b/tools/make-v8.sh index bf74606e1908a3..3b5b974651ad0a 100755 --- a/tools/make-v8.sh +++ b/tools/make-v8.sh @@ -35,6 +35,32 @@ if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then 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}\"" GN_RUST_ARGS="rustc_version=\"${RUST_VERSION}\" rust_sysroot_absolute=\"/usr\" rust_bindgen_root=\"/usr\"" export RUSTC_BOOTSTRAP=1 + + # Filter out options supported in clang >= 20 when using clang 19. + if [ "${CLANG_VERSION}" -eq "19" ]; then + find build/ \( -name "*.gn" -o -name "*.gni" \) -exec sed -i \ + -e '/-Wno-nontrivial-memcall/d' {} \; + fi + # Filter out compiler options not supported by non-nightly clang builds + if [ "${CLANG_VERSION}" -ge "19" ]; then + find build/ \( -name "*.gn" -o -name "*.gni" \) -exec sed -i \ + -e '/-Wno-unsafe-buffer-usage-in-static-sized-array/d' \ + -e '/-Wno-uninitialized-const-pointer/d' \ + -e '/-Wno-unused-but-set-global/d' \ + -e '/-fno-lifetime-dse/d' \ + -e '/-fsanitize-ignore-for-ubsan-feature/d' \ + -e '/-fdiagnostics-show-inlining-chain/d' {} \; + fi + # Patch to match libadler/libadler2 based on what is present. + LIBADLER=$(basename "$(find "$(rustc --print sysroot)/lib/rustlib/" -type f -name "libadler*")" | cut -d '-' -f 1) || true + case "$LIBADLER" in + libadler2) sed -i -e 's/"adler"/"adler2"/g' build/rust/std/BUILD.gn + ;; + libadler) sed -i -e 's/"adler2"/"adler"/g' build/rust/std/BUILD.gn + ;; + *) echo "Warning: unable to detect libadler/libadler2 (found ${LIBADLER})" + ;; + esac ;; *) GN_COMPILER_OPTS="treat_warnings_as_errors=false use_custom_libcxx=false" ;; esac