tpoechtrager / wclang

Cross compile source code easily for Windows with clang on Linux/Unix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong ABI for class methods that return structs

pisto opened this issue · comments

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.