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.

Change-Id: Iba08a5ec56c474d291991fb751a0de764719bd85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ce9799e4c40f679cbb65aa7d006705e36ce7de97)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Yuhang Zhao 2022-07-17 15:15:22 +08:00 committed by Qt Cherry-pick Bot
parent 5f56cff243
commit ec27dba7ff

View File

@ -285,11 +285,8 @@ endif()
if(QT_FEATURE_intelcet) if(QT_FEATURE_intelcet)
if(MSVC) if(MSVC)
target_compile_options(PlatformCommonInternal INTERFACE
-guard:ehcont
)
target_link_options(PlatformCommonInternal INTERFACE target_link_options(PlatformCommonInternal INTERFACE
-guard:ehcont -CETCOMPAT -CETCOMPAT
) )
else() else()
target_compile_options(PlatformCommonInternal INTERFACE target_compile_options(PlatformCommonInternal INTERFACE