- Feature Name: global_asm
- Start Date: 2016-03-18
- RFC PR: rust-lang/rfcs#1548
- Rust Issue: rust-lang/rust#35119
Summary
This RFC exposes LLVM's support for module-level inline assembly by addingglobal_asm!
macro. The syntax
Example:
Motivation
There are two main use cases for this feature. The first is that it allowsnaked
attribute. This is mainly useful for function that use a custom calling
Another important use case is that it allows
Assembly files can also be preprocessed or generatedbuild.rs
(for example using the C preprocessor), which will produce
Detailed design設計(する)
See description above, not much to add. The macro will map directlymodule asm
.
Drawbacks
Like asm!
, this feature depends on LLVM's integrated
Alternatives
The current way of including external assembly is to compile the assembly files using gcc in build.rs
and link them into the Rust program as a static
An alternative#[naked]
function attribute.
Unresolved questions
None