# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/chromium/hotfix-v8-metagen.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- --- chromium-157.0.8103.38/v8/BUILD.gn.vanilla +++ chromium-157.0.8103.38/v8/BUILD.gn @@ -2512,6 +2512,9 @@ if (v8_use_metagen) { # The clang toolchain's resource dir contains builting headers # include/{stddef.h,stdarg.h,...}. _metagen_clang_resource_dir = "$clang_base_path/lib/clang/$clang_version" + if (t2_clang_resource_dir != "") { + _metagen_clang_resource_dir = t2_clang_resource_dir + } # The headers are parsed with v8_base_without_compiler's flags. _metagen_flags_target = ":v8_base_without_compiler" @@ -2640,7 +2643,7 @@ if (v8_use_metagen) { "--libclang-so", v8_metagen_libclang_so, "--libclang-bindings-dir", - v8_metagen_libclang_bindings_dir, + rebase_path(v8_metagen_libclang_bindings_dir, root_build_dir), # The toolchain major, so metagen can warn if the loaded libclang is # out of step with clang. @@ -2654,6 +2657,13 @@ if (v8_use_metagen) { ] } + if (current_toolchain == default_toolchain && t2_bindgen_sysroot != "") { + args += [ + "--extra-flag=--sysroot=" + t2_bindgen_sysroot, + "--extra-flag=--target=" + t2_rust_abi_target, + ] + } + if (is_win) { # The SDK/UCRT include dirs never show up in `gn desc`: the toolchain # interpolates them into its tool command template instead of into