[pcre2] Fix -mshstk needed with -fcf-protection (#12347)

- Fixes the following error:
  src/sljit/sljitConfigInternal.h:219:2: error:
  #error "-mshstk is needed to compile with -fcf-protection"
- Upstream bug report:
  https://bugs.exim.org/show_bug.cgi?id=2578
- Add patch based on upstream commit:
  https://vcs.pcre.org/pcre2?view=revision&revision=1256
- Fixes #12343
This commit is contained in:
Wolfgang Stöggl 2020-07-13 22:00:43 +02:00 committed by GitHub
parent dcf6e5fe06
commit a3eee82a38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 0 deletions

View File

@ -1,4 +1,5 @@
Source: pcre2
Version: 10.35
Port-Version: 1
Homepage: https://pcre.org/
Description: PCRE2 is a re-working of the original Perl Compatible Regular Expressions library

View File

@ -0,0 +1,26 @@
--- a/CMakeLists.txt 2020-05-09 16:43:10.000000000 +0200
+++ b/CMakeLists.txt 2020-07-09 19:33:12.725648600 +0200
@@ -146,6 +146,23 @@
)
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
+# Check whether Intel CET is enabled, and if so, adjust compiler flags. This
+# code was written by PH, trying to imitate the logic from the autotools
+# configuration.
+
+CHECK_C_SOURCE_COMPILES(
+ "#ifndef __CET__
+ #error CET is not enabled
+ #endif
+ int main() { return 0; }"
+ INTEL_CET_ENABLED
+)
+
+IF (INTEL_CET_ENABLED)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mshstk")
+ENDIF(INTEL_CET_ENABLED)
+
+
# User-configurable options
#
# Note: CMakeSetup displays these in alphabetical order, regardless of

View File

@ -4,6 +4,7 @@ set(PATCHES
pcre2-10.35_fix-space.patch # Upstream: https://bugs.exim.org/show_bug.cgi?id=2588
pcre2-10.35_fix-uwp.patch
pcre2-10.35_fix_postfix_for_debug_Windows_builds.patch # Upstream: https://bugs.exim.org/show_bug.cgi?id=2600
pcre2-10.35_add_check_for_Intel_CET.patch # Upstream: https://bugs.exim.org/show_bug.cgi?id=2578
)
vcpkg_download_distfile(ARCHIVE