about summary refs log tree commit diff
path: root/src/doc/reference.md
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-07-30 14:20:36 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-08-10 18:20:00 -0700
commit18607149fbb0836059a96981c78e10ca52d23cd5 (patch)
tree201b0a143fb6c4cac89383f49fe9fe50bcde1fa7 /src/doc/reference.md
parent5aca49c693c9be3064d9e6db9473b1fa76834b79 (diff)
downloadrust-18607149fbb0836059a96981c78e10ca52d23cd5.tar.gz
rust-18607149fbb0836059a96981c78e10ca52d23cd5.zip
syntax: Add a new unstable #[linked_from] attribute
To correctly reexport statically included libraries from a DLL on Windows, the
compiler will soon need to have knowledge about what symbols are statically
included and which are not. To solve this problem a new unstable
`#[linked_from]` attribute is being added and recognized on `extern` blocks to
indicate which native library the symbols are coming from.

The compiler then keeps track of what the set of FFI symbols are that are
included statically. This information will be used in a future commit to
configure how we invoke the linker on Windows.
Diffstat (limited to 'src/doc/reference.md')
-rw-r--r--src/doc/reference.md10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md
index e905ed917d7..4d5564d9faf 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -1924,10 +1924,16 @@ On an `extern` block, the following attributes are interpreted:
   name and type. This is feature gated and the exact behavior is
   implementation-defined (due to variety of linker invocation syntax).
 - `link` - indicate that a native library should be linked to for the
-  declarations in this block to be linked correctly. `link` supports an optional `kind`
-  key with three possible values: `dylib`, `static`, and `framework`. See [external blocks](#external-blocks) for more about external blocks. Two
+  declarations in this block to be linked correctly. `link` supports an optional
+  `kind` key with three possible values: `dylib`, `static`, and `framework`. See
+  [external blocks](#external-blocks) for more about external blocks. Two
   examples: `#[link(name = "readline")]` and
   `#[link(name = "CoreFoundation", kind = "framework")]`.
+- `linked_from` - indicates what native library this block of FFI items is
+  coming from. This attribute is of the form `#[linked_from = "foo"]` where
+  `foo` is the name of a library in either `#[link]` or a `-l` flag. This
+  attribute is currently required to export symbols from a Rust dynamic library
+  on Windows, and it is feature gated behind the `linked_from` feature.
 
 On declarations inside an `extern` block, the following attributes are
 interpreted: