mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
DynamicLoader: Disable stack protector in some files for aarch64 build
The code would access the __stack_chk_guard variable in main.cpp and LibELF/Relocation.cpp before the loader was able to relocate itself, so this commit disable the stack protector for the aarch64 build to make sure that no accesses to __stack_chk_guard are inserted.
This commit is contained in:
parent
ecc321e099
commit
b2e223d2bc
Notes:
sideshowbarker
2024-07-17 07:31:31 +09:00
Author: https://github.com/FireFox317
Commit: b2e223d2bc
Pull-request: https://github.com/SerenityOS/serenity/pull/17258
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/nico ✅
1 changed files with 5 additions and 0 deletions
|
@ -30,6 +30,11 @@ set(SOURCES ${LOADER_SOURCES} ${AK_SOURCES} ${ELF_SOURCES} ${LIBC_SOURCES1} ${LI
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -nostdlib -pie -fpic -DNO_TLS")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -nostdlib -pie -fpic -DNO_TLS")
|
||||||
|
|
||||||
|
if ("${SERENITY_ARCH}" STREQUAL "aarch64")
|
||||||
|
# On aarch64 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()
|
||||||
|
|
||||||
set_source_files_properties(../Libraries/LibC/ssp.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
|
set_source_files_properties(../Libraries/LibC/ssp.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
|
||||||
set_source_files_properties(../Libraries/LibC/ssp_nonshared.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
|
set_source_files_properties(../Libraries/LibC/ssp_nonshared.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
|
||||||
# Prevent GCC from removing null checks by marking the `FILE*` argument non-null
|
# Prevent GCC from removing null checks by marking the `FILE*` argument non-null
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue