link_arg_attribute - The Rust Unstable Book

## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# `link_arg_attribute`

The tracking issue for this feature is: #99427

The `link_arg_attribute` feature allows passing arguments into the linker from inside of the source code. Order is preserved for link attributes as they were defined on a single extern block:

    #![allow(unused)]
    #![feature(link_arg_attribute)]

    fn main() {
    #[link(kind = "link-arg", name = "--start-group")]
    #[link(kind = "static", name = "c")]
    #[link(kind = "static", name = "gcc")]
    #[link(kind = "link-arg", name = "--end-group")]
    extern "C" {}
    }