From 7a646df0985236ca8371865bcab978cc7d8ccda6 Mon Sep 17 00:00:00 2001 From: Hans Kratz Date: Mon, 11 Oct 2021 19:54:27 +0200 Subject: [PATCH 1/4] Add missing entries for overflow-checks to config.toml.example. --- config.toml.example | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config.toml.example b/config.toml.example index d811b914d20a1..b63ff14d7d38d 100644 --- a/config.toml.example +++ b/config.toml.example @@ -423,6 +423,18 @@ changelog-seen = 2 # set this value to `true`. #debug-logging = rust.debug-assertions (boolean) +# Whether or not overflow checks are enabled for the compiler and standard +# library. +# +# Defaults to rust.debug value +#overflow-checks = rust.debug (boolean) + +# Whether or not overflow checks are enabled for the standard library. +# Overrides the `overflow-checks` option, if defined. +# +# Defaults to rust.overflow-checks value +#overflow-checks-std = rust.overflow-checks (boolean) + # Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`. # `0` - no debug info # `1` - line tables only - sufficient to generate backtraces that include line From cfc7782a8457ff6e6856ef6741725c29b2e7c9c1 Mon Sep 17 00:00:00 2001 From: Hans Kratz Date: Mon, 11 Oct 2021 23:05:26 +0200 Subject: [PATCH 2/4] Add --enable-overflow-checks-std option to configure script. --- src/bootstrap/configure.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index fd148d14478d8..ce029089c5a79 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -76,6 +76,7 @@ def v(*args): o("llvm-plugins", "llvm.plugins", "build LLVM with plugin interface") o("debug-assertions", "rust.debug-assertions", "build with debugging assertions") o("overflow-checks", "rust.overflow-checks", "build with overflow checks") +o("overflow-checks-std", "rust.overflow-checks-std", "build the standard library with overflow checks") o("llvm-release-debuginfo", "llvm.release-debuginfo", "build LLVM with debugger metadata") v("debuginfo-level", "rust.debuginfo-level", "debuginfo level for Rust code") v("debuginfo-level-rustc", "rust.debuginfo-level-rustc", "debuginfo level for the compiler") From bcf7cf6670adc17e84410e3d079002f5c338921a Mon Sep 17 00:00:00 2001 From: Hans Kratz Date: Tue, 12 Oct 2021 21:32:47 +0200 Subject: [PATCH 3/4] Add --enable-debug-assertions-std option to configure script. --- src/bootstrap/configure.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index ce029089c5a79..94424cb4548fa 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -75,6 +75,7 @@ def v(*args): o("llvm-assertions", "llvm.assertions", "build LLVM with assertions") o("llvm-plugins", "llvm.plugins", "build LLVM with plugin interface") o("debug-assertions", "rust.debug-assertions", "build with debugging assertions") +o("debug-assertions-std", "rust.debug-assertions-std", "build the standard library with debugging assertions") o("overflow-checks", "rust.overflow-checks", "build with overflow checks") o("overflow-checks-std", "rust.overflow-checks-std", "build the standard library with overflow checks") o("llvm-release-debuginfo", "llvm.release-debuginfo", "build LLVM with debugger metadata") From 905ed5fa89d613f7d77509f49f47ebbd85469063 Mon Sep 17 00:00:00 2001 From: Hans Kratz Date: Tue, 12 Oct 2021 21:28:49 +0200 Subject: [PATCH 4/4] Make `rust.overflow-checks-std`option default to `rust.overflow-checks`. --- src/bootstrap/config.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 062820040dc78..7818b8b7d515d 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -982,7 +982,8 @@ impl Config { config.rust_debug_assertions_std = debug_assertions_std.unwrap_or(config.rust_debug_assertions); config.rust_overflow_checks = overflow_checks.unwrap_or(default); - config.rust_overflow_checks_std = overflow_checks_std.unwrap_or(default); + config.rust_overflow_checks_std = + overflow_checks_std.unwrap_or(config.rust_overflow_checks); config.rust_debug_logging = debug_logging.unwrap_or(config.rust_debug_assertions);