File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,16 @@ be ignored in favor of only building the artifacts specified by command line.
52
52
compiled as dynamic libraries) will have to be specified manually when
53
53
linking that static library from somewhere. The ` --print=native-static-libs ` flag may help with this.
54
54
55
+ Note that, because the resulting static library contains the code of all the
56
+ dependencies, including the standard library, and also exports all public
57
+ symbols of them, linking the static library into an executable or shared
58
+ library may need special care. In case of a shared library the list of
59
+ exported symbols will have to be limited via e.g. a linker or symbol version
60
+ script, exported symbols list (macOS), or module definition file (Windows).
61
+ Additionally, unused sections can be removed to remove all code of
62
+ dependencies that is not actually used (e.g. ` --gc-sections ` or ` -dead_strip `
63
+ for macOS).
64
+
55
65
* ` --crate-type=cdylib ` , ` #![crate_type = "cdylib"] ` - A dynamic system
56
66
library will be produced. This is used when compiling
57
67
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