Skip to content

Commit 2454dbe

Browse files
gh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (GH-92754)
(cherry picked from commit 61f24e7) Co-authored-by: Matthias Köppe <[email protected]>
1 parent 9d73adf commit 2454dbe

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Doc/using/configure.rst

+18
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,17 @@ Compiler flags
652652
extensions. Use it when a compiler flag should *not* be part of the
653653
distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`).
654654

655+
In particular, :envvar:`CFLAGS` should not contain:
656+
657+
* the compiler flag `-I` (for setting the search path for include files).
658+
The `-I` flags are processed from left to right, and any flags in
659+
:envvar:`CFLAGS` would take precedence over user- and package-supplied `-I`
660+
flags.
661+
662+
* hardening flags such as `-Werror` because distributions cannot control
663+
whether packages installed by users conform to such heightened
664+
standards.
665+
655666
.. versionadded:: 3.5
656667

657668
.. envvar:: EXTRA_CFLAGS
@@ -764,6 +775,13 @@ Linker flags
764775
:envvar:`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of
765776
the distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`).
766777

778+
In particular, :envvar:`LDFLAGS` should not contain:
779+
780+
* the compiler flag `-L` (for setting the search path for libraries).
781+
The `-L` flags are processed from left to right, and any flags in
782+
:envvar:`LDFLAGS` would take precedence over user- and package-supplied `-L`
783+
flags.
784+
767785
.. envvar:: CONFIGURE_LDFLAGS_NODIST
768786

769787
Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure``

0 commit comments

Comments
 (0)