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.
cmake/HostCompile.cmake
0 → 100644
cmake/PathRun.cmake
0 → 100644
Please register or sign in to comment