You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/rustc_session/src/options.rs
+13
Original file line number
Diff line number
Diff line change
@@ -405,6 +405,7 @@ mod desc {
405
405
pubconst parse_switch_with_opt_path:&str =
406
406
"an optional path to the profiling data output directory";
407
407
pubconst parse_merge_functions:&str = "one of: `disabled`, `trampolines`, or `aliases`";
408
+
pubconst parse_symbol_mangling_digest:&str = "configuing parameters for shortening symbol names: `<crate>[*],...[,excluded=true|false][,salt=value][,level=1|2]`";
408
409
pubconst parse_symbol_mangling_version:&str = "either `legacy` or `v0` (RFC 2603)";
409
410
pubconst parse_src_file_hash:&str = "either `md5` or `sha1`";
410
411
pubconst parse_relocation_model:&str =
@@ -1206,6 +1207,16 @@ mod parse {
1206
1207
true
1207
1208
}
1208
1209
1210
+
pub(crate)fnparse_symbol_mangling_digest(
1211
+
slot:&mutSymbolManglingDigest,
1212
+
v:Option<&str>,
1213
+
) -> bool{
1214
+
ifletSome(v) = v {
1215
+
return slot.hasher_enable(v);
1216
+
}
1217
+
true
1218
+
}
1219
+
1209
1220
pub(crate)fnparse_src_file_hash(
1210
1221
slot:&mutOption<SourceFileHashAlgorithm>,
1211
1222
v:Option<&str>,
@@ -1905,6 +1916,8 @@ written to standard error output)"),
1905
1916
"prefer dynamic linking to static linking for staticlibs (default: no)"),
An optimization option is added to allow users to generate shorter symbol names for dylib. At the expense of commissioning capabilities such as readability of symbol names, this option eliminates the space bottlenech encountered by using Rust to replace existing C/C++ functional modules in resource-constrained scenarios.
4
+
5
+
The new option are defined as follows: `-Z symbol_mangling_digest=<crate_name>[*],...[,excluded=<true|false>][,salt=<value>][,level=<1|2>]`.
6
+
7
+
-`crate_name[*],...`: Name of a crate. Multiple crate names are allowd. If the suffix `*` is carried, it is the prefix of the crate name. It and `excluded` togeter determine the range of symbols to be optimized. User must be very clear about the optimization range. If the crate supports regular expression maching, the optimization range is difficult to determine. May cause confusion. Defaults to null.
8
+
-`excluded=<true|false>`: If the value is `false`, only the names of symbols whose crate names are successfully matched are optimized. If the value is `true`, it indicates that the name of the symbol that fails to be matched is optimized. the default value is `false`.
9
+
-`salt=<value>`: User-specified salt value used in hash calculation. The default value is null.
10
+
-`level=<1|2>`: Specifies the combination policy of the final symbol name. If the value is `1`, the final combination format is `{crate}.{item}.{hash32}`. If the value is `2`, the final combination format is `{crate}.{hash64}`. The default value is `2`.
0 commit comments