rust/library/std/src
Matthias Krüger cc92bdb9c9
Rollup merge of #106779 - RReverser:patch-2, r=Mark-Simulacrum
Avoid __cxa_thread_atexit_impl on Emscripten

 - Fixes https://github.com/rust-lang/rust/issues/91628.
 - Fixes https://github.com/emscripten-core/emscripten/issues/15722.

See discussion in both issues.

The TL;DR is that weak linkage causes LLVM to produce broken Wasm, presumably due to pointer mismatch. The code is casting a void pointer to a function pointer with specific signature, but Wasm is very strict about function pointer compatibility, so the resulting code is invalid.

Ideally LLVM should catch this earlier in the process rather than emit invalid Wasm, but it currently doesn't and this is an easy and valid fix, given that Emcripten doesn't have `__cxa_thread_atexit_impl` these days anyway.

Unfortunately, I can't add a regression test as even after looking into this issue for a long time, I couldn't reproduce it with any minimal Rust example, only with extracted LLVM IR or on a large project involving Rust + C++.
2023-01-26 07:53:22 +01:00
..
backtrace Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
collections Auto merge of #104658 - thomcc:rand-update-and-usable-no_std, r=Mark-Simulacrum 2023-01-08 01:34:05 +00:00
env
error remove fn backtrace 2022-08-01 20:10:40 +00:00
f32 Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
f64 Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
ffi Guarantee try_reserve preserves the contents on error 2022-08-10 01:51:38 +09:00
fs Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00
io Remove unnecessary &format! 2023-01-21 22:06:42 -05:00
net Remove unnecessary &format! 2023-01-21 22:06:42 -05:00
num
os Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett 2023-01-18 15:55:37 +05:30
panic
path make many std tests work in Miri 2022-08-18 18:07:39 -04:00
personality Add comment 2023-01-09 23:26:06 +08:00
prelude Update bootstrap cfg 2022-12-28 09:18:43 -05:00
process More verbose Debug implementation of std::process:Command 2022-12-27 09:50:01 +01:00
sync Rollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu 2023-01-13 19:16:44 +01:00
sys Rollup merge of #106779 - RReverser:patch-2, r=Mark-Simulacrum 2023-01-26 07:53:22 +01:00
sys_common refactor[std]: do not use box syntax 2023-01-17 14:08:35 +01:00
thread refactor[std]: do not use box syntax 2023-01-17 14:08:35 +01:00
time Fix non-associativity of Instant math on aarch64-apple-darwin targets 2022-11-13 12:01:42 -08:00
alloc.rs default OOM handler: use non-unwinding panic (unless -Zoom=panic is set), to match std handler 2023-01-02 16:35:14 +01:00
ascii.rs Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
backtrace.rs Replace libstd, libcore, liballoc in docs. 2022-12-30 14:00:40 +01:00
env.rs Rollup merge of #101648 - Timmmm:home_dir_docs, r=joshtriplett 2022-12-11 23:36:44 +01:00
error.rs remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
f32.rs Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
f64.rs Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
fs.rs Fix some missed double spaces. 2023-01-14 18:26:38 +01:00
keyword_docs.rs review feedback 2022-10-07 15:21:47 +02:00
lib.rs refactor[std]: do not use box syntax 2023-01-17 14:08:35 +01:00
macros.rs Add tidy check for dbg 2022-12-31 15:32:09 +05:30
num.rs
panic.rs Clarify catch_unwind docs about panic hooks 2022-12-28 16:54:42 +01:00
panicking.rs Remove various double spaces in source comments. 2023-01-14 17:22:04 +01:00
path.rs add example of joining with a absolute path 2023-01-20 12:03:43 +01:00
personality.rs Move personality functions to std 2022-08-23 16:12:58 +08:00
primitive_docs.rs disable strict-provenance-violating doctests in Miri 2022-11-22 11:49:02 +01:00
process.rs delete more cfg(bootstrap) 2022-12-28 09:18:43 -05:00
rt.rs Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
time.rs Bump version placeholders to release 2022-11-06 17:11:02 -05:00