Skip to content

Commit

Permalink
Specify /CETCOMPAT in Bazel Windows build (#1164)
Browse files Browse the repository at this point in the history
Win32 x64/x86 executables built with GYP are already declared to be
Intel CET compatible (#835).

With this commit those executables built with Bazel also become Intel
CET compatible.

Closes #1111 

PiperOrigin-RevId: 718229248
  • Loading branch information
yukawa authored Jan 22, 2025
1 parent 9a1449b commit 83fd307
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ def mozc_win32_cc_prod_binary(
"/DEBUG:FULL",
"/PDBALTPATH:%_PDB%",
])

# '/CETCOMPAT' is available only on x86/x64 architectures.
if cpu in ["@platforms//cpu:x86_32", "@platforms//cpu:x86_64"]:
modified_linkopts.append("/CETCOMPAT")

mozc_cc_binary(
name = intermediate_name,
srcs = srcs,
Expand Down

0 comments on commit 83fd307

Please sign in to comment.