Closed llvmbot closed 10 years ago
I know nothing about building Windows drivers, but probably we should add support to clang-cl for the flag equivalent to -mrtd.
clang performs correct here. The switch to stdcall calling convention is performed via the command line.
After further discussion on IRC. We realized that by specifying: clang-cl -Xclang -mrtd -c msvc-preprocessor.c
The output does properly link. This specifies the default calling convention as stdcall instead of cdecl.
Extended Description
Clang is emitting incorrect name manglings which result in failed linking.
For example: clang emits impKeInitializeEvent, while cl emits impKeInitializeEvent@12
Similar issues exist for KeWaitForSingleObject IoDetachDevice IoDeleteDevice PoStartNextPowerIrp PoCallDriver IoCreateDevice IoAttachDeviceToDeviceStack KeSetEvent
Attached is the source code, as preprocessed by cl.exe