You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on some opt transforms that require a monolithic ir file. Compiling the two simple .cpp files to .bc files and linking them with llvm-link causes the MSVC linker to fail with the error below. I do not have this issue if I use a compiled version of clang with MINGW, but for release I need the MSVC version.
Steps to reproduce:
clang.exe -emit-llvm -c one.cpp two.cpp llvm-link.exe one.bc two.bc -o combined.bc clang.exe combined.bc -o test3.exe combined-2b91e8.o : fatal error LNK1243: invalid or corrupt file: COMDAT section 0x17B associated with following section 0x17E clang.exe: error: linker command failed with exit code 1243 (use -v to see invocation)
Seems to have the same issue, but maybe I'm doing something wrong.. Here's what I did: clang-cl.exe -Xclang -emit-llvm -c one.cpp two.cpp
The above command created one.obj and two.obj, but they did seem to be bc files. llvm-link.exe one.obj two.obj -o combined.bc
I could not figure out how to directly compile bc files with clang-cl, so I did.. llc.exe -filetype=obj combined.bc -o combined.obj clang-cl.exe combined.obj -o test.exe
Received same COMDAT error as before.
Your command line looks okay. If you use clang-cl it will generate bc files. If you use /FA it will generate ll files but clang-cl will also error out because its not setup properly to do that.
I was able to reproduce your problem but I don't think this is a VS linker issue. This is most likely a problem in llvm-link. You'd probably get a better response on the LLVM developer mailing list since Microsoft doesn't develop clang-cl or llvm-link or llc.
I am working on some opt transforms that require a monolithic ir file. Compiling the two simple .cpp files to .bc files and linking them with llvm-link causes the MSVC linker to fail with the error below. I do not have this issue if I use a compiled version of clang with MINGW, but for release I need the MSVC version.
Steps to reproduce:
clang.exe -emit-llvm -c one.cpp two.cpp
llvm-link.exe one.bc two.bc -o combined.bc
clang.exe combined.bc -o test3.exe
combined-2b91e8.o : fatal error LNK1243: invalid or corrupt file: COMDAT section 0x17B associated with following section 0x17E clang.exe: error: linker command failed with exit code 1243 (use -v to see invocation)
Note that if I just clang.exe the two bc files out to an executable it works.
one.cpp.txt
two.cpp.txt
two.h.txt
The text was updated successfully, but these errors were encountered: