-
Notifications
You must be signed in to change notification settings - Fork 708
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
Avoid using \u{1} prefixes in symbol names where possible #2935
Comments
See also rust-lang/rustc_codegen_cranelift#1520 for an example where this causes linking to fail with cg_clif as the \u{1} prefix gets passed straight to the linker. |
hey Bjorn :) I'm all-in if we could replace this hacky solution for something less brittle. Is there something we could do before the |
Most of the time it should be possible to reverse the symbol mangling in rust-bindgen back to whatever would have been written in C before passing it to |
That's true for C, but not so easy for C++, right? |
Outside of Windows it is possible to unmangle C++ names into something that cam be written in C (except for ABI tags as those need a dot, but that works fine with |
This prefix disables name mangling in LLVM, but other codegen backends don't support this. We also don't guarantee that it will remain working. As discussed in https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202024-09-19/near/471499857 we may choose to add a
#[link_name("foo", verbatim)]
flag or similar to get the same effect and then deny all usage of\u{1}
over an edition boundary.The text was updated successfully, but these errors were encountered: