diff --git a/README.md b/README.md index 8c02b2d09..8f305848c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/config.nims b/config.nims index 9d5caab4a..a7ff6468c 100644 --- a/config.nims +++ b/config.nims @@ -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")