@@ -21,8 +21,7 @@ to `#[cfg(verbose)]` and `#[cfg(feature = "serde")]` respectively.
2121<a id =" option-l-search-path " ></a >
2222## ` -L ` : add a directory to the library search path
2323
24- When looking for external crates or libraries, a directory passed to this flag
25- will be searched.
24+ The ` -L ` flag adds a path to search for external crates and libraries.
2625
2726The kind of search path can optionally be specified with the form `-L
2827KIND=PATH` where ` KIND` may be one of:
@@ -262,15 +261,32 @@ This flag, when combined with other flags, makes them produce extra output.
262261<a id =" option-extern " ></a >
263262## ` --extern ` : specify where an external library is located
264263
265- This flag allows you to pass the name and location of an external crate that
266- will be linked into the crate you are building. This flag may be specified
267- multiple times. This flag takes an argument with either of the following
268- formats:
264+ This flag allows you to pass the name and location for an external crate of a
265+ direct dependency. Indirect dependencies (dependencies of dependencies) are
266+ located using the [ ` -L ` flag] ( #option-l-search-path ) . The given crate name is
267+ added to the [ extern prelude] , which is the same as specifying ` extern crate `
268+ within the root module. The given crate name does not need to match the name
269+ the library was built with.
270+
271+ This flag may be specified multiple times. This flag takes an argument with
272+ either of the following formats:
269273
270274* ` CRATENAME=PATH ` — Indicates the given crate is found at the given path.
271275* ` CRATENAME ` — Indicates the given crate may be found in the search path,
272276 such as within the sysroot or via the ` -L ` flag.
273277
278+ The same crate name may be specified multiple times for different crate types.
279+ For loading metadata, ` rlib ` takes precedence over ` rmeta ` , which takes
280+ precedence over ` dylib ` . If both an ` rlib ` and ` dylib ` are found, an internal
281+ algorithm is used to decide which to use for linking. The [ ` -C prefer-dynamic `
282+ flag] [ prefer-dynamic ] may be used to influence which is used.
283+
284+ If the same crate name is specified with and without a path, the one with the
285+ path is used and the pathless flag has no effect.
286+
287+ [ extern prelude ] : ../reference/items/extern-crates.html#extern-prelude
288+ [ prefer-dynamic ] : codegen-options/index.md#prefer-dynamic
289+
274290<a id =" option-sysroot " ></a >
275291## ` --sysroot ` : Override the system root
276292
0 commit comments