mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-27 21:21:50 +03:00
Everywhere: Make some symbols __attribute__((used))
for LTO
With these changes, the userland builds correctly with Clang's ThinLTO enabled.
This commit is contained in:
parent
1faffc2192
commit
a8fefd89cd
Notes:
sideshowbarker
2024-07-18 02:14:35 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/a8fefd89cd2 Pull-request: https://github.com/SerenityOS/serenity/pull/9378 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/itamar8910 Reviewed-by: https://github.com/linusg ✅ Reviewed-by: https://github.com/nico Reviewed-by: https://github.com/timschumi
@ -16,7 +16,7 @@
|
||||
|
||||
// Defined in the linker script
|
||||
extern size_t __stack_chk_guard;
|
||||
size_t __stack_chk_guard;
|
||||
size_t __stack_chk_guard __attribute__((used));
|
||||
extern "C" [[noreturn]] void __stack_chk_fail();
|
||||
|
||||
extern "C" u8 start_of_prekernel_image[];
|
||||
|
@ -69,7 +69,7 @@ extern ctor_func_t start_ctors[];
|
||||
extern ctor_func_t end_ctors[];
|
||||
|
||||
extern size_t __stack_chk_guard;
|
||||
READONLY_AFTER_INIT size_t __stack_chk_guard;
|
||||
READONLY_AFTER_INIT size_t __stack_chk_guard __attribute__((used));
|
||||
|
||||
extern "C" u8 start_of_safemem_text[];
|
||||
extern "C" u8 end_of_safemem_text[];
|
||||
|
@ -57,8 +57,8 @@ this helper program directly.
|
||||
extern "C" {
|
||||
|
||||
// The compiler expects a previous declaration
|
||||
void _start(int, char**, char**);
|
||||
void _entry(int, char**, char**);
|
||||
void _start(int, char**, char**) __attribute__((used));
|
||||
void _entry(int, char**, char**) __attribute__((used));
|
||||
|
||||
NAKED void _start(int, char**, char**)
|
||||
{
|
||||
|
@ -19,8 +19,8 @@ extern size_t __stack_chk_guard;
|
||||
int main(int, char**, char**);
|
||||
|
||||
// Tell the compiler that this may be called from somewhere else.
|
||||
int _entry(int argc, char** argv, char** env);
|
||||
void _start(int, char**, char**);
|
||||
int _entry(int argc, char** argv, char** env) __attribute__((used));
|
||||
void _start(int, char**, char**) __attribute__((used));
|
||||
|
||||
NAKED void _start(int, char**, char**)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@
|
||||
extern "C" {
|
||||
|
||||
extern size_t __stack_chk_guard;
|
||||
size_t __stack_chk_guard = (size_t)0xc6c7c8c9;
|
||||
__attribute__((used)) size_t __stack_chk_guard = (size_t)0xc6c7c8c9;
|
||||
|
||||
__attribute__((noreturn)) void __stack_chk_fail()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user