File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,6 +256,14 @@ Optimizations
256256 It is about 36% faster now. (Contributed by Pablo Galindo and Yury Selivanov
257257 in :issue: `42093 `.)
258258
259+ * When building Python with ``--enable-optimizations `` now
260+ ``-fno-semantic-interposition `` is added to both the compile and link line.
261+ This speeds builds of the Python interpreter created with ``--enable-shared ``
262+ with ``gcc `` by up to 30%. See `this article
263+ <https://developers.redhat.com/blog/2020/06/25/red-hat-enterprise-linux-8-2-brings-faster-python-3-8-run-speeds/> `_
264+ for more details. (Contributed by Victor Stinner and Pablo Galindo in
265+ :issue: `38980 `)
266+
259267Deprecated
260268==========
261269
Original file line number Diff line number Diff line change 1+ Add ``-fno-semantic-interposition `` to both the compile and link line when
2+ building with ``--enable-optimizations ``. Patch by Victor Stinner and Pablo
3+ Galindo.
Original file line number Diff line number Diff line change @@ -6482,6 +6482,14 @@ if test "$Py_OPT" = 'true' ; then
64826482 DEF_MAKE_ALL_RULE="profile-opt"
64836483 REQUIRE_PGO="yes"
64846484 DEF_MAKE_RULE="build_all"
6485+ case $CC in
6486+ *gcc*)
6487+ CFLAGS_NODIST="$CFLAGS_NODIST -fno-semantic-interposition"
6488+ LDFLAGS_NODIST="$LDFLAGS_NODIST -fno-semantic-interposition"
6489+ ;;
6490+ esac
6491+
6492+
64856493else
64866494 DEF_MAKE_ALL_RULE="build_all"
64876495 REQUIRE_PGO="no"
Original file line number Diff line number Diff line change @@ -1318,6 +1318,14 @@ if test "$Py_OPT" = 'true' ; then
13181318 DEF_MAKE_ALL_RULE="profile-opt"
13191319 REQUIRE_PGO="yes"
13201320 DEF_MAKE_RULE="build_all"
1321+ case $CC in
1322+ *gcc*)
1323+ CFLAGS_NODIST="$CFLAGS_NODIST -fno-semantic-interposition"
1324+ LDFLAGS_NODIST="$LDFLAGS_NODIST -fno-semantic-interposition"
1325+ ;;
1326+ esac
1327+
1328+
13211329else
13221330 DEF_MAKE_ALL_RULE="build_all"
13231331 REQUIRE_PGO="no"
You can’t perform that action at this time.
0 commit comments