1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:08:12 +00:00

Kernel: Enable building the kernel with -flto

GCC with -flto is more aggressive when it comes to inlining and
discarding functions which is why we must mark some of the functions
as NEVER_INLINE (because they contain asm labels which would be
duplicated in the object files if the compiler decides to inline
the function elsewhere) and __attribute__((used)) for others so
that GCC doesn't discard them.
This commit is contained in:
Gunnar Beutner 2021-04-29 14:54:15 +02:00 committed by Andreas Kling
parent b861259098
commit 55ae52fdf8
9 changed files with 57 additions and 57 deletions

View file

@ -359,8 +359,8 @@ void free(void* p)
// Functions that are automatically called by the C++ compiler.
// Declare them first, to tell the silly compiler that they are indeed being used.
[[noreturn]] void __stack_chk_fail();
[[noreturn]] void __stack_chk_fail_local();
[[noreturn]] void __stack_chk_fail() __attribute__((used));
[[noreturn]] void __stack_chk_fail_local() __attribute__((used));
extern "C" int __cxa_atexit(void (*)(void*), void*, void*);
[[noreturn]] void __cxa_pure_virtual();