From 8a2a9db29eca4468eb1ccf58183b01fe61d00120 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Fri, 1 Aug 2025 10:40:19 -0400 Subject: Fix LTO errors by not adding AlwaysInline to __rust_alloc_error_handler_should_panic_v2 --- src/allocator.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/allocator.rs b/src/allocator.rs index 66258390d90..2a95a7368aa 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -104,7 +104,8 @@ fn create_const_value_function( tcx.sess.default_visibility(), ))); - func.add_attribute(FnAttribute::AlwaysInline); + // FIXME(antoyo): cg_llvm sets AlwaysInline, but AlwaysInline is different in GCC and using + // it here will causes linking errors when using LTO. func.add_attribute(FnAttribute::Inline); } -- cgit 1.4.1-3-g733a5