Skip to content

Commit d5beddb

Browse files
authored
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 <richard.lau@ibm.com> PR-URL: #63069 Refs: https://github.com/ibmruntimes/v8-build/blob/49b55c036da148bd18b546f19b731a0fe92b6a33/bin/v8.sh#L62-L71 Refs: nodejs/build#4265 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent c363bec commit d5beddb

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

tools/make-v8.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,32 @@ 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) || true
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+
*) echo "Warning: unable to detect libadler/libadler2 (found ${LIBADLER})"
62+
;;
63+
esac
3864
;;
3965
*) GN_COMPILER_OPTS="treat_warnings_as_errors=false use_custom_libcxx=false" ;;
4066
esac

0 commit comments

Comments
 (0)