@@ -7,7 +7,9 @@ use rustc_data_structures::profiling::TimePassesFormat;
7
7
use rustc_data_structures:: stable_hasher:: Hash64 ;
8
8
use rustc_errors:: ColorConfig ;
9
9
use rustc_errors:: { LanguageIdentifier , TerminalUrl } ;
10
- use rustc_target:: spec:: { CodeModel , LinkerFlavorCli , MergeFunctions , PanicStrategy , SanitizerSet } ;
10
+ use rustc_target:: spec:: {
11
+ CodeModel , LinkerFlavorCli , MergeFunctions , PanicStrategy , SanitizerSet , WasmCAbi ,
12
+ } ;
11
13
use rustc_target:: spec:: {
12
14
RelocModel , RelroLevel , SplitDebuginfo , StackProtector , TargetTriple , TlsModel ,
13
15
} ;
@@ -429,6 +431,7 @@ mod desc {
429
431
pub const parse_remap_path_scope: & str = "comma separated list of scopes: `macro`, `diagnostics`, `unsplit-debuginfo`, `split-debuginfo`, `split-debuginfo-path`, `object`, `all`" ;
430
432
pub const parse_inlining_threshold: & str =
431
433
"either a boolean (`yes`, `no`, `on`, `off`, etc), or a non-negative number" ;
434
+ pub const parse_wasm_c_abi: & str = "`legacy` or `spec`" ;
432
435
}
433
436
434
437
mod parse {
@@ -1331,6 +1334,15 @@ mod parse {
1331
1334
}
1332
1335
true
1333
1336
}
1337
+
1338
+ pub ( crate ) fn parse_wasm_c_abi ( slot : & mut WasmCAbi , v : Option < & str > ) -> bool {
1339
+ match v {
1340
+ Some ( "spec" ) => * slot = WasmCAbi :: Spec ,
1341
+ Some ( "legacy" ) => * slot = WasmCAbi :: Legacy ,
1342
+ _ => return false ,
1343
+ }
1344
+ true
1345
+ }
1334
1346
}
1335
1347
1336
1348
options ! {
@@ -1933,6 +1945,8 @@ written to standard error output)"),
1933
1945
Requires `-Clto[=[fat,yes]]`") ,
1934
1946
wasi_exec_model: Option <WasiExecModel > = ( None , parse_wasi_exec_model, [ TRACKED ] ,
1935
1947
"whether to build a wasi command or reactor" ) ,
1948
+ wasm_c_abi: WasmCAbi = ( WasmCAbi :: Legacy , parse_wasm_c_abi, [ TRACKED ] ,
1949
+ "use spec-compliant C ABI for `wasm32-unknown-unknown` (default: legacy)" ) ,
1936
1950
write_long_types_to_disk: bool = ( true , parse_bool, [ UNTRACKED ] ,
1937
1951
"whether long type names should be written to files instead of being printed in errors" ) ,
1938
1952
// tidy-alphabetical-end
0 commit comments