about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/rustc
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-08-06 22:17:32 -0500
committerGitHub <noreply@github.com>2024-08-06 22:17:32 -0500
commit10a7f93f12faab3b1bfa65688e3dcc6d1291fb0b (patch)
treea497e113101174b8e6218b1707f29d71311fc806 /compiler/rustc_pattern_analysis/src/rustc
parent0aaffdb25fa825ca32dca6e2e8d39abae26e0489 (diff)
parent19679510c756926c4fda1c1d2daec5bea96ca6f2 (diff)
downloadrust-10a7f93f12faab3b1bfa65688e3dcc6d1291fb0b.tar.gz
rust-10a7f93f12faab3b1bfa65688e3dcc6d1291fb0b.zip
Rollup merge of #128362 - folkertdev:naked-function-symbol-visibility, r=bjorn3
add test for symbol visibility of `#[naked]` functions

tracking issue: #90957

This test is extracted from https://github.com/rust-lang/rust/pull/128004

That PR attempts to generated naked functions as an extern function declaration, combined with a global asm block that provides the implementation for that declaration.

In order to link declaration and definition together, some flavor of external linking must be used: LLVM will error for other linkage types. Specifically the allowed options are `#[linkage = "external"]` and `#[linkage = "extern_weak"]`. That is kind of an implementation detail though: to the user, a naked function should just behave like a normal function.

Hence it should be visible to the linker under the same circumstances as a normal, vanilla function and have the same attributes (Weak, External). Getting this behavior right will require some care, so I think it's a good idea to lock it in now, before making any changes, to make sure we don't regress.

Are there any interesting cases that I missed here? E.g. is checking on different architectures worth it? I don't think the other binary types (rlib etc) are relevant here, but may be missing something.

r? ``@bjorn3``
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/rustc')
0 files changed, 0 insertions, 0 deletions