Bug 95605 - LTO and object files generated by dtrace -G
Summary: LTO and object files generated by dtrace -G
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-09 12:10 UTC by Matthias Klose
Modified: 2020-06-09 12:49 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-06-09 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2020-06-09 12:10:46 UTC
An object file generated with dtrace -G doesn't have a .gnu.lto_.opts section. Afaiu the lto linking is supposed to merge all flags used for all compile steps into the link step, if the flag was used for all .o files.  That results in a binary built without any options, if these are not present in the link step.
Comment 1 Martin Liška 2020-06-09 12:16:59 UTC
dtrace is new for me, can you please explain more how it works and what's expected output?
Comment 2 Richard Biener 2020-06-09 12:43:07 UTC
non-LTO objects are not taken into account here so I belive this isn't the reason you are not seeing the CF protection enabled.
Comment 3 Matthias Klose 2020-06-09 12:49:46 UTC
dtrace -G calls gcc to generate the .o file, and you can use the CC and CFLAGS environment vars to inject the options you need.  Ugly, but you can avoid that by passing the appropriate options.