brechtsanders / winlibs_mingw

winlibs standalone build of GCC compiler and MinGW-w64
946 stars 44 forks source link

Errors using -flto with clang #173

Open MagicalDrizzle opened 12 months ago

MagicalDrizzle commented 12 months ago

It seems this toolchain has the same problem with -flto as this one in the llvm-mingw repo: https://github.com/mstorsjo/llvm-mingw/issues/12 clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker The problem is the exact same and the solutions offered works for me, so I believe your problem is the same as in that link.

brechtsanders commented 12 months ago

The ticket you refer to is 5 years old. Which winlibs release were you using?

MagicalDrizzle commented 12 months ago
F:\build\mingw64\bin>clang "F:\build\home\clolcat.c" -flto
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker

F:\build\mingw64\bin>clang "F:\build\home\clolcat.c" -flto -fuse-ld=lld

F:\build\mingw64\bin>cat ..\version_info.txt
winlibs personal build version gcc-13.2.0-llvm-16.0.6-mingw-w64msvcrt-11.0.1-r1

This is the winlibs Intel/AMD 64-bit standalone build of:
- GCC 13.2.0
- GDB 13.2
- LLVM/Clang/LLD/LLDB 16.0.6
- MinGW-w64 11.0.1 (linked with msvcrt)
- GNU Binutils 2.41
- GNU Make 4.4.1
- PExports 0.47
- dos2unix 7.5.0
- Yasm 1.3.0
- NASM 2.16.01
- JWasm 2.12pre
- ccache version 4.8.2
- CMake 3.27.1
- ninja 1.11.1.git.kitware.jobserver-1
- Doxygen 1.9.7

Thread model: posix
Runtime library: MSVCRT

This build was compiled with GCC 13.2.0 and packaged on 2023-08-09.

Please check out http://winlibs.com/ for the latest personal build.