Skip to content

Commit

Permalink
DynamicLoader: Disable stack protector in some files for RISC-V
Browse files Browse the repository at this point in the history
  • Loading branch information
spholz authored and BertalanD committed Mar 4, 2024
1 parent 872bf51 commit c20bc22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Userland/DynamicLoader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ set(SOURCES ${LOADER_SOURCES} ${AK_SOURCES} ${ELF_SOURCES} ${LIBC_SOURCES1} ${LI

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -nostdlib -pie -fpie -DNO_TLS")

if ("${SERENITY_ARCH}" STREQUAL "aarch64")
# On aarch64 the stack protector would be accessed before the Loader can relocate itself.
if (("${SERENITY_ARCH}" STREQUAL "aarch64") OR ("${SERENITY_ARCH}" STREQUAL "riscv64"))
# On aarch64 and riscv64 the stack protector would be accessed before the Loader can relocate itself.
set_source_files_properties(main.cpp ../Libraries/LibELF/Relocation.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
endif()

Expand Down

0 comments on commit c20bc22

Please sign in to comment.