https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96203
--- Comment #19 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Matthias Klose <d...@gcc.gnu.org>: https://gcc.gnu.org/g:80ff137368412a1628cd56b76a860a76a08fd8ea commit r10-8743-g80ff137368412a1628cd56b76a860a76a08fd8ea Author: Matthias Klose <d...@ubuntu.com> Date: Fri Sep 11 12:21:25 2020 +0200 LTO: Add -fcf-protection=check Mixing -fcf-protection and -fcf-protection=none objects are allowed. Linker just merges -fcf-protection values from all input objects. Add -fcf-protection=check for the final link with LTO. An error is issued if LTO object files are compiled with different -fcf-protection values. Otherwise, -fcf-protection=check is ignored at the compile time. Without explicit -fcf-protection at link time, -fcf-protection values from LTO object files are merged at the final link. gcc/ PR bootstrap/96203 * common.opt: Add -fcf-protection=check. * flag-types.h (cf_protection_level): Add CF_CHECK. * lto-wrapper.c (merge_and_complain): Issue an error for mismatching -fcf-protection values with -fcf-protection=check. Otherwise, merge -fcf-protection values. * doc/invoke.texi: Document -fcf-protection=check. gcc/testsuite/ PR bootstrap/96203 * gcc.target/i386/pr96203-1.c: New test. * gcc.target/i386/pr96203-2.c: Likewise. (cherry picked from commit c4c22e830251e1961c6ebec78d28d039eb2e6017)