Skip to content

Commit e6ad599

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 <mkoeppe@math.ucdavis.edu>
1 parent 96254a9 commit e6ad599

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
@@ -748,6 +748,17 @@ Compiler flags
748748
extensions. Use it when a compiler flag should *not* be part of the
749749
distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`).
750750

751+
In particular, :envvar:`CFLAGS` should not contain:
752+
753+
* the compiler flag `-I` (for setting the search path for include files).
754+
The `-I` flags are processed from left to right, and any flags in
755+
:envvar:`CFLAGS` would take precedence over user- and package-supplied `-I`
756+
flags.
757+
758+
* hardening flags such as `-Werror` because distributions cannot control
759+
whether packages installed by users conform to such heightened
760+
standards.
761+
751762
.. versionadded:: 3.5
752763

753764
.. envvar:: EXTRA_CFLAGS
@@ -860,6 +871,13 @@ Linker flags
860871
:envvar:`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of
861872
the distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`).
862873

874+
In particular, :envvar:`LDFLAGS` should not contain:
875+
876+
* the compiler flag `-L` (for setting the search path for libraries).
877+
The `-L` flags are processed from left to right, and any flags in
878+
:envvar:`LDFLAGS` would take precedence over user- and package-supplied `-L`
879+
flags.
880+
863881
.. envvar:: CONFIGURE_LDFLAGS_NODIST
864882

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

0 commit comments

Comments
 (0)