Are llvm-gcc and clang binary compatible with gcc? - particularly mingw gcc on Windows

后端 未结 5 774
旧时难觅i
旧时难觅i 2020-12-14 07:30

If I build a static library with llvm-gcc, then link it with a program compiled using mingw gcc, will the result work?

The same for other combinations of llvm-gcc, c

5条回答
  •  遥遥无期
    2020-12-14 08:02

    I don't know the answer, but slide 10 in this presentation seems to imply that the ".o" files produced by llvmgcc contain LLVM bytecode (.bc) instead of the usual target-specific object code, so that link-time optimization is possible. However, the LLVM linker should be able to link LLVM code with code produced by "normal" GCC, as the next slide says "link in native .o files and libraries here".

    LLVM is a Linux tool, I have sometimes found that Linux compilers don't work quite right on Windows. I would be curious whether you get it to work or not.

提交回复
热议问题