-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Closed
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-macosOperating system: macOSOperating system: macOST-langRelevant to the language teamRelevant to the language team
Description
I see symbols being mangled despite using #[no_mangle] or #[link_name = "foo"]. Specifically, the symbols are being prepended by _, i.e. foo gets mangled to _foo rather than being accessible as foo.
I tried this code:
#[no_mangle]
pub static mut foo: std::os::raw::c_int = 0;and
#[link_name = "foo"]
pub static mut foo: std::os::raw::c_int = 0;Meta
OS: OS X 10.10
rustc --version --verbose: I tried both
rustc 1.10.0 (cfcb716cf 2016-07-03) binary: rustc commit-hash: cfcb716cf0961a7e3a4eceac828d94805cf8140b commit-date: 2016-07-03 host: x86_64-apple-darwin release: 1.10.0
and
rustc 1.12.0-nightly (9316ae515 2016-07-24) binary: rustc commit-hash: 9316ae515e2f8f3f497fb4f1559910c1eef2433d commit-date: 2016-07-24 host: x86_64-apple-darwin release: 1.12.0-nightly
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-macosOperating system: macOSOperating system: macOST-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.