diff -u pcre2-10.35/debian/changelog pcre2-10.35/debian/changelog --- pcre2-10.35/debian/changelog +++ pcre2-10.35/debian/changelog @@ -1,8 +1,16 @@ -pcre2 (10.35-3+ubuntu16.04.1+deb.sury.org+2) xenial; urgency=medium +pcre2 (10.35-4+ubuntu16.04.1+deb.sury.org+1) xenial; urgency=medium * No-change backport to xenial - -- Ondřej Surý Fri, 03 Jul 2020 10:05:36 +0200 + -- Ondřej Surý Fri, 03 Jul 2020 10:21:08 +0200 + +pcre2 (10.35-4) unstable; urgency=medium + + * 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 + + -- Ondřej Surý Fri, 03 Jul 2020 10:17:08 +0200 pcre2 (10.35-3) unstable; urgency=medium reverted: --- pcre2-10.35/debian/patches/0001-Apply-H.J.-Lu-s-patch-to-pass-mshstk-to-the-compiler.patch +++ pcre2-10.35.orig/debian/patches/0001-Apply-H.J.-Lu-s-patch-to-pass-mshstk-to-the-compiler.patch @@ -1,569 +0,0 @@ -From: =?utf-8?b?T25kxZllaiBTdXLDvQ==?= -Date: Fri, 3 Jul 2020 09:44:30 +0200 -Subject: 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 - ---- - CMakeLists.txt | 19 ++++++ - ChangeLog | 9 +++ - Makefile.am | 3 + - configure | 196 +++++++++++++++++++++++++++++++++------------------------ - configure.ac | 15 +++++ - 5 files changed, 160 insertions(+), 82 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 86b8896..5e8a763 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -92,6 +92,7 @@ - # library versioning. - # 2020-04-25 Carlo added function check for mkostemp used in ProtExecAllocator - # 2020-04-28 PH added function check for memfd_create based on Carlo's patch -+# 2020-05-25 PH added a check for Intel CET - - PROJECT(PCRE2 C) - -@@ -146,6 +147,24 @@ CHECK_C_SOURCE_COMPILES( - ) - 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 -diff --git a/ChangeLog b/ChangeLog -index 310eb60..3cb3895 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,6 +1,15 @@ - Change Log for PCRE2 - -------------------- - -+Version 10.36-RC1 25-May-2020 -+----------------------------- -+ -+1. Add CET_CFLAGS so that when Intel CET is enabled, pass -mshstk to -+compiler. This fixes https://bugs.exim.org/show_bug.cgi?id=2578. Patch for -+Makefile.am and configure.ac by H.J. Lu. Equivalent patch for CMakeLists.txt -+invented by PH. -+ -+ - Version 10.35 09-May-2020 - --------------------------- - -diff --git a/Makefile.am b/Makefile.am -index bb888f2..6a771a5 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -391,6 +391,7 @@ nodist_libpcre2_8_la_SOURCES = \ - libpcre2_8_la_CFLAGS = \ - -DPCRE2_CODE_UNIT_WIDTH=8 \ - $(VISIBILITY_CFLAGS) \ -+ $(CET_CFLAGS) \ - $(AM_CFLAGS) - libpcre2_8_la_LIBADD = - endif # WITH_PCRE2_8 -@@ -404,6 +405,7 @@ nodist_libpcre2_16_la_SOURCES = \ - libpcre2_16_la_CFLAGS = \ - -DPCRE2_CODE_UNIT_WIDTH=16 \ - $(VISIBILITY_CFLAGS) \ -+ $(CET_CFLAGS) \ - $(AM_CFLAGS) - libpcre2_16_la_LIBADD = - endif # WITH_PCRE2_16 -@@ -417,6 +419,7 @@ nodist_libpcre2_32_la_SOURCES = \ - libpcre2_32_la_CFLAGS = \ - -DPCRE2_CODE_UNIT_WIDTH=32 \ - $(VISIBILITY_CFLAGS) \ -+ $(CET_CFLAGS) \ - $(AM_CFLAGS) - libpcre2_32_la_LIBADD = - endif # WITH_PCRE2_32 -diff --git a/configure b/configure -index 615f638..d412978 100755 ---- a/configure -+++ b/configure -@@ -633,6 +633,7 @@ ac_subst_vars='am__EXEEXT_FALSE - am__EXEEXT_TRUE - LTLIBOBJS - LIBOBJS -+CET_CFLAGS - WITH_GCOV_FALSE - WITH_GCOV_TRUE - GCOV_LIBS -@@ -781,6 +782,7 @@ infodir - docdir - oldincludedir - includedir -+runstatedir - localstatedir - sharedstatedir - sysconfdir -@@ -911,6 +913,7 @@ datadir='${datarootdir}' - sysconfdir='${prefix}/etc' - sharedstatedir='${prefix}/com' - localstatedir='${prefix}/var' -+runstatedir='${localstatedir}/run' - includedir='${prefix}/include' - oldincludedir='/usr/include' - docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -@@ -1163,6 +1166,15 @@ do - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - -+ -runstatedir | --runstatedir | --runstatedi | --runstated \ -+ | --runstate | --runstat | --runsta | --runst | --runs \ -+ | --run | --ru | --r) -+ ac_prev=runstatedir ;; -+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ -+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ -+ | --run=* | --ru=* | --r=*) -+ runstatedir=$ac_optarg ;; -+ - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ -@@ -1300,7 +1312,7 @@ fi - for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ -- libdir localedir mandir -+ libdir localedir mandir runstatedir - do - eval ac_val=\$$ac_var - # Remove trailing slashes. -@@ -1453,6 +1465,7 @@ Fine tuning of the installation directories: - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] -+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] -@@ -5250,8 +5263,8 @@ esac - - - --macro_version='2.4.6.42-b88ce-dirty' --macro_revision='2.4.6.42' -+macro_version='2.4.6' -+macro_revision='2.4.6' - - - -@@ -6347,7 +6360,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - --netbsd*) -+netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else -@@ -6706,29 +6719,13 @@ esac - fi - - : ${AR=ar} -+: ${AR_FLAGS=cru} - - - - - - --# Use ARFLAGS variable as AR's operation code to sync the variable naming with --# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have --# higher priority because thats what people were doing historically (setting --# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS --# variable obsoleted/removed. -- --test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} --lt_ar_flags=$AR_FLAGS -- -- -- -- -- -- --# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override --# by AR_FLAGS because that was never working and AR_FLAGS is about to die. -- - - - -@@ -7177,7 +7174,7 @@ for ac_symprfx in "" "_"; do - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. -- # Also find C++ and __fastcall symbols from MSVC++ or ICC, -+ # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ - " {last_section=section; section=\$ 3};"\ -@@ -7223,11 +7220,8 @@ _LT_EOF - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm -- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 -- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 -- ac_status=$? -- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -- test $ac_status = 0; } && test -s "$nlist"; then -+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 -+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" -@@ -8446,8 +8440,8 @@ int forced_loaded() { return 2;} - _LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 -- echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 -- $AR $AR_FLAGS libconftest.a conftest.o 2>&5 -+ echo "$AR cru libconftest.a conftest.o" >&5 -+ $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -@@ -8841,8 +8835,8 @@ esac - ofile=libtool - can_build_shared=yes - --# All known linkers require a '.a' archive for static linking (except MSVC and --# ICC, which need '.lib'). -+# All known linkers require a '.a' archive for static linking (except MSVC, -+# which needs '.lib'). - libext=a - - with_gnu_ld=$lt_cv_prog_gnu_ld -@@ -9769,20 +9763,23 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) -- # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time -+ # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using -- # Microsoft Visual C++ or Intel C++ Compiler. -+ # Microsoft Visual C++. - if test yes != "$GCC"; then - with_gnu_ld=no - fi - ;; - interix*) -- # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) -+ # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd* | bitrig*) - with_gnu_ld=no - ;; -+ linux* | k*bsd*-gnu | gnu*) -+ link_all_deplibs=no -+ ;; - esac - - ld_shlibs=yes -@@ -9941,7 +9938,6 @@ _LT_EOF - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes -- file_list_spec='@' - ;; - - interix[3-9]*) -@@ -10038,7 +10034,7 @@ _LT_EOF - fi - ;; - -- netbsd*) -+ netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= -@@ -10159,7 +10155,7 @@ _LT_EOF - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else -- export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' -+ export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - -@@ -10426,12 +10422,12 @@ fi - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using -- # Microsoft Visual C++ or Intel C++ Compiler. -+ # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in -- cl* | icl*) -- # Native MSVC or ICC -+ cl*) -+ # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes -@@ -10472,7 +10468,7 @@ fi - fi' - ;; - *) -- # Assume MSVC and ICC wrapper -+ # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. -@@ -10708,6 +10704,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test yes = "$lt_cv_irix_exported_symbol"; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' - fi -+ link_all_deplibs=no - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' -@@ -10729,7 +10726,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } - esac - ;; - -- netbsd*) -+ netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else -@@ -10796,7 +10793,6 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes -- file_list_spec='@' - ;; - - osf3*) -@@ -11504,8 +11500,8 @@ cygwin* | mingw* | pw32* | cegcc*) - dynamic_linker='Win32 ld.exe' - ;; - -- *,cl* | *,icl*) -- # Native MSVC or ICC -+ *,cl*) -+ # Native MSVC - libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' -@@ -11561,7 +11557,7 @@ cygwin* | mingw* | pw32* | cegcc*) - ;; - - *) -- # Assume MSVC and ICC wrapper -+ # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; -@@ -11845,6 +11841,18 @@ fi - dynamic_linker='GNU/Linux ld.so' - ;; - -+netbsdelf*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='NetBSD ld.elf_so' -+ ;; -+ - netbsd*) - version_type=sunos - need_lib_prefix=no -@@ -12740,41 +12748,30 @@ striplib= - old_striplib= - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 - $as_echo_n "checking whether stripping libraries is possible... " >&6; } --if test -z "$STRIP"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --else -- if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then -- old_striplib="$STRIP --strip-debug" -- striplib="$STRIP --strip-unneeded" -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then -+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" -+ test -z "$striplib" && striplib="$STRIP --strip-unneeded" -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 - $as_echo "yes" >&6; } -- else -- case $host_os in -- darwin*) -- # FIXME - insert some real tests, host_os isn't really good enough -+else -+# FIXME - insert some real tests, host_os isn't really good enough -+ case $host_os in -+ darwin*) -+ if test -n "$STRIP"; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 - $as_echo "yes" >&6; } -- ;; -- freebsd*) -- if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then -- old_striplib="$STRIP --strip-debug" -- striplib="$STRIP --strip-unneeded" -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; } -- else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- fi -- ;; -- *) -+ else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 - $as_echo "no" >&6; } -- ;; -- esac -- fi -+ fi -+ ;; -+ *) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ ;; -+ esac - fi - - -@@ -15493,6 +15490,46 @@ else - fi - - -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Intel CET is enabled" >&5 -+$as_echo_n "checking whether Intel CET is enabled... " >&6; } -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+#ifndef __CET__ -+# error CET is not enabled -+#endif -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ pcre2_cc_cv_intel_cet_enabled=yes -+else -+ pcre2_cc_cv_intel_cet_enabled=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pcre2_cc_cv_intel_cet_enabled" >&5 -+$as_echo "$pcre2_cc_cv_intel_cet_enabled" >&6; } -+if test "$pcre2_cc_cv_intel_cet_enabled" = yes; then -+ CET_CFLAGS="-mshstk" -+ -+fi -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ - # Produce these files, in addition to config.h. - ac_config_files="$ac_config_files Makefile libpcre2-8.pc libpcre2-16.pc libpcre2-32.pc libpcre2-posix.pc pcre2-config src/pcre2.h" - -@@ -16314,7 +16351,6 @@ file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' - want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' - sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' - AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' --lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' - AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' - archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' - STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -@@ -16444,6 +16480,7 @@ file_magic_glob \ - want_nocaseglob \ - sharedlib_from_linklib_cmd \ - AR \ -+AR_FLAGS \ - archiver_list_spec \ - STRIP \ - RANLIB \ -@@ -17245,9 +17282,7 @@ $as_echo X/"$am_mf" | - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - as_fn_error $? "Something went wrong bootstrapping makefile fragments -- for automatic dependency tracking. If GNU make was not used, consider -- re-running the configure script with MAKE=\"gmake\" (or whatever is -- necessary). You can also try re-running configure with the -+ for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). - See \`config.log' for more details" "$LINENO" 5; } -@@ -17420,11 +17455,8 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - # The archiver. - AR=$lt_AR - --# Flags to create an archive (by configure). --lt_ar_flags=$lt_ar_flags -- - # Flags to create an archive. --AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} -+AR_FLAGS=$lt_AR_FLAGS - - # How to feed a file listing to the archiver. - archiver_list_spec=$lt_archiver_list_spec -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 reverted: --- pcre2-10.35/debian/patches/series +++ pcre2-10.35.orig/debian/patches/series @@ -1 +0,0 @@ -0001-Apply-H.J.-Lu-s-patch-to-pass-mshstk-to-the-compiler.patch only in patch2: unchanged: --- pcre2-10.35.orig/CMakeLists.txt +++ pcre2-10.35/CMakeLists.txt @@ -92,6 +92,7 @@ # library versioning. # 2020-04-25 Carlo added function check for mkostemp used in ProtExecAllocator # 2020-04-28 PH added function check for memfd_create based on Carlo's patch +# 2020-05-25 PH added a check for Intel CET PROJECT(PCRE2 C) @@ -146,6 +147,24 @@ ) 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 only in patch2: unchanged: --- pcre2-10.35.orig/ChangeLog +++ pcre2-10.35/ChangeLog @@ -1,6 +1,15 @@ Change Log for PCRE2 -------------------- +Version 10.36-RC1 25-May-2020 +----------------------------- + +1. Add CET_CFLAGS so that when Intel CET is enabled, pass -mshstk to +compiler. This fixes https://bugs.exim.org/show_bug.cgi?id=2578. Patch for +Makefile.am and configure.ac by H.J. Lu. Equivalent patch for CMakeLists.txt +invented by PH. + + Version 10.35 09-May-2020 --------------------------- only in patch2: unchanged: --- pcre2-10.35.orig/Makefile.am +++ pcre2-10.35/Makefile.am @@ -391,6 +391,7 @@ libpcre2_8_la_CFLAGS = \ -DPCRE2_CODE_UNIT_WIDTH=8 \ $(VISIBILITY_CFLAGS) \ + $(CET_CFLAGS) \ $(AM_CFLAGS) libpcre2_8_la_LIBADD = endif # WITH_PCRE2_8 @@ -404,6 +405,7 @@ libpcre2_16_la_CFLAGS = \ -DPCRE2_CODE_UNIT_WIDTH=16 \ $(VISIBILITY_CFLAGS) \ + $(CET_CFLAGS) \ $(AM_CFLAGS) libpcre2_16_la_LIBADD = endif # WITH_PCRE2_16 @@ -417,6 +419,7 @@ libpcre2_32_la_CFLAGS = \ -DPCRE2_CODE_UNIT_WIDTH=32 \ $(VISIBILITY_CFLAGS) \ + $(CET_CFLAGS) \ $(AM_CFLAGS) libpcre2_32_la_LIBADD = endif # WITH_PCRE2_32 only in patch2: unchanged: --- pcre2-10.35.orig/configure.ac +++ pcre2-10.35/configure.ac @@ -1006,6 +1006,21 @@ 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