From ce9799e4c40f679cbb65aa7d006705e36ce7de97 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Sun, 17 Jul 2022 15:15:22 +0800 Subject: [PATCH] MSVC: Fix the CET parameters To enable CET for MSVC, only passing "/CETCOMPAT" to the linker should be sufficient. Enabling generation of EH Continuation (EHCONT) metadata is additional protection and should not be necessary. It also requires all the dependencies to be re-compiled with EHCONT enabled, otherwise the linker will refuse to link the obj files. However, this is rather hard to achieve if your application depends on many 3rd-party libraries, so to let people enable CET more freely, we don't enable EHCONT guard by default. Pick-to: 6.4 Change-Id: Iba08a5ec56c474d291991fb751a0de764719bd85 Reviewed-by: Thiago Macieira --- cmake/QtInternalTargets.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 6cb23780445..86d4dcf9b6e 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -272,11 +272,8 @@ endif() if(QT_FEATURE_intelcet) if(MSVC) - target_compile_options(PlatformCommonInternal INTERFACE - -guard:ehcont - ) target_link_options(PlatformCommonInternal INTERFACE - -guard:ehcont -CETCOMPAT + -CETCOMPAT ) else() target_compile_options(PlatformCommonInternal INTERFACE