summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2020-05-25 16:03:24 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2020-05-25 16:03:24 +0000
commit4f0b3ea9771e49fb0d5e5c323e7966ceff2c7ec2 (patch)
tree430345aa9778691ab7c92ff2d66d1d500b22b68c /configure.ac
parent858e5ac388c3d623f2ab0c62a881b98a0ecd40a7 (diff)
downloadpcre2-4f0b3ea9771e49fb0d5e5c323e7966ceff2c7ec2.tar.gz
Apply H.J. Lu's patch to pass -mshstk to the compiler when Intel CET is
enabled. CMake version invented by PH, but only tested on non-CET system. git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1256 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 180d3dc..61b93ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1006,6 +1006,21 @@ fi # enable_coverage
AM_CONDITIONAL([WITH_GCOV],[test "x$enable_coverage" = "xyes"])
+AC_MSG_CHECKING([whether Intel CET is enabled])
+AC_LANG_PUSH([C])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,
+ [[#ifndef __CET__
+# error CET is not enabled
+#endif]])],
+ [pcre2_cc_cv_intel_cet_enabled=yes],
+ [pcre2_cc_cv_intel_cet_enabled=no])
+AC_MSG_RESULT([$pcre2_cc_cv_intel_cet_enabled])
+if test "$pcre2_cc_cv_intel_cet_enabled" = yes; then
+ CET_CFLAGS="-mshstk"
+ AC_SUBST([CET_CFLAGS])
+fi
+AC_LANG_POP([C])
+
# Produce these files, in addition to config.h.
AC_CONFIG_FILES(
Makefile