在 2025-9-22 17:16, Pali Rohár 写道:
Commit b1a9061ff489 ("winpthreads: Fix thread-local storage callbacks on
MSVC") already fixed it for MSVC. For GNU linker it is needed to explicitly
reference that variable and store its reference to some other variable
marked with __attribute__((used)) to prevent LTO compiler discarding it.
'... prevent ... *from* discarding it.' With this correction, the first 5 patches look good to me. I will push them after llvm tests pass.The last one is unnecessary. Initializing a lock doesn't require an atomic operation; only passing it to other threads does. And even when it's necessary to use an atomic operation, `volatile` is not sufficient for ARM64; it has to be done with `__atomic_store_n` which compiles to an STLR instruction.
-- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
