From b9b22781d31725cfd5ea6384b742b56f9c75f606 Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 15 Jan 2025 19:42:23 +0300 Subject: [PATCH] feat docs: add info about full static linkage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------------------ Note: by creating a PR or an issue you automatically agree to the CLA. See [CONTRIBUTING.md](https://github.com/userver-framework/userver/blob/develop/CONTRIBUTING.md). Feel free to remove this note, the agreement holds. Tests: протестировано CI Pull Request resolved: https://github.com/userver-framework/userver/pull/830 commit_hash:a23328f49f3d0c1988faf9e01e16d509a5aea049 --- scripts/docs/en/userver/build/options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docs/en/userver/build/options.md b/scripts/docs/en/userver/build/options.md index a88e8020d49a..1f4d19e4e720 100644 --- a/scripts/docs/en/userver/build/options.md +++ b/scripts/docs/en/userver/build/options.md @@ -183,7 +183,7 @@ Userver does not build dynamic libraries itself, but most of its dependencies do - Use `USERVER_USE_STATIC_LIBS=ON` CMake option to prefer static libraries for all userver dependencies (ON by default for "sufficiently new" `Clang` versions). With the option, CMake tries to find all dependencies as static libraries (and dependencies of dependencies), fallbacks to dynamic libraries when no static found. - To link statically with `libstdc++` or `libc++`, use `CMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -static-libgcc"`. -- To force fully static binary (with statically linked `libc`), use `CMAKE_EXE_LINKER_FLAGS="-static"`. In such case, all dependencies must be provided as static libraries. +- To force fully static binary (with statically linked `libc`), use `CMAKE_EXE_LINKER_FLAGS="-static"`. In such case, all dependencies must be provided as static libraries. Also `userver` must be build with `USERVER_DISABLE_PHDR_CACHE=ON` (without this flag, it can lead to endless memory allocation). Some dependecies usually should be build from source for statically linked executable: 1. `Curl`. Use `USERVER_FORCE_DOWNLOAD_CURL=ON` to download and build Curl from source.