diff --git a/rust-toolchain b/rust-toolchain index 56fcfdff1c7..02c9b54898a 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-04-29" +channel = "nightly-2026-05-06" components = ["rust-src", "rustc-dev", "llvm-tools-preview"] diff --git a/src/archive.rs b/src/archive.rs deleted file mode 100644 index 0cee05f1cea..00000000000 --- a/src/archive.rs +++ /dev/null @@ -1,24 +0,0 @@ -use std::path::Path; - -use rustc_codegen_ssa::back::archive::{ - ArArchiveBuilder, ArchiveBuilder, ArchiveBuilderBuilder, DEFAULT_OBJECT_READER, -}; -use rustc_session::Session; - -pub(crate) struct ArArchiveBuilderBuilder; - -impl ArchiveBuilderBuilder for ArArchiveBuilderBuilder { - fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box { - Box::new(ArArchiveBuilder::new(sess, &DEFAULT_OBJECT_READER)) - } - - fn create_dll_import_lib( - &self, - _sess: &Session, - _lib_name: &str, - _import_name_and_ordinal_vector: Vec<(String, Option)>, - _output_path: &Path, - ) { - unimplemented!("creating dll imports is not yet supported"); - } -} diff --git a/src/back/lto.rs b/src/back/lto.rs index 6fd9cc96328..7166ad8b1f1 100644 --- a/src/back/lto.rs +++ b/src/back/lto.rs @@ -24,9 +24,10 @@ use std::path::{Path, PathBuf}; use gccjit::OutputKind; use object::read::archive::ArchiveFile; use rustc_codegen_ssa::back::lto::SerializedModule; +use rustc_codegen_ssa::back::rmeta_link; use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput, SharedEmitter}; use rustc_codegen_ssa::traits::*; -use rustc_codegen_ssa::{CompiledModule, ModuleCodegen, ModuleKind, looks_like_rust_object_file}; +use rustc_codegen_ssa::{CompiledModule, ModuleCodegen, ModuleKind}; use rustc_data_structures::memmap::Mmap; use rustc_data_structures::profiling::SelfProfilerRef; use rustc_errors::{DiagCtxt, DiagCtxtHandle}; @@ -63,6 +64,7 @@ fn prepare_lto(each_linked_rlib_for_lto: &[PathBuf], dcx: DiagCtxtHandle<'_>) -> let archive_data = unsafe { Mmap::map(File::open(path).expect("couldn't open rlib")).expect("couldn't map rlib") }; + let metadata_link = rmeta_link::read_from_data(&archive_data, path).unwrap(); let archive = ArchiveFile::parse(&*archive_data).expect("wanted an rlib"); let obj_files = archive .members() @@ -71,7 +73,7 @@ fn prepare_lto(each_linked_rlib_for_lto: &[PathBuf], dcx: DiagCtxtHandle<'_>) -> .ok() .and_then(|c| std::str::from_utf8(c.name()).ok().map(|name| (name.trim(), c))) }) - .filter(|&(name, _)| looks_like_rust_object_file(name)); + .filter(|&(name, _)| metadata_link.rust_object_files.iter().any(|f| f == name)); for (name, child) in obj_files { info!("adding bitcode from {}", name); let path = tmp_path.path().join(name); diff --git a/src/builder.rs b/src/builder.rs index 459f623a7c8..33f0f6fc2f8 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1659,6 +1659,10 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { unimplemented!(); } + fn get_funclet_cleanuppad(&self, _funclet: &Funclet) -> RValue<'gcc> { + unimplemented!(); + } + // Atomic Operations fn atomic_cmpxchg( &mut self, @@ -2315,67 +2319,10 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> { self.vector_extremum(a, b, ExtremumOperation::Min) } - #[cfg(feature = "master")] - pub fn vector_reduce_fmin(&mut self, src: RValue<'gcc>) -> RValue<'gcc> { - let vector_type = src.get_type().unqualified().dyncast_vector().expect("vector type"); - let element_count = vector_type.get_num_units(); - let mut acc = self - .context - .new_vector_access(self.location, src, self.context.new_rvalue_zero(self.int_type)) - .to_rvalue(); - for i in 1..element_count { - let elem = self - .context - .new_vector_access( - self.location, - src, - self.context.new_rvalue_from_int(self.int_type, i as _), - ) - .to_rvalue(); - let cmp = self.context.new_comparison(self.location, ComparisonOp::LessThan, acc, elem); - acc = self.select(cmp, acc, elem); - } - acc - } - - #[cfg(not(feature = "master"))] - pub fn vector_reduce_fmin(&mut self, _src: RValue<'gcc>) -> RValue<'gcc> { - unimplemented!(); - } - pub fn vector_maximum_number_nsz(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> { self.vector_extremum(a, b, ExtremumOperation::Max) } - #[cfg(feature = "master")] - pub fn vector_reduce_fmax(&mut self, src: RValue<'gcc>) -> RValue<'gcc> { - let vector_type = src.get_type().unqualified().dyncast_vector().expect("vector type"); - let element_count = vector_type.get_num_units(); - let mut acc = self - .context - .new_vector_access(self.location, src, self.context.new_rvalue_zero(self.int_type)) - .to_rvalue(); - for i in 1..element_count { - let elem = self - .context - .new_vector_access( - self.location, - src, - self.context.new_rvalue_from_int(self.int_type, i as _), - ) - .to_rvalue(); - let cmp = - self.context.new_comparison(self.location, ComparisonOp::GreaterThan, acc, elem); - acc = self.select(cmp, acc, elem); - } - acc - } - - #[cfg(not(feature = "master"))] - pub fn vector_reduce_fmax(&mut self, _src: RValue<'gcc>) -> RValue<'gcc> { - unimplemented!(); - } - pub fn vector_select( &mut self, cond: RValue<'gcc>, diff --git a/src/intrinsic/mod.rs b/src/intrinsic/mod.rs index a4c67c117cb..dc45fc49a79 100644 --- a/src/intrinsic/mod.rs +++ b/src/intrinsic/mod.rs @@ -213,7 +213,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc &args.iter().map(|arg| arg.immediate()).collect::>(), ) } - // TODO(antoyo): We can probably remove these and use the fallback intrinsic implementation. + // FIXME(antoyo): We can probably remove these and use the fallback intrinsic implementation. sym::minimumf32 | sym::minimumf64 | sym::maximumf32 | sym::maximumf64 => { let (ty, func_name) = match name { sym::minimumf32 => (self.cx.float_type, "fminimumf"), diff --git a/src/intrinsic/simd.rs b/src/intrinsic/simd.rs index 6fd19c4f82c..a32592b45e5 100644 --- a/src/intrinsic/simd.rs +++ b/src/intrinsic/simd.rs @@ -828,7 +828,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( return_error!(InvalidMonomorphization::FloatingPointVector { span, name, - f_ty: *f, + f_ty: f.name_str().to_string(), in_ty }); } @@ -1422,7 +1422,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( ); macro_rules! minmax_red { - ($name:ident: $int_red:ident, $float_red:ident) => { + ($name:ident: $int_red:ident) => { if name == sym::$name { require!( ret_ty == in_elem, @@ -1430,7 +1430,6 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( ); return match *in_elem.kind() { ty::Int(_) | ty::Uint(_) => Ok(bx.$int_red(args[0].immediate())), - ty::Float(_) => Ok(bx.$float_red(args[0].immediate())), _ => return_error!(InvalidMonomorphization::UnsupportedSymbol { span, name, @@ -1444,8 +1443,8 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( }; } - minmax_red!(simd_reduce_min: vector_reduce_min, vector_reduce_fmin); - minmax_red!(simd_reduce_max: vector_reduce_max, vector_reduce_fmax); + minmax_red!(simd_reduce_min: vector_reduce_min); + minmax_red!(simd_reduce_max: vector_reduce_max); macro_rules! bitwise_red { ($name:ident : $op:expr, $boolean:expr) => { diff --git a/src/lib.rs b/src/lib.rs index f84e3c402b6..ac9452306aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -409,8 +409,8 @@ impl WriteBackendMethods for GccCodegenBackend { } fn optimize_and_codegen_fat_lto( + sess: &Session, cgcx: &CodegenContext, - prof: &SelfProfilerRef, shared_emitter: &SharedEmitter, _tm_factory: TargetMachineFactoryFn, // FIXME(bjorn3): Limit LTO exports to these symbols @@ -418,7 +418,7 @@ impl WriteBackendMethods for GccCodegenBackend { each_linked_rlib_for_lto: &[PathBuf], modules: Vec>, ) -> CompiledModule { - back::lto::run_fat(cgcx, prof, shared_emitter, each_linked_rlib_for_lto, modules) + back::lto::run_fat(cgcx, &sess.prof, shared_emitter, each_linked_rlib_for_lto, modules) } fn run_thin_lto( diff --git a/tests/failing-run-make-tests.txt b/tests/failing-run-make-tests.txt index 528ee1df9f5..1feb2c7cc6e 100644 --- a/tests/failing-run-make-tests.txt +++ b/tests/failing-run-make-tests.txt @@ -12,3 +12,4 @@ tests/run-make/glibc-staticlib-args/ tests/run-make/lto-smoke-c/ tests/run-make/return-non-c-like-enum/ tests/run-make/short-ice +tests/run-make/embed-source-dwarf diff --git a/tests/lang_tests.rs b/tests/lang_tests.rs index 3d1d04661c8..6afd54e1c3f 100644 --- a/tests/lang_tests.rs +++ b/tests/lang_tests.rs @@ -19,7 +19,7 @@ fn compile_and_run_cmds( // Test command 2: run `tempdir/x`. if test_target.is_some() { let mut env_path = std::env::var("PATH").unwrap_or_default(); - // TODO(antoyo): find a better way to add the PATH necessary locally. + // FIXME(antoyo): find a better way to add the PATH necessary locally. env_path = format!("/opt/m68k-unknown-linux-gnu/bin:{}", env_path); compiler.env("PATH", env_path); @@ -112,7 +112,7 @@ fn build_test_runner( println!("=== {test_kind} tests ==="); - // TODO(antoyo): find a way to send this via a cli argument. + // FIXME(antoyo): find a way to send this via a cli argument. let test_target = std::env::var("CG_GCC_TEST_TARGET").ok(); let test_target_filter = test_target.clone(); diff --git a/tests/run/core-float.rs b/tests/run/core-float.rs index 195378b9d3c..38fa11a69b6 100644 --- a/tests/run/core-float.rs +++ b/tests/run/core-float.rs @@ -3,7 +3,7 @@ // Run-time: // status: 0 -// TODO: remove these tests (extracted from libcore) when we run the libcore tests in the CI of the +// FIXME: remove these tests (extracted from libcore) when we run the libcore tests in the CI of the // Rust repo. #![feature(core_intrinsics)] diff --git a/tools/cspell_dicts/rust.txt b/tools/cspell_dicts/rust.txt index 379cbd77eef..15faacd53d5 100644 --- a/tools/cspell_dicts/rust.txt +++ b/tools/cspell_dicts/rust.txt @@ -1,2 +1,3 @@ lateout repr +rmeta