Open Orycterope opened 3 years ago
This seems like something that would need to be done in upstream libclang, unless I'm missing something, reading the discussion in https://github.com/Caphyon/clang-power-tools/issues/177 / https://reviews.llvm.org/D17981...
I'm trying to cross-compile from x64 ubuntu to i686-pc-windows-msvc using the include files from msvc-wine and bingen fails to parse the msvc inline asm blocks in
winnt.h
.The inline asm blocks in question use the
__asm
syntax specific to MSVC (official doc), allowed on 32bit only, which should be supported by llvm.The error I get is very easily reproducible with the following header file:
Trying to compile it with
cargo build --target i686-pc-windows-msvc
shows the following error:My knowledge of llvm and clang is very limited, but I found this llvm mailing thread from 2013 when this used to make the lib crash, and added the error that we see. It suggests calling
to initialize the MS target Assembly Parser so it can recognize
__asm
blocks, which presumably is always done by clang but not by libclang. It also mentions that this is not needed for gcc style inline asm because they are not handled by a target Assembly Parser.I don't really know how to go about this issue. Any advice ?