This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author octavian.soldea
Recipients octavian.soldea
Date 2017-09-05.21:54:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504648453.31.0.715065413662.issue31354@psf.upfronthosting.co.za>
In-reply-to
Content
Hi All,

This is Octavian Soldea from the Scripting Languages Optimization team at Intel Corporation. I would like to submit a patch to fix an LTO build issue. With "./configure --with-lto" followed by "make", CPython should be built with LTO or Link-Time-Optimization. However, currently, no impact is made to the build process, meaning the flag is not effective. This patch has been created out of a python-dev discussion thread: http://www.mail-archive.com/python-dev@python.org/msg96469.html. The LTO flag was originally introduced by my team member Alecsandru Patrascu back in 2015: https://bugs.python.org/issue25702.

Before the change:

./configure --with-lto
make
gcc command line output example:
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/ceval.o Python/ceval.c
Note no "lto" flag was present. This is the same result as the default build without the LTO flag.

After changes:

./configure --with-lto
make
expected gcc command line output example =>
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/ceval.o Python/ceval.c

Thanks,
Octavian
History
Date User Action Args
2017-09-05 21:54:13octavian.soldeasetrecipients: + octavian.soldea
2017-09-05 21:54:13octavian.soldeasetmessageid: <1504648453.31.0.715065413662.issue31354@psf.upfronthosting.co.za>
2017-09-05 21:54:13octavian.soldealinkissue31354 messages
2017-09-05 21:54:13octavian.soldeacreate