[CMake] INTERPROCEDURAL_OPTIMIZATION still not using CMAKE_<LANG>_COMPILER_AR

Hendrik Sattler post at hendrik-sattler.de
Tue Aug 1 23:15:11 EDT 2017



Am 1. August 2017 22:52:09 MESZ schrieb Brad King <brad.king at kitware.com>:
>On 07/22/2017 07:33 AM, lectem at gmail.com wrote:
>> So I downloaded the 3.9 release and thought my LTO nightmares we over
>but
>> cmake still isn't using CMAKE_<LANG>_COMPILER_AR when linking on
>MSYS.
>
>The problem is that this code:
>
>https://gitlab.kitware.com/cmake/cmake/blob/v3.9.0/Modules/Platform/Windows-GNU.cmake#L117-127
>
>inserts use of the archiver into the main linking process as a way
>to work around Windows command-line length limits.  Since it is
>using the archiver as part of linking instead of just for creating
>a static library, our logic to switch to CMAKE_<LANG>_COMPILER_AR
>for LTO is not triggering.

And the code to detect that gcc uses GNU ld is broken as it does not check if gcc was actually built using the right configure flags!
If it isn't configured for GNU ld, it does not forward the response file to the collect2 command and the command line length thing breaks it. This is independent of the actual ld binary.

HS


-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.


More information about the CMake mailing list