Nim define for disabling LTO (#1751)

This commit is contained in:
Ștefan Talpalaru 2020-09-25 18:15:02 +02:00 committed by GitHub
parent feece1382d
commit fffecbc8fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -465,6 +465,18 @@ make -j$(nproc) NIMFLAGS="-d:release" USE_MULTITAIL=yes eth2_network_simulation
make USE_LIBBACKTRACE=0 # expect the resulting binaries to be 2-3 times slower
```
- disable `-march=native` because you want to run the binary on a different machine than the one you're building it on:
```bash
make NIMFLAGS="-d:disableMarchNative" beacon_node
```
- disable link-time optimisation (LTO):
```bash
make NIMFLAGS="-d:disableLTO" beacon_node
```
- publish a book using [mdBook](https://github.com/rust-lang/mdBook) from sources in "docs/" to GitHub pages:
```bash

View File

@ -14,7 +14,7 @@ else:
# `-flto` gives a significant improvement in processing speed, specially hash tree and state transition (basically any CPU-bound code implemented in nim)
# With LTO enabled, optimization flags should be passed to both compiler and linker!
if defined(release):
if defined(release) and not defined(disableLTO):
if defined(macosx): # Clang
switch("passC", "-flto=thin")
switch("passL", "-flto=thin")