Skip to content

Commit

Permalink
feat docs: add info about full static linkage
Browse files Browse the repository at this point in the history
------------------------
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: #830
commit_hash:a23328f49f3d0c1988faf9e01e16d509a5aea049
  • Loading branch information
root-kidik authored and fdr400 committed Jan 15, 2025
1 parent 13aeb58 commit b9b2278
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/docs/en/userver/build/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b9b2278

Please sign in to comment.