Bootstrap: Add argument for building llvm bitcode linker
This commit is contained in:
@@ -679,6 +679,10 @@
|
|||||||
# sysroot.
|
# sysroot.
|
||||||
#llvm-tools = true
|
#llvm-tools = true
|
||||||
|
|
||||||
|
# Indicates whether the `self-contained` llvm-bitcode-linker, will be made available
|
||||||
|
# in the sysroot
|
||||||
|
#llvm-bitcode-linker = false
|
||||||
|
|
||||||
# Whether to deny warnings in crates
|
# Whether to deny warnings in crates
|
||||||
#deny-warnings = true
|
#deny-warnings = true
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ o("cargo-native-static", "build.cargo-native-static", "static native libraries i
|
|||||||
o("profiler", "build.profiler", "build the profiler runtime")
|
o("profiler", "build.profiler", "build the profiler runtime")
|
||||||
o("full-tools", None, "enable all tools")
|
o("full-tools", None, "enable all tools")
|
||||||
o("lld", "rust.lld", "build lld")
|
o("lld", "rust.lld", "build lld")
|
||||||
|
o("llvm-bitcode-linker", "rust.llvm-bitcode-linker", "build llvm bitcode linker")
|
||||||
o("clang", "llvm.clang", "build clang")
|
o("clang", "llvm.clang", "build clang")
|
||||||
o("use-libcxx", "llvm.use-libcxx", "build LLVM with libc++")
|
o("use-libcxx", "llvm.use-libcxx", "build LLVM with libc++")
|
||||||
o("control-flow-guard", "rust.control-flow-guard", "Enable Control Flow Guard")
|
o("control-flow-guard", "rust.control-flow-guard", "Enable Control Flow Guard")
|
||||||
@@ -366,6 +367,7 @@ def apply_args(known_args, option_checking, config):
|
|||||||
set('rust.codegen-backends', ['llvm'], config)
|
set('rust.codegen-backends', ['llvm'], config)
|
||||||
set('rust.lld', True, config)
|
set('rust.lld', True, config)
|
||||||
set('rust.llvm-tools', True, config)
|
set('rust.llvm-tools', True, config)
|
||||||
|
set('rust.llvm-bitcode-linker', True, config)
|
||||||
set('build.extended', True, config)
|
set('build.extended', True, config)
|
||||||
elif option.name in ['option-checking', 'verbose-configure']:
|
elif option.name in ['option-checking', 'verbose-configure']:
|
||||||
# this was handled above
|
# this was handled above
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ lto = "off"
|
|||||||
# Forces frame pointers to be used with `-Cforce-frame-pointers`.
|
# Forces frame pointers to be used with `-Cforce-frame-pointers`.
|
||||||
# This can be helpful for profiling at a small performance cost.
|
# This can be helpful for profiling at a small performance cost.
|
||||||
frame-pointers = true
|
frame-pointers = true
|
||||||
|
# Build the llvm-bitcode-linker as it is required for running nvptx tests
|
||||||
|
llvm-bitcode-linker = true
|
||||||
|
|
||||||
[llvm]
|
[llvm]
|
||||||
# Having this set to true disrupts compiler development workflows for people who use `llvm.download-ci-llvm = true`
|
# Having this set to true disrupts compiler development workflows for people who use `llvm.download-ci-llvm = true`
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ download-ci-llvm = false
|
|||||||
# Make sure they don't get set when installing from source.
|
# Make sure they don't get set when installing from source.
|
||||||
channel = "nightly"
|
channel = "nightly"
|
||||||
download-rustc = false
|
download-rustc = false
|
||||||
|
# Build the llvm-bitcode-linker as it is required for running nvptx tests
|
||||||
|
llvm-bitcode-linker = true
|
||||||
|
|
||||||
[dist]
|
[dist]
|
||||||
# Use better compression when preparing tarballs.
|
# Use better compression when preparing tarballs.
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ bench-stage = 0
|
|||||||
incremental = true
|
incremental = true
|
||||||
# Make the compiler and standard library faster to build, at the expense of a ~20% runtime slowdown.
|
# Make the compiler and standard library faster to build, at the expense of a ~20% runtime slowdown.
|
||||||
lto = "off"
|
lto = "off"
|
||||||
|
# Build the llvm-bitcode-linker as it is required for running nvptx tests
|
||||||
|
llvm-bitcode-linker = true
|
||||||
|
|
||||||
[llvm]
|
[llvm]
|
||||||
# Will download LLVM from CI if available on your platform.
|
# Will download LLVM from CI if available on your platform.
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ incremental = true
|
|||||||
# Using these defaults will download the stage2 compiler (see `download-rustc`
|
# Using these defaults will download the stage2 compiler (see `download-rustc`
|
||||||
# setting) and the stage2 toolchain should therefore be used for these defaults.
|
# setting) and the stage2 toolchain should therefore be used for these defaults.
|
||||||
download-rustc = "if-unchanged"
|
download-rustc = "if-unchanged"
|
||||||
|
# Build the llvm-bitcode-linker as it is required for running nvptx tests
|
||||||
|
llvm-bitcode-linker = true
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
# Document with the in-tree rustdoc by default, since `download-rustc` makes it quick to compile.
|
# Document with the in-tree rustdoc by default, since `download-rustc` makes it quick to compile.
|
||||||
|
|||||||
@@ -1843,6 +1843,16 @@ impl Step for Assemble {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if builder.config.llvm_bitcode_linker_enabled {
|
||||||
|
let src_path = builder.ensure(crate::core::build_steps::tool::LlvmBitcodeLinker {
|
||||||
|
compiler: build_compiler,
|
||||||
|
target: target_compiler.host,
|
||||||
|
extra_features: vec![],
|
||||||
|
});
|
||||||
|
let tool_exe = exe("llvm-bitcode-linker", target_compiler.host);
|
||||||
|
builder.copy(&src_path, &libdir_bin.join(&tool_exe));
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure that `libLLVM.so` ends up in the newly build compiler directory,
|
// Ensure that `libLLVM.so` ends up in the newly build compiler directory,
|
||||||
// so that it can be found when the newly built `rustc` is run.
|
// so that it can be found when the newly built `rustc` is run.
|
||||||
dist::maybe_install_llvm_runtime(builder, target_compiler.host, &sysroot);
|
dist::maybe_install_llvm_runtime(builder, target_compiler.host, &sysroot);
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ pub struct Config {
|
|||||||
pub lld_mode: LldMode,
|
pub lld_mode: LldMode,
|
||||||
pub lld_enabled: bool,
|
pub lld_enabled: bool,
|
||||||
pub llvm_tools_enabled: bool,
|
pub llvm_tools_enabled: bool,
|
||||||
|
pub llvm_bitcode_linker_enabled: bool,
|
||||||
|
|
||||||
pub llvm_cflags: Option<String>,
|
pub llvm_cflags: Option<String>,
|
||||||
pub llvm_cxxflags: Option<String>,
|
pub llvm_cxxflags: Option<String>,
|
||||||
@@ -1099,6 +1100,7 @@ define_config! {
|
|||||||
dist_src: Option<bool> = "dist-src",
|
dist_src: Option<bool> = "dist-src",
|
||||||
save_toolstates: Option<String> = "save-toolstates",
|
save_toolstates: Option<String> = "save-toolstates",
|
||||||
codegen_backends: Option<Vec<String>> = "codegen-backends",
|
codegen_backends: Option<Vec<String>> = "codegen-backends",
|
||||||
|
llvm_bitcode_linker: Option<bool> = "llvm-bitcode-linker",
|
||||||
lld: Option<bool> = "lld",
|
lld: Option<bool> = "lld",
|
||||||
lld_mode: Option<LldMode> = "use-lld",
|
lld_mode: Option<LldMode> = "use-lld",
|
||||||
llvm_tools: Option<bool> = "llvm-tools",
|
llvm_tools: Option<bool> = "llvm-tools",
|
||||||
@@ -1571,6 +1573,7 @@ impl Config {
|
|||||||
codegen_backends,
|
codegen_backends,
|
||||||
lld,
|
lld,
|
||||||
llvm_tools,
|
llvm_tools,
|
||||||
|
llvm_bitcode_linker,
|
||||||
deny_warnings,
|
deny_warnings,
|
||||||
backtrace_on_ice,
|
backtrace_on_ice,
|
||||||
verify_llvm_ir,
|
verify_llvm_ir,
|
||||||
@@ -1650,6 +1653,7 @@ impl Config {
|
|||||||
}
|
}
|
||||||
set(&mut config.lld_mode, lld_mode);
|
set(&mut config.lld_mode, lld_mode);
|
||||||
set(&mut config.lld_enabled, lld);
|
set(&mut config.lld_enabled, lld);
|
||||||
|
set(&mut config.llvm_bitcode_linker_enabled, llvm_bitcode_linker);
|
||||||
|
|
||||||
if matches!(config.lld_mode, LldMode::SelfContained)
|
if matches!(config.lld_mode, LldMode::SelfContained)
|
||||||
&& !config.lld_enabled
|
&& !config.lld_enabled
|
||||||
|
|||||||
@@ -146,4 +146,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
|
|||||||
severity: ChangeSeverity::Info,
|
severity: ChangeSeverity::Info,
|
||||||
summary: "a new `target.*.runner` option is available to specify a wrapper executable required to run tests for a target",
|
summary: "a new `target.*.runner` option is available to specify a wrapper executable required to run tests for a target",
|
||||||
},
|
},
|
||||||
|
ChangeInfo {
|
||||||
|
change_id: 117458,
|
||||||
|
severity: ChangeSeverity::Info,
|
||||||
|
summary: "New option `rust.llvm-bitcode-linker` that will build the llvm-bitcode-linker.",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ ENV TARGETS=$TARGETS,x86_64-unknown-uefi
|
|||||||
# Luckily one of the folders is /usr/local/include so symlink /usr/include/x86_64-linux-gnu/asm there
|
# Luckily one of the folders is /usr/local/include so symlink /usr/include/x86_64-linux-gnu/asm there
|
||||||
RUN ln -s /usr/include/x86_64-linux-gnu/asm /usr/local/include/asm
|
RUN ln -s /usr/include/x86_64-linux-gnu/asm /usr/local/include/asm
|
||||||
|
|
||||||
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --disable-docs \
|
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --enable-llvm-bitcode-linker --disable-docs \
|
||||||
--set target.wasm32-wasi.wasi-root=/wasm32-wasip1 \
|
--set target.wasm32-wasi.wasi-root=/wasm32-wasip1 \
|
||||||
--set target.wasm32-wasip1.wasi-root=/wasm32-wasip1 \
|
--set target.wasm32-wasip1.wasi-root=/wasm32-wasip1 \
|
||||||
--set target.wasm32-wasi-preview1-threads.wasi-root=/wasm32-wasi-preview1-threads \
|
--set target.wasm32-wasi-preview1-threads.wasi-root=/wasm32-wasi-preview1-threads \
|
||||||
|
|||||||
Reference in New Issue
Block a user