From 6988403d5917b61069dbff62ab1fefff9edce99f Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 20 Jan 2022 11:09:05 -0500 Subject: [PATCH] DynamicLoader+LibC+LibTimeZone: Include LibTimeZone sources in LibC LibTimeZone will be needed directly within LibC for functions such as localtime(). This change adds LibTimeZone directly within LibC, so that LibTimeZone isn't its own .so library anymore. LibTimeZone itself is compiled as an object library to make it easier to give it generator-specific compilation flags. --- Userland/DynamicLoader/CMakeLists.txt | 1 + Userland/Libraries/LibC/CMakeLists.txt | 4 ++-- Userland/Libraries/LibTimeZone/CMakeLists.txt | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/DynamicLoader/CMakeLists.txt b/Userland/DynamicLoader/CMakeLists.txt index 8fef87b03e..50953797b4 100644 --- a/Userland/DynamicLoader/CMakeLists.txt +++ b/Userland/DynamicLoader/CMakeLists.txt @@ -45,5 +45,6 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$") target_link_libraries(Loader.so PRIVATE clang_rt.builtins) endif () +target_link_libraries(Loader.so PRIVATE LibTimeZone) target_link_options(Loader.so PRIVATE LINKER:--no-dynamic-linker) install(TARGETS Loader.so RUNTIME DESTINATION usr/lib/) diff --git a/Userland/Libraries/LibC/CMakeLists.txt b/Userland/Libraries/LibC/CMakeLists.txt index d388825d15..f463e977ad 100644 --- a/Userland/Libraries/LibC/CMakeLists.txt +++ b/Userland/Libraries/LibC/CMakeLists.txt @@ -130,7 +130,7 @@ set(SOURCES ${LIBC_SOURCES} ${AK_SOURCES} ${ELF_SOURCES} ${ASM_SOURCES}) set_source_files_properties(stdio.cpp PROPERTIES COMPILE_FLAGS "-fno-builtin-fputc -fno-builtin-fputs -fno-builtin-fwrite") add_library(LibCStaticWithoutDeps STATIC ${SOURCES}) -target_link_libraries(LibCStaticWithoutDeps ssp) +target_link_libraries(LibCStaticWithoutDeps ssp LibTimeZone) add_dependencies(LibCStaticWithoutDeps LibM LibSystem LibUBSanitizer) add_custom_target(LibCStatic @@ -154,7 +154,7 @@ set_property( set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nolibc") serenity_libc(LibC c) add_dependencies(LibC crti crt0 crt0_shared crtn) -target_link_libraries(LibC ssp system) +target_link_libraries(LibC ssp system LibTimeZone) # We mark LibCStatic as a dependency of LibC because this triggers the build of the LibCStatic target add_dependencies(LibC LibM LibSystem LibCStatic) diff --git a/Userland/Libraries/LibTimeZone/CMakeLists.txt b/Userland/Libraries/LibTimeZone/CMakeLists.txt index 218f0217f1..2b2dd4b43d 100644 --- a/Userland/Libraries/LibTimeZone/CMakeLists.txt +++ b/Userland/Libraries/LibTimeZone/CMakeLists.txt @@ -5,6 +5,5 @@ set(SOURCES ${TIME_ZONE_DATA_SOURCES} ) -serenity_lib(LibTimeZone timezone) -target_link_libraries(LibTimeZone LibCore) +add_library(LibTimeZone OBJECT ${SOURCES}) target_compile_definitions(LibTimeZone PRIVATE ENABLE_TIME_ZONE_DATA=$)