From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 62419383E811; Tue, 9 Jun 2020 12:04:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62419383E811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591704284; bh=Wo+UhhdoG3rjWgi5oTfpdmMYMI9jhPhrARdCsKQ4uLY=; h=From:To:Subject:Date:From; b=KHtMY67zjHG0PbyIDSp7fpQ1twkWgcIpajkDh9DO3OSlbYNrsGH1VB9mdglTK7+MQ iKcEsse8L2hlhtU6vyrthoBBT2VQlI8IyskSuwf4i86NJfZtKxFeZ1jHjBEcq5DMY5 hYtNgxZUH7QTXn7ebS2dKnTycal8lkxAaUMQsz8o= From: "doko at debian dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/95604] New: LTO doesn't pick up -fcf-protection flag for the link step Date: Tue, 09 Jun 2020 12:04:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: doko at debian dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 12:04:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95604 Bug ID: 95604 Summary: LTO doesn't pick up -fcf-protection flag for the link step Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: doko at debian dot org CC: marxin at gcc dot gnu.org Target Milestone: --- Building the example from PR93966 with the -fcf-protection flag in the comp= ile step, but not in the link step, I get the error triggered by the -z option. $ cat x.c=20 #include int main () { printf ("hello\n"); return 0; } $ gcc-10 -flto -fcf-protection -c x.c $ gcc-10 -flto x.o -Wl,-z,cet-report=3Derror /usr/bin/ld: /tmp/ccM08n28.ltrans0.ltrans.o: error: missing IBT and SHSTK properties collect2: error: ld returned 1 exit status Isn't the lto link step supposed to pick up the compilation options from the compile step? An objdump -w -s --section=3D.gnu.lto_.opts x.o shows that this option is recorded, however I don't see it printed out in t= he link step, even when calling gcc with -v. An unrelated question: why is the compile step from PR93966 not called with -fcf-protection?=