mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2026-04-27 20:21:40 +00:00
Declare header extern functions as weak on macOS.
Fixes crashes on x86_64 builds with LTO enabled.
This commit is contained in:
parent
0bf1fd5477
commit
e035216a98
1 changed files with 6 additions and 1 deletions
|
|
@ -26,8 +26,13 @@
|
|||
#define PPC_STRINGIFY(x) PPC_XSTRINGIFY(x)
|
||||
#define PPC_FUNC(x) void x(PPCContext& __restrict ctx, uint8_t* base)
|
||||
#define PPC_FUNC_IMPL(x) extern "C" PPC_FUNC(x)
|
||||
#define PPC_EXTERN_FUNC(x) extern PPC_FUNC(x)
|
||||
#define PPC_WEAK_FUNC(x) __attribute__((weak,noinline)) PPC_FUNC(x)
|
||||
#ifdef __APPLE__
|
||||
// Declare header declaration as weak as well to make sure LTO is correct.
|
||||
#define PPC_EXTERN_FUNC(x) extern PPC_WEAK_FUNC(x)
|
||||
#else
|
||||
#define PPC_EXTERN_FUNC(x) extern PPC_FUNC(x)
|
||||
#endif
|
||||
|
||||
#define PPC_FUNC_PROLOGUE() __builtin_assume(((size_t)base & 0xFFFFFFFF) == 0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue