mstorsjo / llvm-mingw

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

-fprofile-instr-generate -fcoverage-mapping fails with mising libclang_rt.profile-x86_64.a #446

Closed ilg-ul closed 2 months ago

ilg-ul commented 3 months ago

I got a bug report for xPack clang when running on Windows (https://github.com/xpack-dev-tools/clang-xpack/issues/9), but since my project basically uses the same configuration as yours, I also tested with your latest build, and the problem seems present too:

C:\Users\ilg\tmp>C:\Users\ilg\OneDrive\Desktop\llvm-mingw-20240619-ucrt-x86_64\llvm-mingw-20240619-ucrt-x86_64\bin\aarch64-w64-mingw32-clang.exe m.c -fprofile-instr-generate -fcoverage-mapping
ld.lld: error: could not open 'C:/Users/ilg/OneDrive/Desktop/llvm-mingw-20240619-ucrt-x86_64/llvm-mingw-20240619-ucrt-x86_64/lib/clang/18/lib/windows/libclang_rt.profile-aarch64.a': No such file or directory
clang-18: error: linker command failed with exit code 1 (use -v to see invocation)
mstorsjo commented 3 months ago

The subject is incorrect - the real error is about libclang_rt.profile missing for aarch64, while the subject claims it's missing for x86_64.

mstorsjo commented 3 months ago

See the topmost two commits at https://github.com/mstorsjo/llvm-mingw/commits/profile-arm, that should provide more runtimes on aarch64.

ilg-ul commented 3 months ago

Oops! Wrong copy/paste. The original report was about x86_64. I tested again with your clang.exe and it passed.

I'll investigate what is wrong in my build.

Sorry for the noise.

mstorsjo commented 2 months ago

FWIW, the same commands should pass for aarch64 now as well, since the last release, as we include the profile and ubsan libraries for aarch64 now.