Skip to content

Commit f67ad68

Browse files
committed
Disable -fcf-protection for mingw win32
-fcf-protection does not appear to work properly for mingw in i686 and results in unstable executables being compiled. This disables -fct-protection for i686-w64-mingw32 hosts only.
1 parent ccac9c2 commit f67ad68

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

configure.ac

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,15 @@ if test x$use_hardening != xno; then
645645
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
646646
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
647647

648-
AX_CHECK_COMPILE_FLAG([-fcf-protection=full],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fcf-protection=full"])
648+
case $host in
649+
i686-w64-mingw32)
650+
dnl Control-Flow Enforcement Technology (CET) does not appear to work for mingw for i686 (32-bit)
651+
dnl When it is enabled, unstable executables result. Disable for now.
652+
;;
653+
*)
654+
AX_CHECK_COMPILE_FLAG([-fcf-protection=full],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fcf-protection=full"])
655+
;;
656+
esac
649657

650658
case $host in
651659
*mingw*)

0 commit comments

Comments
 (0)