default_alloc_error_handler requires the linker to omit __rg_oom from liballoc #95113
Closed
Description
__rg_oom
calls the rust_oom
symbol (aka the "oom" weak lang item). This symbol is not defined when using default_alloc_error_handler
.
rust/library/alloc/src/alloc.rs
Lines 403 to 412 in 352e621
This causes https://github.com/rust-lang/rust/blob/31535841701e0bf7ef33998024376f2cedd8b3e3/src/test/ui/allocator/no_std-alloc-error-handler-default.rs to fail with cg_clif as it uses -Zfunction-sections=no
by default. I suspect it would also cause it to fail for windows as windows has this default too.
Applying the approach of #86844 to the alloc error handler too should trivially fix this. This PR is still pending decision if it should be done or not.