From 2a4f01d2fc828bfb7a80926586c22d8b004aa1e9 Mon Sep 17 00:00:00 2001 From: Lalit Maganti Date: Mon, 13 Nov 2023 18:17:07 +0000 Subject: [PATCH] gn: fix failing security checks in binskip Many thanks to ivberg@ for the inspiration (see linked issue)! Fixes: https://github.com/google/perfetto/issues/635 Change-Id: Ib333fc79b2493019743cc026f43e384390fdbc30 --- gn/standalone/toolchain/BUILD.gn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gn/standalone/toolchain/BUILD.gn b/gn/standalone/toolchain/BUILD.gn index 236389c60c..71f2966892 100644 --- a/gn/standalone/toolchain/BUILD.gn +++ b/gn/standalone/toolchain/BUILD.gn @@ -420,7 +420,7 @@ toolchain("msvc") { tool("cc") { precompiled_header_type = "msvc" pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb" - command = "$cc_wrapper $cc /nologo /showIncludes /FC {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" + command = "$cc_wrapper $cc /nologo /showIncludes /FC {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\" /guard:cf /ZH:SHA_256" depsformat = "msvc" outputs = [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj" ] @@ -430,7 +430,7 @@ toolchain("msvc") { tool("cxx") { precompiled_header_type = "msvc" pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb" - command = "$cc_wrapper $cxx /nologo /showIncludes /FC {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" + command = "$cc_wrapper $cxx /nologo /showIncludes /FC {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\" /guard:cf /ZH:SHA_256" depsformat = "msvc" outputs = [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj" ] @@ -490,7 +490,7 @@ toolchain("msvc") { pdbname = "$exename.pdb" rspfile = "$exename.rsp" - command = "$linker /nologo /OUT:$exename ${sys_lib_flags} /DEBUG /PDB:$pdbname @$rspfile" + command = "$linker /nologo /guard:cf /DYNAMICBASE /OUT:$exename ${sys_lib_flags} /DEBUG /PDB:$pdbname @$rspfile" default_output_extension = ".exe" default_output_dir = "{{root_out_dir}}" outputs = [ exename ]