Skip to content
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

Mangling hack doesn't work well with variable symbols #819

Closed
upsuper opened this issue Jul 18, 2017 · 2 comments · Fixed by #822
Closed

Mangling hack doesn't work well with variable symbols #819

upsuper opened this issue Jul 18, 2017 · 2 comments · Fixed by #822
Assignees

Comments

@upsuper
Copy link
Contributor

upsuper commented Jul 18, 2017

Input C/C++ Header

struct Pref {
  static bool sX;
};

Bindgen Invocation

$ bindgen test.hpp -- --target=i686-pc-win32

Actual Results

extern "C" {
    #[link_name = "sX@Pref@@2_NA"]
    pub static mut Pref_sX: bool;
}

Expected Results

extern "C" {
    #[link_name = "?sX@Pref@@2_NA"]
    pub static mut Pref_sX: bool;
}
@upsuper
Copy link
Contributor Author

upsuper commented Jul 18, 2017

The prefix ? shouldn't be removed in this case.

@upsuper upsuper self-assigned this Jul 18, 2017
@upsuper
Copy link
Contributor Author

upsuper commented Jul 18, 2017

I have idea about how to fix it.

bors-servo pushed a commit that referenced this issue Jul 18, 2017
Stop Rust from prepending underscore before '?' for win32

This fixes #819.

It also includes tests for different platforms which are not supposed to be affected, so that we won't regress them in the future either.

The prefix `\x01` char is necessary for Win32. See also [msvc32_symbolify function in regen_atoms.py](https://github.com/servo/servo/blob/1b6d29e31996c87218352b825aa93e01909a6a24/components/style/gecko/regen_atoms.py#L35-L38).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant