From ddaaf89c87e92f2bf64f340b3793610d5d54fae6 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 5 Sep 2024 12:58:35 +0300 Subject: [PATCH] BuildSystem: Make default libc a shared library --- CMakeLists.txt | 1 + userspace/libraries/LibC/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5c1201a..160643a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY True) set(CMAKE_STATIC_LIBRARY_PREFIX "") set(CMAKE_SHARED_LIBRARY_PREFIX "") +set(BUILD_SHARED_LIBS True) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") diff --git a/userspace/libraries/LibC/CMakeLists.txt b/userspace/libraries/LibC/CMakeLists.txt index 5f6fce7b..b1e15d35 100644 --- a/userspace/libraries/LibC/CMakeLists.txt +++ b/userspace/libraries/LibC/CMakeLists.txt @@ -85,7 +85,7 @@ install(TARGETS libc-shared OPTIONAL) set_target_properties(libc-static PROPERTIES OUTPUT_NAME libc) set_target_properties(libc-shared PROPERTIES OUTPUT_NAME libc) -add_library(libc ALIAS libc-static) +add_library(libc ALIAS libc-shared) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libgcc_s.so OUTPUT_VARIABLE LIBGCC_S_LINK OUTPUT_STRIP_TRAILING_WHITESPACE) file(REAL_PATH ${LIBGCC_S_LINK} LIBGCC_S)