Skip to content

Commit

Permalink
Disable -fcf-protection for mingw win32
Browse files Browse the repository at this point in the history
-fcf-protection does not appear to work properly for mingw in i686
and results in unstable executables being compiled. This disables
-fcf-protection for i686-w64-mingw32 hosts only.
  • Loading branch information
jamescowens committed Nov 7, 2021
1 parent ccac9c2 commit bf83cab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,15 @@ if test x$use_hardening != xno; then
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])

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

case $host in
*mingw*)
Expand Down

0 comments on commit bf83cab

Please sign in to comment.