Skip to content
Merged
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
9 changes: 0 additions & 9 deletions src/tools/compiletest/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,6 @@ pub(crate) fn parse_config(args: Vec<String>) -> Config {
let iteration_count = args.iteration_count.unwrap_or(Config::DEFAULT_ITERATION_COUNT);
assert!(iteration_count > 0, "`--iteration-count` must be a positive integer");

let gcc_supported_target_tuples = match default_codegen_backend {
CodegenBackend::Gcc => {
directives::find_gcc_supported_targets(&args.sysroot_base, &args.host)
}
CodegenBackend::Llvm | CodegenBackend::Cranelift => vec![],
};

// FIXME: this run scheme is... confusing.
let run = args.run.and_then(|mode| match mode.as_str() {
"auto" => None,
Expand Down Expand Up @@ -455,8 +448,6 @@ pub(crate) fn parse_config(args: Vec<String>) -> Config {
force_pass_mode: args.pass,
force_rerun: args.force_rerun,

gcc_supported_target_tuples,

gdb: args.gdb,
gdb_version,
git_hash: args.git_hash,
Expand Down
3 changes: 0 additions & 3 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,6 @@ pub(crate) struct Config {
/// Whether to ignore `//@ ignore-backends`.
pub(crate) bypass_ignore_backends: bool,

/// Target tuples for which we've found libgccjit.so.
pub(crate) gcc_supported_target_tuples: Vec<String>,

/// Number of parallel jobs configured for the build.
///
/// This is forwarded from bootstrap's `jobs` configuration.
Expand Down
26 changes: 1 addition & 25 deletions src/tools/compiletest/src/directives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,30 +851,6 @@ pub(crate) fn extract_llvm_version_from_binary(binary_path: &str) -> Option<Vers
None
}

pub(crate) fn find_gcc_supported_targets(sysroot_base: &Utf8Path, host: &str) -> Vec<String> {
// E.g. `lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/lib`.
let backends_dir =
sysroot_base.join("lib").join("rustlib").join(host).join("codegen-backends").join("lib");

match std::fs::read_dir(&backends_dir) {
Ok(entries) => {
// Search for `aarch64-unknown-linux-gnu/libgccjit.so` et cetera.
let target_tuples: Vec<_> = entries
.filter_map(|entry| entry.ok())
.filter(|entry| entry.path().join("libgccjit.so").exists())
.filter_map(|entry| entry.file_name().into_string().ok())
.collect();

if target_tuples.is_empty() {
panic!("did not find `libgccjit.so` for any target in {backends_dir}");
}

target_tuples
}
Err(e) => panic!("unable to find `libgccjit.so` for any target in {backends_dir}: {e:?}",),
}
}

/// Takes a directive of the form `"<version1> [- <version2>]"`, returns the numeric representation
/// of `<version1>` and `<version2>` as tuple: `(<version1>, <version2>)`.
///
Expand Down Expand Up @@ -1255,7 +1231,7 @@ fn ignore_unsupported_backend_target(config: &Config, line: &DirectiveLine<'_>)
return IgnoreDecision::Continue;
};

if !config.gcc_supported_target_tuples.iter().any(|t| t == target) {
if target != "x86_64-unknown-linux-gnu" {
IgnoreDecision::Ignore {
reason: format!(
"backend `{}` cannot build for target `{target}`",
Expand Down
1 change: 0 additions & 1 deletion src/tools/compiletest/src/rustdoc_gui_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ fn incomplete_config_for_rustdoc_gui_test() -> Config {
default_codegen_backend: CodegenBackend::Llvm,
override_codegen_backend: None,
bypass_ignore_backends: Default::default(),
gcc_supported_target_tuples: vec![],
jobs: Default::default(),
parallel_frontend_threads: Config::DEFAULT_PARALLEL_FRONTEND_THREADS,
iteration_count: Config::DEFAULT_ITERATION_COUNT,
Expand Down
Loading