Bug 1113368

Summary: -flto with gcc 4.9 causes broken debuginfo packages
Product: [Fedora] Fedora Reporter: Mattias Ellert <mattias.ellert>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jakub, law
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-26 06:11:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1101935    

Description Mattias Ellert 2014-06-26 04:08:13 UTC
Description of problem:
Debuginfo packages are not containing sources when -flto is used with gcc 4.9

Version-Release number of selected component (if applicable):
gcc-4.9.0-12.fc21.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Compile the R-qtl package for Fedora 21

Actual results:
Debuginfo package without sources

Expected results:
Debuginfo package with sources

Additional info:
Compiling the package for Fedora 20 with gcc 4.8 works as expected - debuginfo package contains sources.

If I manually hack the /usr/lib64/R/etc/Makeconf file to change the compiler flags used by R module compilation from "LTO = -flto" to "LTO = -fno-lto" the debuginfo package contains sources as expected.

On Fedora 20 (gcc-4.8.2-7.fc20.x86_64) the compiled module contains references to the source files:

$ readelf -a qtl.so | grep FILE
    33: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    42: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS countXO.c
    43: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS discan.c
    44: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS discan_covar.c
    45: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS effectscan.c
    46: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS fill_geno_nodblXO.c

On Fedora 21 (gcc-4.9.0-12.fc21.x86_64) it does not:

$ readelf -a qtl.so | grep 'FILE'
    26: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    35: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS ccuxkewq.ltrans0.o
    36: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS ccuxkewq.ltrans1.o
    38: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS ccuxkewq.ltrans2.o
    39: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS ccuxkewq.ltrans3.o
    40: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS ccuxkewq.ltrans4.o

Comment 1 Jakub Jelinek 2014-06-26 06:11:33 UTC
If you want usable debug info, you can't use -flto, at least for the past few years and likely next few years too.