@@ -162,6 +162,29 @@ this to satisfy the linking requirements of extern blocks elsewhere in your
162
162
code (including upstream crates) instead of adding the attribute to each extern
163
163
block.
164
164
165
+ #### Linking modifiers: ` bundle `
166
+
167
+ This modifier is only compatible with the ` static ` linking kind.
168
+ Using any other kind will result in a compiler error.
169
+
170
+ When building a rlib or staticlib ` +bundle ` means that all object files from the native static
171
+ library will be added to the rlib or staticlib archive, and then used from it during linking of
172
+ the final binary.
173
+
174
+ When building a rlib ` -bundle ` means that the native static library is registered as a dependency
175
+ of that rlib "by name", and object files from it are included only during linking of the final
176
+ binary, the file search by that name is also performed during final linking. \
177
+ When building a staticlib ` -bundle ` means that the native static library is simply not included
178
+ into the archive and some higher level build system will need to add it later during linking of
179
+ the final binary.
180
+
181
+ This modifier has no effect when building other targets like executables or dynamic libraries.
182
+
183
+ The default for this modifier is ` +bundle ` .
184
+
185
+ More implementation details about this modifier can be found in
186
+ [ ` bundle ` documentation for rustc] .
187
+
165
188
#### Linking modifiers: ` whole-archive `
166
189
167
190
This modifier is only compatible with the ` static ` linking kind.
@@ -170,7 +193,10 @@ Using any other kind will result in a compiler error.
170
193
` +whole-archive ` means that the static library is linked as a whole archive
171
194
without throwing any object files away.
172
195
173
- More implementation details about this modifier can be found in [ documentation for rustc] .
196
+ The default for this modifier is ` -whole-archive ` .
197
+
198
+ More implementation details about this modifier can be found in
199
+ [ ` whole-archive ` documentation for rustc] .
174
200
175
201
### The ` link_name ` attribute
176
202
@@ -205,4 +231,5 @@ restrictions as [regular function parameters].
205
231
[ _Visibility_ ] : ../visibility-and-privacy.md
206
232
[ attributes ] : ../attributes.md
207
233
[ regular function parameters ] : functions.md#attributes-on-function-parameters
208
- [ documentation for rustc ] : ../../rustc/command-line-arguments.html#linking-modifiers-whole-archive
234
+ [ `bundle` documentation for rustc ] : ../../rustc/command-line-arguments.html#linking-modifiers-bundle
235
+ [ `whole-archive` documentation for rustc ] : ../../rustc/command-line-arguments.html#linking-modifiers-whole-archive
0 commit comments