[Bug lto/96389] New: Compiling MinGW-w64 GCC with LTO results in error: symbol wrong type (4 vs 3)

brechtsanders at users dot sourceforge.net gcc-bugzilla@gcc.gnu.org
Thu Jul 30 09:09:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96389

            Bug ID: 96389
           Summary: Compiling MinGW-w64 GCC with LTO results in error:
                    symbol wrong type (4 vs 3)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: brechtsanders at users dot sourceforge.net
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 48959
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48959&action=edit
Build output

I would like to compile my MinGW-w64 build of GCC for Windows (targetting win32
and win64) with the (static) standard libraries containing LTO information.
I added these flag to the configure command:
  CXXFLAGS_FOR_TARGET="-flto -ffat-lto-objects"
but then I get errors like this when it tries to build libstdc++-v3:
  symbol wrong type (4 vs 3)
After looking on the internet I also tried with this as possible workaround:
  LDFLAGS="-fno-use-linker-plugin"
but I got the same errors.

I have attached the complete compiler output.

Are there still known issues with LTO on Windows?
Is it supported to have LTO information in libraries like libgcc_s.a and
libstdc++.a?
If so, what is the correct way to build them?


More information about the Gcc-bugs mailing list