[llvm] Workaround -Wglobal-constructor warning. (PR #94699)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 12:02:06 PDT 2024


dwblaikie wrote:

> libSupport is supposed to support this... but there's a specific carveout for targets that don't support constant initialization of mutexes. See https://reviews.llvm.org/D105959 / [402461b](https://github.com/llvm/llvm-project/commit/402461beb051b6a5c158f1e36d8e2c2b676e8804) / etc.
> 
> CC @joker-eph

oooh right... I remember that vaguely.

Though in this case it's a global /dtor/ hmm, nope, the carveout seems to do the right thing for that+mutexes.

SmartMutex has a recursive_mutex and unsigned member, so it should have the global ctor/dtor impact that recursive_mutex has, which is tested by the carveout @efriedma-quic linked... 

@schweitzpgi could you look into why that carveout isn't working for you?

https://github.com/llvm/llvm-project/pull/94699


More information about the llvm-commits mailing list