Skip to content

Introduce llvm-enable-rtti option #93640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ changelog-seen = 2
# The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake.
#use-linker = <none> (path)

# Whether or not to specify `-DLLVM_ENABLE_RTTI=YES`
#enable-rtti = false

# Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES`
#allow-old-toolchain = false

Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ pub struct Config {
pub llvm_version_suffix: Option<String>,
pub llvm_use_linker: Option<String>,
pub llvm_allow_old_toolchain: bool,
pub llvm_enable_rtti: bool,
pub llvm_polly: bool,
pub llvm_clang: bool,
pub llvm_from_ci: bool,
Expand Down Expand Up @@ -474,6 +475,7 @@ derive_merge! {
use_libcxx: Option<bool>,
use_linker: Option<String>,
allow_old_toolchain: Option<bool>,
enable_rtti: Option<bool>,
polly: Option<bool>,
clang: Option<bool>,
download_ci_llvm: Option<StringOrBool>,
Expand Down Expand Up @@ -805,6 +807,7 @@ impl Config {
set(&mut config.llvm_use_libcxx, llvm.use_libcxx);
config.llvm_use_linker = llvm.use_linker.clone();
config.llvm_allow_old_toolchain = llvm.allow_old_toolchain.unwrap_or(false);
config.llvm_enable_rtti = llvm.enable_rtti.unwrap_or(false);
config.llvm_polly = llvm.polly.unwrap_or(false);
config.llvm_clang = llvm.clang.unwrap_or(false);
config.llvm_from_ci = match llvm.download_ci_llvm {
Expand Down Expand Up @@ -874,6 +877,7 @@ impl Config {
check_ci_llvm!(llvm.use_libcxx);
check_ci_llvm!(llvm.use_linker);
check_ci_llvm!(llvm.allow_old_toolchain);
check_ci_llvm!(llvm.enable_rtti);
check_ci_llvm!(llvm.polly);
check_ci_llvm!(llvm.clang);
check_ci_llvm!(llvm.plugins);
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def v(*args):
o("optimize", "rust.optimize", "build optimized rust code")
o("optimize-llvm", "llvm.optimize", "build optimized LLVM")
o("llvm-assertions", "llvm.assertions", "build LLVM with assertions")
o("llvm-enable-rtti", "llvm.enable-rtti", "build LLVM with using C++’s built in RTTI")
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")
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ impl Step for Llvm {
cfg.define("LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN", "YES");
}

if builder.config.llvm_enable_rtti {
cfg.define("LLVM_ENABLE_RTTI", "YES");
}

configure_cmake(builder, target, &mut cfg, true);

// FIXME: we don't actually need to build all LLVM tools and all LLVM
Expand Down