Auto merge of #131634 - davidlattimore:lld-protected, r= · rust-lang/rust@3639412 (original) (raw)
`@@ -291,6 +291,7 @@ pub struct Config {
`
291
291
`pub rust_lto: RustcLto,
`
292
292
`pub rust_validate_mir_opts: Option,
`
293
293
`pub rust_std_features: BTreeSet,
`
``
294
`+
pub rust_use_protected_symbols: bool,
`
294
295
`pub llvm_profile_use: Option,
`
295
296
`pub llvm_profile_generate: bool,
`
296
297
`pub llvm_libunwind_default: Option,
`
`@@ -1166,6 +1167,7 @@ define_config! {
`
1166
1167
` lto: Option = "lto",
`
1167
1168
` validate_mir_opts: Option = "validate-mir-opts",
`
1168
1169
` std_features: Option<BTreeSet> = "std-features",
`
``
1170
`+
use_protected_symbols: Option = "use-protected-symbols",
`
1169
1171
`}
`
1170
1172
`}
`
1171
1173
``
`@@ -1223,6 +1225,7 @@ impl Config {
`
1223
1225
`dist_include_mingw_linker: true,
`
1224
1226
`dist_compression_profile: "fast".into(),
`
1225
1227
`rustc_parallel: true,
`
``
1228
`+
rust_use_protected_symbols: false,
`
1226
1229
``
1227
1230
`stdout_is_tty: std::io::stdout().is_terminal(),
`
1228
1231
`stderr_is_tty: std::io::stderr().is_terminal(),
`
`@@ -1725,6 +1728,7 @@ impl Config {
`
1725
1728
` strip,
`
1726
1729
` lld_mode,
`
1727
1730
`std_features: std_features_toml,
`
``
1731
`+
use_protected_symbols,
`
1728
1732
`} = rust;
`
1729
1733
``
1730
1734
` is_user_configured_rust_channel = channel.is_some();
`
`@@ -1769,6 +1773,12 @@ impl Config {
`
1769
1773
`set(&mut config.lld_mode, lld_mode);
`
1770
1774
`set(&mut config.llvm_bitcode_linker_enabled, llvm_bitcode_linker);
`
1771
1775
``
``
1776
`+
// Default to using protected symbols only when linking with LLD.
`
``
1777
`+
if config.lld_mode != LldMode::Unused {
`
``
1778
`+
config.rust_use_protected_symbols = true;
`
``
1779
`+
}
`
``
1780
`+
set(&mut config.rust_use_protected_symbols, use_protected_symbols);
`
``
1781
+
1772
1782
` config.rust_randomize_layout = randomize_layout.unwrap_or_default();
`
1773
1783
` config.llvm_tools_enabled = llvm_tools.unwrap_or(true);
`
1774
1784
` config.rustc_parallel =
`
`@@ -3109,6 +3119,7 @@ fn check_incompatible_options_for_ci_rustc(
`
3109
3119
`download_rustc: _,
`
3110
3120
`validate_mir_opts: _,
`
3111
3121
`frame_pointers: _,
`
``
3122
`+
use_protected_symbols: _,
`
3112
3123
`} = ci_rust_config;
`
3113
3124
``
3114
3125
`// There are two kinds of checks for CI rustc incompatible options:
`