1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:07:35 +00:00

LibC+LibPthread: Implement function forwarding for libpthread

GCC will insert various calls to pthread functions when compiling
C++ code with static initializers, even when the user doesn't link
their program against libpthread explicitly.

This is used to make static initializers thread-safe, e.g. when
building a library that does not itself use thread functionality
and thus does not link against libpthread - but is intended to
be used with other code that does use libpthread explicitly.

This makes these symbols available in libc.
This commit is contained in:
Gunnar Beutner 2021-04-17 18:38:32 +02:00 committed by Andreas Kling
parent db3fd11646
commit 88cebb05ad
14 changed files with 381 additions and 100 deletions

View file

@ -19,8 +19,7 @@ endif()
file(GLOB LIBSYSTEM_SOURCES "../Libraries/LibSystem/*.cpp")
list(FILTER LIBC_SOURCES1 EXCLUDE REGEX ".+crt0.cpp")
list(FILTER LIBC_SOURCES1 EXCLUDE REGEX ".+crt0.+.cpp")
add_definitions(-D_DYNAMIC_LOADER)
set(SOURCES ${LOADER_SOURCES} ${AK_SOURCES} ${ELF_SOURCES} ${LIBC_SOURCES1} ${LIBC_SOURCES2} ${LIBC_SOURCES3} ${LIBSYSTEM_SOURCES})