From 7eb345bd9c4e306b4ae3bc6203296be6de117409 Mon Sep 17 00:00:00 2001 From: Brad Spencer Date: Fri, 8 May 2026 13:07:15 -0300 Subject: [PATCH] Use `/Brepro` with MSVC linking, too The `/Brepro` (undocumented) argument to MSVC applies to both the compiler and the linker. The recent commit 94bda81 in #408 fixed determinism with MSVC by passing the argument to the compiler, but not the linker. Since the flag is undocumented, it is not clear whether it makes a difference when linking MSVC-compiled objects that were themselves compiled with `/Brepro`, but passing it to the linker, too, helps ensure that it is applies in all cases, such as cases were the linker is used on objects built from other languages. This change adds `all_link_actions` to the list of actions that get the argument. See https://github.com/llvm/llvm-project/issues/37777 for some of the scant documentation that`lld-link` (and thus real `link.exe`) accepts this option. --- cc/private/toolchain/windows_cc_toolchain_config.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/private/toolchain/windows_cc_toolchain_config.bzl b/cc/private/toolchain/windows_cc_toolchain_config.bzl index 295f48146..f3d46d4e8 100644 --- a/cc/private/toolchain/windows_cc_toolchain_config.bzl +++ b/cc/private/toolchain/windows_cc_toolchain_config.bzl @@ -389,7 +389,7 @@ def _impl(ctx): enabled = True, flag_sets = [ flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + actions = all_link_actions + [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], flag_groups = [ flag_group( flags = [