Skip to content

Commit e6c058e

Browse files
committed
Rename 'link-args' to 'advanced-linking', add intro
1 parent 247a0d1 commit e6c058e

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/doc/trpl/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
* [No stdlib](no-stdlib.md)
6464
* [Intrinsics](intrinsics.md)
6565
* [Lang items](lang-items.md)
66-
* [Link args](link-args.md)
66+
* [Advanced linking](advanced-linking.md)
6767
* [Benchmark Tests](benchmark-tests.md)
6868
* [Box Syntax and Patterns](box-syntax-and-patterns.md)
6969
* [Slice Patterns](slice-patterns.md)

src/doc/trpl/link-args.md renamed to src/doc/trpl/advanced-linking.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
% Link args
1+
% Advanced Linking
22

3-
There is one other way to tell rustc how to customize linking, and that is via
3+
The common cases of linking with Rust have been covered earlier in this book,
4+
but supporting the range of linking possibilities made available by other
5+
languages is important for Rust to achieve seamless interaction with native
6+
libraries.
7+
8+
# Link args
9+
10+
There is one other way to tell `rustc` how to customize linking, and that is via
411
the `link_args` attribute. This attribute is applied to `extern` blocks and
512
specifies raw flags which need to get passed to the linker when producing an
613
artifact. An example usage would be:
@@ -14,9 +21,9 @@ extern {}
1421
```
1522

1623
Note that this feature is currently hidden behind the `feature(link_args)` gate
17-
because this is not a sanctioned way of performing linking. Right now rustc
24+
because this is not a sanctioned way of performing linking. Right now `rustc`
1825
shells out to the system linker, so it makes sense to provide extra command line
19-
arguments, but this will not always be the case. In the future rustc may use
26+
arguments, but this will not always be the case. In the future `rustc` may use
2027
LLVM directly to link native libraries, in which case `link_args` will have no
2128
meaning.
2229

0 commit comments

Comments
 (0)