From 1a4f6b506e9ffbea92fd3dc3b9ce2829b7a96831 Mon Sep 17 00:00:00 2001 From: PyYoshi Date: Wed, 10 Jan 2018 01:11:21 +0900 Subject: [PATCH] enable LTO for wheel builds (cherry picked from commit 7b3633601f56b8eb1ef332afc10b2f70a3287de7) --- CHANGES.rst | 7 +++++++ Makefile | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index fec41ad..f4289c4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,13 @@ CHANGES ======= +2.1.x +----- + +- enable `LTO`_ for wheel builds + +.. _LTO: https://gcc.gnu.org/wiki/LinkTimeOptimization + 2.1.1 (2017-07-01) ------------------ diff --git a/Makefile b/Makefile index e695467..710d451 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,17 @@ install: clean build-manylinux1-wheel: docker pull quay.io/pypa/manylinux1_i686 docker pull quay.io/pypa/manylinux1_x86_64 - docker run --rm -ti -v `pwd`:/project -w /project quay.io/pypa/manylinux1_i686 bash dockerfiles/buildwheel.sh - docker run --rm -ti -v `pwd`:/project -w /project quay.io/pypa/manylinux1_x86_64 bash dockerfiles/buildwheel.sh + docker run --rm -ti -v `pwd`:/project \ + -e CFLAGS="-mtune=generic -pipe -fPIC -flto" \ + -e LDFLAGS="$(LDFLAGS) -flto" \ + -w /project \ + quay.io/pypa/manylinux1_i686 \ + bash dockerfiles/buildwheel.sh + docker run --rm -ti -v `pwd`:/project \ + -e CFLAGS="-mtune=generic -pipe -fPIC -flto" \ + -e LDFLAGS="$(LDFLAGS) -flto" \ + -w /project \ + quay.io/pypa/manylinux1_x86_64 \ + bash dockerfiles/buildwheel.sh build: clean pip test sdist build-manylinux1-wheel