From 9befcfd0f4671675341e770c5bb3bf696c7aa670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:37:10 +0800 Subject: [PATCH] Fix `cross-lang-lto` to not use `path_file_prefix` --- tests/run-make/cross-lang-lto/rmake.rs | 15 ++++++++++----- .../issue-107495-archive-permissions/rmake.rs | 5 ++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/run-make/cross-lang-lto/rmake.rs b/tests/run-make/cross-lang-lto/rmake.rs index dc376b561e4..50d37460d8d 100644 --- a/tests/run-make/cross-lang-lto/rmake.rs +++ b/tests/run-make/cross-lang-lto/rmake.rs @@ -3,8 +3,6 @@ // -Clinker-plugin-lto. // See https://github.com/rust-lang/rust/pull/50000 -#![feature(path_file_prefix)] - use std::path::PathBuf; use run_make_support::{ @@ -92,10 +90,17 @@ fn check_bitcode(instructions: LibBuild) { llvm_ar().extract().arg(&instructions.output).run(); } - for object in shallow_find_files(cwd(), |path| { - has_prefix(path, instructions.output.file_prefix().unwrap().to_str().unwrap()) + let objects = shallow_find_files(cwd(), |path| { + let mut output_path = instructions.output.clone(); + output_path.set_extension(""); + has_prefix(path, output_path.file_name().unwrap().to_str().unwrap()) && has_extension(path, "o") - }) { + }); + assert!(!objects.is_empty()); + println!("objects: {:#?}", objects); + + for object in objects { + println!("reading bitcode: {}", object.display()); // All generated object files should be LLVM bitcode files - this will fail otherwise. llvm_bcanalyzer().input(object).run(); } diff --git a/tests/run-make/issue-107495-archive-permissions/rmake.rs b/tests/run-make/issue-107495-archive-permissions/rmake.rs index 5d7c8a49bcc..228cfb0864e 100644 --- a/tests/run-make/issue-107495-archive-permissions/rmake.rs +++ b/tests/run-make/issue-107495-archive-permissions/rmake.rs @@ -1,10 +1,9 @@ -#[cfg(unix)] -use run_make_support::libc; - #[cfg(unix)] use std::os::unix::fs::PermissionsExt; use std::path::Path; +#[cfg(unix)] +use run_make_support::libc; use run_make_support::{aux_build, rfs}; fn main() {