Commit Graph

2 Commits

Author SHA1 Message Date
orbea 680af6d420 cmake: Silence cmake policy warning CMP0058.
See: cmake --help-policy CMP0058
2019-10-05 18:33:44 -07:00
Rafael Kitover 7f1fec88af work around gcc lto wrappers bug with gcc 7.x
gcc lto wrapper commands such as `gcc-ar` will segfault with some
versions of gcc 7.x when called via an absolute path, see:

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

Generalize the mechanism for compiling a small C program on the host
(currently used for bin2c for Wx resources) and use it to wrap the gcc
wrappers in a little executable that prepends their dirname to PATH and
runs them with `execvp()`.

Make LTO default to ON again, except on win32 with gcc < 7, because
those toolchains produce broken binaries with LTO enabled.

Also add `-ffat-lto-objects` to compiler flags for gcc when LTO is
enabled, this will increase the chances that the LTO build will succeed
even if there are issues with the binutils wrappers. Clang does not
support this.
2017-09-16 19:47:39 -07:00