- Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
fn main() { println!("{}", unsafe { foo() }); } #[link_name = "foobar"] extern "C" { fn foo() -> u32; }This fails to link with undefined reference to `foo', but it didn't even try to find any foobar library.
With #[link(name = "foobar")], the error is the expected ld: cannot find -lfoobar.
There are a few places in libstd using #[link_name = "m"] extern {...}, so I wonder if those actually have any effect either.
retep998, hanna-kruppe and mati865
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.