From bb383a3760bb7581390195ad340d0a2b4cfe8758 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Mon, 11 Aug 2025 14:51:55 -0400 Subject: [PATCH] Add a note to not set -O0 with --enable-optimizations --- getting-started/setup-building.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/getting-started/setup-building.rst b/getting-started/setup-building.rst index 4bcf3f116..7e0fcae4e 100644 --- a/getting-started/setup-building.rst +++ b/getting-started/setup-building.rst @@ -281,6 +281,11 @@ and may be used to auto-enable Link Time Optimization (LTO) on some platforms. See :option:`python:--enable-optimizations` and :option:`python:--with-lto` to learn more about these options. +.. important:: + When using ``--enable-optimizations``, do not set ``CFLAGS=-O0`` or any other + flags that disable compiler optimizations. PGO requires optimizations to be + enabled to work properly. + .. code:: console $ ./configure --enable-optimizations --with-lto