aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-12-21 12:01:38 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-12-21 12:02:58 +0000
commit6a03567490d90a28363e2093a416e350b1a3ce89 (patch)
tree625a4dca1afe8e8ec6fc416c937d8c07853fc758
parentinstall.md: mention that packagers should not use -march=native (diff)
install: remove -march=native
This simplifies the instructions. People interested in performance are likely to know how to use it.
-rw-r--r--INSTALL.md12
1 files changed, 4 insertions, 8 deletions
diff --git a/INSTALL.md b/INSTALL.md
index 4bfef825..d553544f 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -157,17 +157,13 @@ optimization.
In addition to being faster, PGO builds also tend to be smaller than
regular `-O3` builds.
-**Note**: if you are packaging foot, you should probably remove
-`-march=native`, as that may cause gcc/clang to emit instructions that
-may not be available on other computers.
-
#### Size optimized
To optimize for size (i.e. produce a small binary):
```sh
-export CFLAGS="$CFLAGS -Os -march=native"
+export CFLAGS="$CFLAGS -Os"
meson --buildtype=release --prefix=/usr -Db_lto=true ../..
ninja
ninja test
@@ -179,7 +175,7 @@ ninja install
To do a regular, non-PGO build optimized for performance:
```sh
-export CFLAGS="$CFLAGS -O3 -march=native"
+export CFLAGS="$CFLAGS -O3"
meson --buildtype=release --prefix=/usr -Db_lto=true ../..
ninja
ninja test
@@ -195,7 +191,7 @@ slower!) binary.
First, configure the build directory:
```sh
-export CFLAGS="$CFLAGS -O3 -march=native -Wno-missing-profile"
+export CFLAGS="$CFLAGS -O3 -Wno-missing-profile"
meson --buildtype=release --prefix=/usr -Db_lto=true ../..
```
@@ -205,7 +201,7 @@ later have a regression where PGO with `-O2` is **much** slower.
If you are using Clang instead of GCC, use the following `CFLAGS` instead:
```sh
-export CFLAGS="$CFLAGS -O3 -march=native \
+export CFLAGS="$CFLAGS -O3 \
-Wno-ignored-optimization-argument \
-Wno-profile-instr-out-of-date \
-Wno-profile-instr-unprofiled"