Skip to content

Commit 61f24e7

Browse files
authored
gh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (#92754)
1 parent ab0e601 commit 61f24e7

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

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

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

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

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

0 commit comments

Comments
 (0)