@@ -280,6 +280,7 @@ pub struct Config {
280
280
pub rust_codegen_backends : Vec < String > ,
281
281
pub rust_verify_llvm_ir : bool ,
282
282
pub rust_thin_lto_import_instr_limit : Option < u32 > ,
283
+ pub rust_randomize_layout : bool ,
283
284
pub rust_remap_debuginfo : bool ,
284
285
pub rust_new_symbol_mangling : Option < bool > ,
285
286
pub rust_profile_use : Option < String > ,
@@ -1088,6 +1089,7 @@ define_config! {
1088
1089
codegen_units: Option <u32 > = "codegen-units" ,
1089
1090
codegen_units_std: Option <u32 > = "codegen-units-std" ,
1090
1091
debug_assertions: Option <bool > = "debug-assertions" ,
1092
+ randomize_layout: Option <bool > = "randomize-layout" ,
1091
1093
debug_assertions_std: Option <bool > = "debug-assertions-std" ,
1092
1094
overflow_checks: Option <bool > = "overflow-checks" ,
1093
1095
overflow_checks_std: Option <bool > = "overflow-checks-std" ,
@@ -1179,6 +1181,7 @@ impl Config {
1179
1181
backtrace : true ,
1180
1182
rust_optimize : RustOptimize :: Bool ( true ) ,
1181
1183
rust_optimize_tests : true ,
1184
+ rust_randomize_layout : false ,
1182
1185
submodules : None ,
1183
1186
docs : true ,
1184
1187
docs_minification : true ,
@@ -1629,6 +1632,7 @@ impl Config {
1629
1632
backtrace,
1630
1633
incremental,
1631
1634
parallel_compiler,
1635
+ randomize_layout,
1632
1636
default_linker,
1633
1637
channel,
1634
1638
description,
@@ -1718,6 +1722,7 @@ impl Config {
1718
1722
set ( & mut config. lld_mode , lld_mode) ;
1719
1723
set ( & mut config. llvm_bitcode_linker_enabled , llvm_bitcode_linker) ;
1720
1724
1725
+ config. rust_randomize_layout = randomize_layout. unwrap_or_default ( ) ;
1721
1726
config. llvm_tools_enabled = llvm_tools. unwrap_or ( true ) ;
1722
1727
config. rustc_parallel =
1723
1728
parallel_compiler. unwrap_or ( config. channel == "dev" || config. channel == "nightly" ) ;
@@ -2889,6 +2894,7 @@ fn check_incompatible_options_for_ci_rustc(
2889
2894
let Rust {
2890
2895
// Following options are the CI rustc incompatible ones.
2891
2896
optimize,
2897
+ randomize_layout,
2892
2898
debug_logging,
2893
2899
debuginfo_level_rustc,
2894
2900
llvm_tools,
@@ -2953,6 +2959,7 @@ fn check_incompatible_options_for_ci_rustc(
2953
2959
// otherwise, we just print a warning with `warn` macro.
2954
2960
2955
2961
err ! ( current_rust_config. optimize, optimize) ;
2962
+ err ! ( current_rust_config. randomize_layout, randomize_layout) ;
2956
2963
err ! ( current_rust_config. debug_logging, debug_logging) ;
2957
2964
err ! ( current_rust_config. debuginfo_level_rustc, debuginfo_level_rustc) ;
2958
2965
err ! ( current_rust_config. rpath, rpath) ;
0 commit comments