LibSystem: Disable stack protector in syscall wrappers on i686

This is a hack to avoid a circular dependency issue with the stack check
failure handler being in LibC.

This is not ideal, and there's most likely a better way to solve this.

That said, LibSystem should not have anything but thin wrappers around
system calls, so stack protectors have limited utility here anyway.
This commit is contained in:
Andreas Kling 2021-11-22 19:18:34 +01:00
parent dc486fa3f9
commit 317ceb0ee2
Notes: sideshowbarker 2024-07-18 00:52:52 +09:00

View File

@ -3,6 +3,11 @@ set(SOURCES
syscall.cpp
)
# FIXME: This is a hack to avoid a circular dependency with LibC. Figure out a better way.
if ("${SERENITY_ARCH}" STREQUAL "i686")
set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib")
serenity_libc(LibSystem system)
target_include_directories(LibSystem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})