tpoechtrager / wclang

Cross compile source code easily for Windows with clang on Linux/Unix
GNU General Public License v2.0
302 stars 34 forks source link

Wrong ABI for class methods that return structs #36

Open pisto opened 7 years ago

pisto commented 7 years ago

I described the bug in the GCC tracker (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81943), here I'll describe what applies to wclang.

wclang (x86_64-w64-mingw32-clang++) uses the wrong ABI, while clang-cl uses the correct one. I believe I pinpointed the difference in arguments to the clang driver to the -triplet argument, that in the case of clang-cl is x86_64-pc-windows-msvc18.0.0. If I force that on wclang (-Xclang -triple -Xclang x86_64-pc-windows-msvc18.0.0), I get the right ABI and the test program compiles. However, I am not sure on the interactions with the mingw-built libstdc++ and such. In any case, wclang as it is now wrongly follows mingw.