summaryrefslogtreecommitdiff
path: root/Kernel/init.cpp
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-04-29 14:54:15 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-29 20:26:36 +0200
commit55ae52fdf81cdcc7d1bf7b883953e2639701d21b (patch)
treea0ec01f87b49f3261b5fe00344d5cc72615231cc /Kernel/init.cpp
parentb8612590984ee39d519ebf45f80e051b6f0d75bf (diff)
downloadserenity-55ae52fdf81cdcc7d1bf7b883953e2639701d21b.zip
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.
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r--Kernel/init.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp
index 9e4be4b1ca..1918aa1dc8 100644
--- a/Kernel/init.cpp
+++ b/Kernel/init.cpp
@@ -71,7 +71,7 @@ extern "C" u8* end_of_safemem_text;
extern "C" u8* start_of_safemem_atomic_text;
extern "C" u8* end_of_safemem_atomic_text;
-extern "C" FlatPtr end_of_kernel_image;
+extern "C" u8* end_of_kernel_image;
multiboot_module_entry_t multiboot_copy_boot_modules_array[16];
size_t multiboot_copy_boot_modules_count;
@@ -85,7 +85,7 @@ static void setup_serial_debug();
// boot.S expects these functions to exactly have the following signatures.
// We declare them here to ensure their signatures don't accidentally change.
-extern "C" void init_finished(u32 cpu);
+extern "C" void init_finished(u32 cpu) __attribute__((used));
extern "C" [[noreturn]] void init_ap(u32 cpu, Processor* processor_info);
extern "C" [[noreturn]] void init();