diff options
| author | snowstormxd <214507868+snowstormxd@users.noreply.github.com> | 2026-11-02 19:31:11 +0000 |
|---|---|---|
| committer | snowstormxd <214507868+snowstormxd@users.noreply.github.com> | 2026-11-02 19:31:11 +0000 |
| commit | 43490c0417f6ef07a5999c2f8cf1c18e4e4a8520 (patch) | |
| tree | 3927e4a42b97a969e52c14d3d1f1e3c4ed581ee2 /src/core | |
| parent | ab6b36d6241a135fe2750161993a26a8804c7a7b (diff) | |
kernel: define thread-local state out of line for LTO
Give the implementation-local TLS object one definition so ThinLTO retains its dynamic initializer. The state and its lifetime are unchanged.
Assisted by Codex.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index f006d129a7..9e6ccc2d89 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -79,7 +79,7 @@ struct KernelCore::Impl { // And we have the guarantee that the data won't move out of the way so we can safely // take a reference to it. This isn't always universally true but this is "global" data // so it will be statically given a TLS slot anyways. - static inline thread_local ThreadLocalData tls_data = {}; + static thread_local ThreadLocalData tls_data; explicit Impl(Core::System& system_, KernelCore& kernel_) : system{system_} { tls_data.lock = true; @@ -861,6 +861,8 @@ struct KernelCore::Impl { Core::System& system; }; +thread_local ThreadLocalData KernelCore::Impl::tls_data{}; + KernelCore::KernelCore(Core::System& system) : impl{std::make_unique<Impl>(system, *this)} {} KernelCore::~KernelCore() = default; |
