1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 12:38:14 +00:00

UE: Make sure signal_trampoline_dummy is not optimized away with -flto

This adds __attribute__((used)) to the function declaration so the
compiler doesn't discard it. It also makes the function NEVER_INLINE
so that we don't end up with multiple copies of the function. This
is necessary because the function uses inline assembly to define some
unique labels.
This commit is contained in:
Gunnar Beutner 2021-05-28 06:59:51 +02:00 committed by Andreas Kling
parent ffaf27e4b6
commit 1f57cc5957

View file

@ -445,8 +445,8 @@ void Emulator::dispatch_one_pending_signal()
}
// Make sure the compiler doesn't "optimize away" this function:
extern void signal_trampoline_dummy();
void signal_trampoline_dummy()
static void signal_trampoline_dummy() __attribute__((used));
NEVER_INLINE void signal_trampoline_dummy()
{
// The trampoline preserves the current eax, pushes the signal code and
// then calls the signal handler. We do this because, when interrupting a