diff --git a/src/xenia/kernel/xam/xam_module.cc b/src/xenia/kernel/xam/xam_module.cc index 085e9d142..f02f5ee64 100644 --- a/src/xenia/kernel/xam/xam_module.cc +++ b/src/xenia/kernel/xam/xam_module.cc @@ -21,6 +21,17 @@ namespace xam { std::atomic xam_dialogs_shown_ = {0}; +// FixMe(RodoMa92): Same hack as main_init_posix.cc:40 +// Force initialization before constructor calling, mimicking +// Windows. +// Ref: +// https://reviews.llvm.org/D12689#243295 +#ifdef XE_PLATFORM_LINUX +__attribute__((init_priority(101))) +#endif +static std::vector + xam_exports(4096); + bool xeXamIsUIActive() { return xam_dialogs_shown_ > 0; } XamModule::XamModule(Emulator* emulator, KernelState* kernel_state) @@ -34,8 +45,6 @@ XamModule::XamModule(Emulator* emulator, KernelState* kernel_state) #undef XE_MODULE_EXPORT_GROUP } -std::vector xam_exports(4096); - xe::cpu::Export* RegisterExport_xam(xe::cpu::Export* export_entry) { assert_true(export_entry->ordinal < xam_exports.size()); xam_exports[export_entry->ordinal] = export_entry;