diff options
author | Tomohiro <gpuppur@gmail.com> | 2024-01-19 05:25:31 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 21:25:31 +0100 |
commit | 527d1e197731803c4c03b15b6ac0ba2d461eb7f3 (patch) | |
tree | acbdb932fba6a3a66a78321c00b6b2def508a2d4 /doc | |
parent | cfd69bad1a1071345cfcd145a7e7f906304f265f (diff) | |
download | Nim-527d1e197731803c4c03b15b6ac0ba2d461eb7f3.tar.gz |
Nim Compiler User Guide: Add explanations about lto and strip (#23227)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/nimc.md | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/nimc.md b/doc/nimc.md index 08bd016e1..1136bef09 100644 --- a/doc/nimc.md +++ b/doc/nimc.md @@ -552,6 +552,13 @@ Define Effect `globalSymbols` Load all `{.dynlib.}` libraries with the `RTLD_GLOBAL`:c: flag on Posix systems to resolve symbols in subsequently loaded libraries. +`lto` Enable link-time optimization in the backend compiler and + linker. +`lto_incremental` Enable link-time optimization and additionally enable + incremental linking for compilers that support it. + Currently only clang and vcc. +`strip` Strip debug symbols added by the backend compiler from + the executable. ====================== ========================================================= @@ -677,11 +684,11 @@ additional flags to both the Nim compiler and the C compiler and/or linker to optimize the build for size. For example, the following flags can be used when targeting a gcc compiler: -`--opt:size --passC:-flto --passL:-flto`:option: +`--opt:size -d:lto -d:strip`:option: The `--opt:size`:option: flag instructs Nim to optimize code generation for small -size (with the help of the C compiler), the `-flto`:option: flags enable link-time -optimization in the compiler and linker. +size (with the help of the C compiler), the `-d:lto`:option: flags enable link-time +optimization in the compiler and linker, the `-d:strip`:option: strips debug symbols. Check the [Cross-compilation] section for instructions on how to compile the program for your target. |