Menu

GCC-12 and link time optimization: -flto=NumberOfTasks not working

Help
2022-05-23
2022-06-13
  • Martin Cordova

    Martin Cordova - 2022-05-23

    Hi, I am use GCC-12 on Linux with -flto, if I don't use more than 1 task I receive this warning:

    lto-wrapper: warning: using serial compilation of 8 LTRANS jobs
    lto-wrapper: note: see the '-flto' option documentation for more information

    Using -flto=8 solves the problem (no more warning) and compiles faster, about 40% faster in my case.

    I receive the same warning on Windows with GCC-12 (installled via MSYS2), but adding -flto=8 triggers an error about MAKE not finding some files, I have to setup the MAKE environment variable pointing to make.exe, that way it does compile but no speed-up like in Linux.

    Is there some additional flag that I must add in order to make it work -flto concurrent on Windows?
    Also, make.exe is in the same directory as g++, I don't understand why it can't find it without the MAKE variable.

    Thank you,
    Martin

     
  • John Marriott

    John Marriott - 2022-06-13

    Hi Martin,

    I am on gcc-12 on Windows and get the same lto-wrapper warnings. Can you tell me exactly what you did to get rid of them? I tried setting the $MAKE variable but it made no difference.

    Also, I have found that my binaries are significantly larger after compilation by gcc 12 than under gcc 11.3 (eg one binary went from 300kb to 500kb). Have you found this as well?

    Thanks
    John

     

Log in to post a comment.