How to enable Control Flow Guard compiler flag "/guard:cf"

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

How to enable Control Flow Guard compiler flag "/guard:cf"

Postby Kyraath » Mon Sep 28, 2020 10:13 am

Greetings,

How do I enable the Control Flow Guard flag "/guard:cf" when compiling CEF using the automate-git.py compiler steps described here?

I have been unable to find instructions on how to add or change the compiler flags being used in the CEF documentation, but have found the file cef_variables.cmake.in by exploring through the repository as the only file that mentions compiler flags, but modifying this file to add "/guard:cf" does not result in the option being enabled. I see that Clang does support the Control Flow Guard option, so there should be some way to enable it. Also, when I search these forums for "guard:cf", there are some console captures that mention the flag, but I cannot find a way to enable it.

Thank you for the help!
Kyraath
Newbie
 
Posts: 3
Joined: Mon Sep 28, 2020 9:46 am

Re: How to enable Control Flow Guard compiler flag "/guard:c

Postby magreenblatt » Mon Sep 28, 2020 12:25 pm

There appears to be a win_enable_cfg_guards GN argument for Windows. I do not know if it will compile/run successfully with CEF.
magreenblatt
Site Admin
 
Posts: 10556
Joined: Fri May 29, 2009 6:57 pm

Re: How to enable Control Flow Guard compiler flag "/guard:c

Postby Kyraath » Mon Sep 28, 2020 1:35 pm

Interesting... I don't have that file in my local branch, probably because I'm trying to build 84.0.4147.105 (which also doesn't have this file) to align with CefSharp's latest release.
Kyraath
Newbie
 
Posts: 3
Joined: Mon Sep 28, 2020 9:46 am

Re: How to enable Control Flow Guard compiler flag "/guard:c

Postby magreenblatt » Mon Sep 28, 2020 1:41 pm

Yes, it appears to only be available in M86 and newer.
magreenblatt
Site Admin
 
Posts: 10556
Joined: Fri May 29, 2009 6:57 pm

Re: How to enable Control Flow Guard compiler flag "/guard:c

Postby Kyraath » Mon Sep 28, 2020 2:02 pm

Ok, just to verify, because this file is not there in 84, the compiler flag is only available in 86 or newer?

Thank you very much for helping track this down!
Kyraath
Newbie
 
Posts: 3
Joined: Mon Sep 28, 2020 9:46 am

Re: How to enable Control Flow Guard compiler flag "/guard:c

Postby magreenblatt » Mon Sep 28, 2020 2:31 pm

Kyraath wrote:Ok, just to verify, because this file is not there in 84, the compiler flag is only available in 86 or newer?

Correct.
magreenblatt
Site Admin
 
Posts: 10556
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 21 guests