mstorsjo / llvm-mingw

An LLVM/Clang/LLD based mingw-w64 toolchain
Other
1.98k stars 188 forks source link

Cannot link executable #420

Closed philmb3487 closed 7 months ago

philmb3487 commented 7 months ago

Thanks for this project. Whenever I try to link something using CMake, I get the following kind of output:

[ 98%] Building CXX object src/NAME.cpp.obj
[ 98%] Linking CXX executable NAME.exe
ld.lld: error: unknown file type: s_round.o
ld.lld: error: unknown file type: s_sin.o
ld.lld: error: unknown file type: s_ceilf.o
ld.lld: error: unknown file type: s_floor.o
ld.lld: error: unknown file type: w_atan2.o
ld.lld: error: unknown file type: w_pow.o
ld.lld: error: unknown file type: e_hypot.o
ld.lld: error: unknown file type: w_sqrt.o
ld.lld: error: unknown file type: s_tanf.o
ld.lld: error: unknown file type: s_atan.o
ld.lld: error: unknown file type: s_nanf.o
ld.lld: error: unknown file type: s_ceil.o
ld.lld: error: unknown file type: s_atanf.o
ld.lld: error: unknown file type: s_sinf.o
ld.lld: error: unknown file type: s_cosf.o
ld.lld: error: unknown file type: w_log2.o
ld.lld: error: unknown file type: w_acosf.o
ld.lld: error: unknown file type: w_sqrtf.o
ld.lld: error: unknown file type: s_tan.o
ld.lld: error: unknown file type: s_floorf.o

Any idea what is going on? I've looked on the disk for s_tan and similar but it is nowhere to be found, and -lm does not change anything.

longnguyen2004 commented 7 months ago

Can you provide the project?

mstorsjo commented 7 months ago

This looks like the same issue as https://github.com/mstorsjo/msvc-wine/issues/122, where your supposed cross build ends up trying to include files from the host linux installation.