mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
Kernel: Set kernel stack alignment to 8-bytes
This is already assumed by most of the assembly in the kernel, setting this is just making it explicit (and may save some stack).
This commit is contained in:
parent
130ec7e5b4
commit
063efe9cf8
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/063efe9cf8 Pull-request: https://github.com/SerenityOS/serenity/pull/19412 Reviewed-by: https://github.com/Hendiadyoin1 ✅ Reviewed-by: https://github.com/gmta ✅
|
@ -700,10 +700,15 @@ if (NOT "${SERENITY_ARCH}" STREQUAL "aarch64")
|
|||
COMMENT "Preprocessing linker.ld"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_target(generate_kernel_linker_script DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/linker.ld)
|
||||
target_link_options(Kernel PRIVATE LINKER:-T ${CMAKE_CURRENT_BINARY_DIR}/linker.ld -nostdlib -nodefaultlibs)
|
||||
set_target_properties(Kernel PROPERTIES LINK_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/linker.ld")
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(Kernel PRIVATE -mpreferred-stack-boundary=3)
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
|
||||
target_compile_options(Kernel PRIVATE -mstack-alignment=8)
|
||||
endif()
|
||||
else()
|
||||
target_link_options(Kernel PRIVATE LINKER:-T ${CMAKE_CURRENT_SOURCE_DIR}/Arch/aarch64/linker.ld -nostdlib LINKER:--no-pie)
|
||||
set_target_properties(Kernel PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Arch/aarch64/linker.ld)
|
||||
|
|
Loading…
Reference in a new issue