File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,16 @@ be ignored in favor of only building the artifacts specified by command line.
4747 linking Rust code into an existing non-Rust application
4848 because it will not have dynamic dependencies on other Rust code.
4949
50+ Note that, because the resulting static library contains all of the
51+ dependencies, including the standard library, and also exports all public
52+ symbols of them, linking the static library into an executable or shared
53+ library will need special care. In case of a shared library the list of
54+ exported symbols will have to be limited via e.g. a linker or symbol version
55+ script, exported symbols list (macOS) or module definition file (Windows).
56+ Additionally, unused sections can be removed to remove all code of
57+ dependencies that is not actually used (e.g. ` --gc-sections ` or
58+ ` -dead_strip ` for macOS).
59+
5060* ` --crate-type=cdylib ` , ` #![crate_type = "cdylib"] ` - A dynamic system
5161 library will be produced. This is used when compiling
5262 a dynamic library to be loaded from another language. This output type will
You can’t perform that action at this time.
0 commit comments