-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported calling convention on i686-pc-windows-msvc #541
Comments
OK I wanted to isolate the problem so I could try with #pragma once
class Test {
int m_int;
double m_double;
public:
static const char* name();
}; And it compiles with this. But as soon as you try to use
Which just looks like a mangling problem. |
I don't have a windows machine to test on, could you inspect the generated library to see which mangled names are being generated? |
The original issue here is that calling convention 4 is @emilio is it feasible to just modify |
@froydnj yeah, also, note that syntex_syntax is pretty much a clone of libsyntax in the rust compiler, so this should probably be upstreamed. Is this blocking you in any meaningful way? If there's any workaround we can do in bindgen, happy to help. Perhaps making it a soft error may help for now. |
Throwing a soft error here is hard, because we have to pass in /something/ for the calling convention. I guess we already have special cases for Obj-C method declarations, we could fake things up for C++ method declarations, and then cross fingers that nobody is actually bindgen'ing calls to C++ methods? That seems like a giant hack, though, with some definite footgun possibilities. We can work around this in Stylo by simply not building Stylo for win32 for the time being. |
ir: Don't panic when finding an unknown calling convention until code generation This unblocks stylo in windows until we get `__thiscall` support in syntex. see #541.
All that is required to repro is this: // bindgen-flags: -- --target=i686-pc-windows-msvc
class Foo {
public:
void test();
}; or with |
Add support for the thiscall ABI Fixes #541 The thiscall ABI is experimental, so in order to use it nightly is required and also the following statement: `#![feature(abi_thiscall)]` That's a problem because the `tests_expectations` crate (in the tests folder) tries to compile it (and stable is required).
I was investigating how easy it would be to create bindings for Windows 32-bit with different calling conventions and so I ran the example in the
./bindgen-integration
directory.System
Input C/C++ Header
Bindgen Invokation
Actual Results
Steps to reproduce
> git clone https://github.com/servo/rust-bindgen.git
> cd rust-bindgen\bindgen-integration
> rustup override set stable-i686-pc-windows-msvc
> cargo build
The text was updated successfully, but these errors were encountered: