validate #[link_name = "..."] & #[link(name = "...")] parameters#155817
validate #[link_name = "..."] & #[link(name = "...")] parameters#155817folkertdev wants to merge 1 commit intorust-lang:mainfrom
#[link_name = "..."] & #[link(name = "...")] parameters#155817Conversation
|
Some changes occurred in compiler/rustc_attr_parsing |
#[link_name = "..."] parameter#[link_name = "..."] & #[link(name = "...")] parameters
This comment has been minimized.
This comment has been minimized.
b94ed3f to
2ffa233
Compare
| #[link_name = "@GLIBC_2.2.5"] | ||
| pub safe fn exit_1(status: i32) -> !; //~ ERROR link name must be well-formed if link kind is `raw-dylib` |
There was a problem hiding this comment.
2ffa233 to
4338dfc
Compare
This comment has been minimized.
This comment has been minimized.
4338dfc to
5a5ae4c
Compare
This comment has been minimized.
This comment has been minimized.
specifically, do not allow NULL bytes and the empty string
5a5ae4c to
c08b9ab
Compare
|
Thanks @folkertdev for cleaning these up. @rfcbot fcp merge lang |
|
Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
@rfcbot reviewed |
fixes #155776
fixes #155484
specifically, do not allow NULL bytes and the empty string in
#[link_name = "..."]and#[link(name = "...")].Like some of the others I think this formally needs to be looked at by T-lang because these errors would not show up if not linking.
The LLVM erorr on
#[linke_name = "\0"]is emitted here, it is not e.g. target-specific.https://github.com/llvm/llvm-project/blob/d593279c0b2891f0b0c8af3f70a1a0383b4ad1b5/llvm/lib/IR/Value.cpp#L336-L342
On
#[link(name = "")]we already error today. A NULL byte in#[link(name = "\0")]is caught by the linker (https://godbolt.org/z/vnz9sYbPs), using#[link_name = ""]makes LLVM generate a name (https://godbolt.org/z/1hWEo4cxf) which is not useful and likely to cause linker errors.r? jdonszelmann