There needs to be a convenient way to specify that at link time the whole
program
is seen, or rather, that -fwhole-program -flto during compile-time doesn't have
-fwhole-program effects.

Building SPEC int 2000 with -flto -fwhole-program otherwise (obviously) results
in undefined symbols, like forOutput from make 'specmake -j2 build 2> make.err
| tee make.out':
/gcc/spec/sb-haydn-df-64/x86_64/install-200902142206/bin/gcc -c -o bzip2.o     
        -O3 -ffast-math -flto -fwhole-program  bzip2.c
/gcc/spec/sb-haydn-df-64/x86_64/install-200902142206/bin/gcc -c -o spec.o      
       -O3 -ffast-math -flto -fwhole-program  spec.c
/gcc/spec/sb-haydn-df-64/x86_64/install-200902142206/bin/gcc       -O3
-ffast-math -flto -fwhole-program  bzip2.o spec.o     -o bzip2
Error from make 'specmake -j2 build 2> make.err | tee make.out':
spec.o: In function `main':
spec.c:(.text+0x207): undefined reference to `smallMode'
spec.c:(.text+0x20e): undefined reference to `verbosity'
spec.c:(.text+0x218): undefined reference to `blockSize100k'
spec.c:(.text+0x222): undefined reference to `bsStream'
spec.c:(.text+0x22c): undefined reference to `workFactor'
spec.c:(.text+0x235): undefined reference to `allocateCompressStructures'
spec.c:(.text+0x252): undefined reference to `blockSize100k'
spec.c:(.text+0x257): undefined reference to `compressStream'
spec.c:(.text+0x2b3): undefined reference to `blockSize100k'
spec.c:(.text+0x2bc): undefined reference to `uncompressStream'
collect2: ld returned 1 exit status
specmake: *** [bzip2] Error 1
 bzip2:


-- 
           Summary: LTO and -fwhole-program do not play along well
           Product: gcc
           Version: lto
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39203

Reply via email to