mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:07:45 +00:00
Kernel/riscv64: Explicitly discard temporary local symbols
This is for some reason needed for riscv64 clang, as otherwise the kernel.map file would grow too big to fit in its section inside the kernel image. None of our other architectures have temporary locals in their kernel.map.
This commit is contained in:
parent
da33e2a564
commit
dfce2f6341
1 changed files with 4 additions and 1 deletions
|
@ -759,7 +759,10 @@ if("${SERENITY_ARCH}" STREQUAL "aarch64")
|
||||||
target_link_options(Kernel PRIVATE LINKER:-T ${CMAKE_CURRENT_SOURCE_DIR}/Arch/aarch64/linker.ld -nostdlib LINKER:--no-pie)
|
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)
|
set_target_properties(Kernel PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Arch/aarch64/linker.ld)
|
||||||
elseif("${SERENITY_ARCH}" STREQUAL "riscv64")
|
elseif("${SERENITY_ARCH}" STREQUAL "riscv64")
|
||||||
target_link_options(Kernel PRIVATE LINKER:-T ${CMAKE_CURRENT_SOURCE_DIR}/Arch/riscv64/linker.ld -nostdlib LINKER:--no-pie)
|
# The final kernel binary for some reason includes temporary local symbols on riscv64 clang, which causes kernel.map to be too big to fit in its section in the kernel.
|
||||||
|
# Explicitly pass -X to the linker to remove them.
|
||||||
|
target_link_options(Kernel PRIVATE LINKER:-T ${CMAKE_CURRENT_SOURCE_DIR}/Arch/riscv64/linker.ld -nostdlib LINKER:--no-pie LINKER:-X)
|
||||||
|
|
||||||
set_target_properties(Kernel PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Arch/riscv64/linker.ld)
|
set_target_properties(Kernel PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Arch/riscv64/linker.ld)
|
||||||
elseif ("${SERENITY_ARCH}" STREQUAL "x86_64")
|
elseif ("${SERENITY_ARCH}" STREQUAL "x86_64")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue