diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-03-28 11:20:11 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-03-28 11:20:11 +0000 |
| commit | a8c5168516fa9f33cc7374ef69ce7d2d45164246 (patch) | |
| tree | d499c7a6d8601a277ad805e36370c0939105995d /INSTALL.md | |
| parent | readme: dpi & fonts: focus on *current* behavior (diff) | |
| parent | meson: replace log+debug+xmalloc static libraries with a single ‘common’ library (diff) | |
Merge branch 'pgo-clang-11'
Closes #418
Diffstat (limited to 'INSTALL.md')
| -rw-r--r-- | INSTALL.md | 29 |
1 files changed, 18 insertions, 11 deletions
@@ -65,6 +65,7 @@ In addition to the dev variant of the packages above, you need: * wayland protocols * ncurses (needed to generate terminfo) * scdoc (for man page generation) +* llvm (for PGO builds with Clang) * [tllist](https://codeberg.org/dnkl/tllist) [^1] A note on compilers; in general, foot runs **much** faster when @@ -184,21 +185,15 @@ slower!) binary. First, configure the build directory: ```sh -export CFLAGS="$CFLAGS -O3 -Wno-missing-profile" +export CFLAGS="$CFLAGS -O3" meson --buildtype=release --prefix=/usr -Db_lto=true ../.. ``` It is **very** important `-O3` is being used here, as GCC-10.1.x and 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 \ - -Wno-ignored-optimization-argument \ - -Wno-profile-instr-out-of-date \ - -Wno-profile-instr-unprofiled" -``` +Clang users **must** add `-Wno-ignored-optimization-argument` to +`CFLAGS`. Then, tell meson we want to _generate_ profiling data, and build: @@ -234,6 +229,8 @@ We will use the `pgo` binary along with input corpus generated by `scripts/generate-alt-random-writes.py`: ```sh +./footclient --version +./foot --version tmp_file=$(mktemp) ../../scripts/generate-alt-random-writes \ --rows=67 \ @@ -253,7 +250,12 @@ tmp_file=$(mktemp) rm ${tmp_file} ``` -The snippet above first creates an (empty) temporary file. Then, it +The first step, running `./foot --version` and `./footclient +--version` might seem unnecessary, but is needed to ensure we have +_some_ profiling data for functions not covered by the PGO helper +binary. Without this, the final link phase will fail. + +The snippet above then creates an (empty) temporary file. Then, it runs a script that generates random escape sequences (if you cat `${tmp_file}` in a terminal, you’ll see random colored characters all over the screen). Finally, we feed the randomly generated escape @@ -271,14 +273,19 @@ This method requires a running Wayland session. We will use the script `scripts/generate-alt-random-writes.py`: ```sh +./footclient --version foot_tmp_file=$(mktemp) -./foot --config=/dev/null --term=xterm sh -c "<path-to-generate-alt-random-writes.py> --scroll --scroll-region --colors-regular --colors-bright --colors-256 --colors-rgb --attr-bold --attr-italic --attr-underline ${foot_tmp_file} && cat ${foot_tmp_file}" +./foot --config=/dev/null --term=xterm sh -c "<path-to-generate-alt-random-writes.py> --scroll --scroll-region --colors-regular --colors-bright --colors-256 --colors-rgb --attr-bold --attr-italic --attr-underline --sixel ${foot_tmp_file} && cat ${foot_tmp_file}" rm ${foot_tmp_file} ``` You should see a foot window open up, with random colored text. The window should close after ~1-2s. +The first step, `./footclient --version` might seem unnecessary, but +is needed to ensure we have _some_ profiling data for +`footclient`. Without this, the final link phase will fail. + ##### Use the generated PGO data |
