Skip to content

Commit 317ceb0

Browse files
committed
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.
1 parent dc486fa commit 317ceb0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Userland/Libraries/LibSystem/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ set(SOURCES
33
syscall.cpp
44
)
55

6+
# FIXME: This is a hack to avoid a circular dependency with LibC. Figure out a better way.
7+
if ("${SERENITY_ARCH}" STREQUAL "i686")
8+
set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
9+
endif()
10+
611
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib")
712
serenity_libc(LibSystem system)
813
target_include_directories(LibSystem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

0 commit comments

Comments
 (0)