From 1fa00a056ed865ae4dafd4fa0f2a095be65264ed Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Mon, 18 Oct 2021 21:22:22 -0700 Subject: [PATCH] Fix #501: add --with-lto to 3.10 and newer --- 3.10/alpine3.13/Dockerfile | 1 + 3.10/alpine3.14/Dockerfile | 1 + 3.10/bullseye/Dockerfile | 1 + 3.10/bullseye/slim/Dockerfile | 1 + 3.10/buster/Dockerfile | 1 + 3.10/buster/slim/Dockerfile | 1 + 3.11-rc/alpine3.14/Dockerfile | 1 + 3.11-rc/bullseye/Dockerfile | 1 + 3.11-rc/bullseye/slim/Dockerfile | 1 + Dockerfile-alpine.template | 1 + Dockerfile-debian.template | 1 + Dockerfile-slim.template | 1 + update.sh | 5 +++++ 13 files changed, 17 insertions(+) diff --git a/3.10/alpine3.13/Dockerfile b/3.10/alpine3.13/Dockerfile index 11f520ed0..0b5a8e1ac 100644 --- a/3.10/alpine3.13/Dockerfile +++ b/3.10/alpine3.13/Dockerfile @@ -80,6 +80,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/3.10/alpine3.14/Dockerfile b/3.10/alpine3.14/Dockerfile index 5ae635ffe..9e3ee9a4a 100644 --- a/3.10/alpine3.14/Dockerfile +++ b/3.10/alpine3.14/Dockerfile @@ -80,6 +80,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/3.10/bullseye/Dockerfile b/3.10/bullseye/Dockerfile index 7d35f9023..c70355018 100644 --- a/3.10/bullseye/Dockerfile +++ b/3.10/bullseye/Dockerfile @@ -44,6 +44,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/3.10/bullseye/slim/Dockerfile b/3.10/bullseye/slim/Dockerfile index 535acf0db..86317dc37 100644 --- a/3.10/bullseye/slim/Dockerfile +++ b/3.10/bullseye/slim/Dockerfile @@ -71,6 +71,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/3.10/buster/Dockerfile b/3.10/buster/Dockerfile index 0ae6ed7d1..b980cef03 100644 --- a/3.10/buster/Dockerfile +++ b/3.10/buster/Dockerfile @@ -44,6 +44,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/3.10/buster/slim/Dockerfile b/3.10/buster/slim/Dockerfile index 5d7686ca7..92f4f9222 100644 --- a/3.10/buster/slim/Dockerfile +++ b/3.10/buster/slim/Dockerfile @@ -71,6 +71,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/3.11-rc/alpine3.14/Dockerfile b/3.11-rc/alpine3.14/Dockerfile index c7deb6ce0..5919f6d9f 100644 --- a/3.11-rc/alpine3.14/Dockerfile +++ b/3.11-rc/alpine3.14/Dockerfile @@ -80,6 +80,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/3.11-rc/bullseye/Dockerfile b/3.11-rc/bullseye/Dockerfile index e918474f0..db52ac908 100644 --- a/3.11-rc/bullseye/Dockerfile +++ b/3.11-rc/bullseye/Dockerfile @@ -44,6 +44,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/3.11-rc/bullseye/slim/Dockerfile b/3.11-rc/bullseye/slim/Dockerfile index 12672fcf1..7ccb2df5b 100644 --- a/3.11-rc/bullseye/slim/Dockerfile +++ b/3.11-rc/bullseye/slim/Dockerfile @@ -71,6 +71,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index de003844e..3f8422396 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -74,6 +74,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 32c8d2b99..b4e7b53d0 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -38,6 +38,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 9a8755f57..47284e55d 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -65,6 +65,7 @@ RUN set -ex \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ + --with-lto \ --with-system-expat \ --with-system-ffi \ --without-ensurepip \ diff --git a/update.sh b/update.sh index 029c44cdd..dc5cef378 100755 --- a/update.sh +++ b/update.sh @@ -253,5 +253,10 @@ for version in "${versions[@]}"; do if [ "$minor" -lt 9 ]; then sed -ri -e '/tzdata/d' "$dir/Dockerfile" fi + + if [ "$minor" -lt 10 ]; then + # <3.10 does not have -fno-semantic-interposition enabled and --with-lto does nothing for performance + sed -ri -e '/with-lto/d' "$dir/Dockerfile" + fi done done