From 90e9ca41dc404ee7d22c09b894823e8925227c17 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 20 Jan 2026 11:24:46 -0800 Subject: [PATCH] Use more defensive `LDFLAGS` append method In Debian Trixie and older, `dpkg-buildflags --get LDFLAGS` returns something like `-Wl,-z-relro` and in Forky and newer it looks like `-Wl,-z-relro -fcf-protection`, so instead of relying on that `-Wl` and appending to the existing value, we can (and should) just add new `-Wl` values to the end, which _should_ be combined together correctly by the compiler/linker. --- 3.10/alpine3.22/Dockerfile | 4 ++-- 3.10/alpine3.23/Dockerfile | 4 ++-- 3.10/bookworm/Dockerfile | 2 +- 3.10/slim-bookworm/Dockerfile | 4 ++-- 3.10/slim-trixie/Dockerfile | 4 ++-- 3.10/trixie/Dockerfile | 2 +- 3.11/alpine3.22/Dockerfile | 4 ++-- 3.11/alpine3.23/Dockerfile | 4 ++-- 3.11/bookworm/Dockerfile | 2 +- 3.11/slim-bookworm/Dockerfile | 4 ++-- 3.11/slim-trixie/Dockerfile | 4 ++-- 3.11/trixie/Dockerfile | 2 +- 3.12/alpine3.22/Dockerfile | 4 ++-- 3.12/alpine3.23/Dockerfile | 4 ++-- 3.12/bookworm/Dockerfile | 2 +- 3.12/slim-bookworm/Dockerfile | 4 ++-- 3.12/slim-trixie/Dockerfile | 4 ++-- 3.12/trixie/Dockerfile | 2 +- 3.13/alpine3.22/Dockerfile | 4 ++-- 3.13/alpine3.23/Dockerfile | 4 ++-- 3.13/bookworm/Dockerfile | 2 +- 3.13/slim-bookworm/Dockerfile | 4 ++-- 3.13/slim-trixie/Dockerfile | 4 ++-- 3.13/trixie/Dockerfile | 2 +- 3.14/alpine3.22/Dockerfile | 4 ++-- 3.14/alpine3.23/Dockerfile | 4 ++-- 3.14/bookworm/Dockerfile | 2 +- 3.14/slim-bookworm/Dockerfile | 4 ++-- 3.14/slim-trixie/Dockerfile | 4 ++-- 3.14/trixie/Dockerfile | 2 +- 3.15-rc/alpine3.22/Dockerfile | 4 ++-- 3.15-rc/alpine3.23/Dockerfile | 4 ++-- 3.15-rc/bookworm/Dockerfile | 2 +- 3.15-rc/slim-bookworm/Dockerfile | 4 ++-- 3.15-rc/slim-trixie/Dockerfile | 4 ++-- 3.15-rc/trixie/Dockerfile | 2 +- Dockerfile-linux.template | 4 ++-- 37 files changed, 62 insertions(+), 62 deletions(-) diff --git a/3.10/alpine3.22/Dockerfile b/3.10/alpine3.22/Dockerfile index 9d8817fb7..36c6bc92e 100644 --- a/3.10/alpine3.22/Dockerfile +++ b/3.10/alpine3.22/Dockerfile @@ -82,7 +82,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -92,7 +92,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.10/alpine3.23/Dockerfile b/3.10/alpine3.23/Dockerfile index bbde97a6f..c38dc49a3 100644 --- a/3.10/alpine3.23/Dockerfile +++ b/3.10/alpine3.23/Dockerfile @@ -82,7 +82,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -92,7 +92,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.10/bookworm/Dockerfile b/3.10/bookworm/Dockerfile index 5d4e0db90..b9879f453 100644 --- a/3.10/bookworm/Dockerfile +++ b/3.10/bookworm/Dockerfile @@ -65,7 +65,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.10/slim-bookworm/Dockerfile b/3.10/slim-bookworm/Dockerfile index 9fac25174..e380e755a 100644 --- a/3.10/slim-bookworm/Dockerfile +++ b/3.10/slim-bookworm/Dockerfile @@ -81,7 +81,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -91,7 +91,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.10/slim-trixie/Dockerfile b/3.10/slim-trixie/Dockerfile index 9c27605a7..54f9a5e59 100644 --- a/3.10/slim-trixie/Dockerfile +++ b/3.10/slim-trixie/Dockerfile @@ -81,7 +81,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -91,7 +91,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.10/trixie/Dockerfile b/3.10/trixie/Dockerfile index a0b09dab9..d39e2857e 100644 --- a/3.10/trixie/Dockerfile +++ b/3.10/trixie/Dockerfile @@ -65,7 +65,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.11/alpine3.22/Dockerfile b/3.11/alpine3.22/Dockerfile index a88b9e328..e580e4efb 100644 --- a/3.11/alpine3.22/Dockerfile +++ b/3.11/alpine3.22/Dockerfile @@ -82,7 +82,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -92,7 +92,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.11/alpine3.23/Dockerfile b/3.11/alpine3.23/Dockerfile index 095e792f4..a83dd2e4d 100644 --- a/3.11/alpine3.23/Dockerfile +++ b/3.11/alpine3.23/Dockerfile @@ -82,7 +82,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -92,7 +92,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.11/bookworm/Dockerfile b/3.11/bookworm/Dockerfile index 6b9158d70..a02baff26 100644 --- a/3.11/bookworm/Dockerfile +++ b/3.11/bookworm/Dockerfile @@ -65,7 +65,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.11/slim-bookworm/Dockerfile b/3.11/slim-bookworm/Dockerfile index 9137579df..c979c6419 100644 --- a/3.11/slim-bookworm/Dockerfile +++ b/3.11/slim-bookworm/Dockerfile @@ -81,7 +81,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -91,7 +91,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.11/slim-trixie/Dockerfile b/3.11/slim-trixie/Dockerfile index 43add477a..6d346528c 100644 --- a/3.11/slim-trixie/Dockerfile +++ b/3.11/slim-trixie/Dockerfile @@ -81,7 +81,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -91,7 +91,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.11/trixie/Dockerfile b/3.11/trixie/Dockerfile index 4daf9651d..d9c93cb21 100644 --- a/3.11/trixie/Dockerfile +++ b/3.11/trixie/Dockerfile @@ -65,7 +65,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/alpine3.22/Dockerfile b/3.12/alpine3.22/Dockerfile index 58d18cbc8..278eac91e 100644 --- a/3.12/alpine3.22/Dockerfile +++ b/3.12/alpine3.22/Dockerfile @@ -82,7 +82,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(apk --print-arch)"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -110,7 +110,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/alpine3.23/Dockerfile b/3.12/alpine3.23/Dockerfile index 115a5af3c..571036dfb 100644 --- a/3.12/alpine3.23/Dockerfile +++ b/3.12/alpine3.23/Dockerfile @@ -82,7 +82,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(apk --print-arch)"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -110,7 +110,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/bookworm/Dockerfile b/3.12/bookworm/Dockerfile index a8444968f..904b2b946 100644 --- a/3.12/bookworm/Dockerfile +++ b/3.12/bookworm/Dockerfile @@ -83,7 +83,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/slim-bookworm/Dockerfile b/3.12/slim-bookworm/Dockerfile index 4f86beb7c..c8debe41a 100644 --- a/3.12/slim-bookworm/Dockerfile +++ b/3.12/slim-bookworm/Dockerfile @@ -81,7 +81,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -109,7 +109,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/slim-trixie/Dockerfile b/3.12/slim-trixie/Dockerfile index 306fb08e9..b9ff939e4 100644 --- a/3.12/slim-trixie/Dockerfile +++ b/3.12/slim-trixie/Dockerfile @@ -81,7 +81,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -109,7 +109,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/trixie/Dockerfile b/3.12/trixie/Dockerfile index 48eff8df3..d2b592bae 100644 --- a/3.12/trixie/Dockerfile +++ b/3.12/trixie/Dockerfile @@ -83,7 +83,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/alpine3.22/Dockerfile b/3.13/alpine3.22/Dockerfile index 2756eb6dc..5f4e534c5 100644 --- a/3.13/alpine3.22/Dockerfile +++ b/3.13/alpine3.22/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(apk --print-arch)"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -105,7 +105,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/alpine3.23/Dockerfile b/3.13/alpine3.23/Dockerfile index 59c202fdf..88e61ae92 100644 --- a/3.13/alpine3.23/Dockerfile +++ b/3.13/alpine3.23/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(apk --print-arch)"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -105,7 +105,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/bookworm/Dockerfile b/3.13/bookworm/Dockerfile index d1493a1d2..ec3a15967 100644 --- a/3.13/bookworm/Dockerfile +++ b/3.13/bookworm/Dockerfile @@ -78,7 +78,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/slim-bookworm/Dockerfile b/3.13/slim-bookworm/Dockerfile index ae47d0453..046a2d7e1 100644 --- a/3.13/slim-bookworm/Dockerfile +++ b/3.13/slim-bookworm/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -104,7 +104,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/slim-trixie/Dockerfile b/3.13/slim-trixie/Dockerfile index e8d443e03..aeb98251f 100644 --- a/3.13/slim-trixie/Dockerfile +++ b/3.13/slim-trixie/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -104,7 +104,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/trixie/Dockerfile b/3.13/trixie/Dockerfile index 1ad9ffc2a..cf709d74d 100644 --- a/3.13/trixie/Dockerfile +++ b/3.13/trixie/Dockerfile @@ -78,7 +78,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.14/alpine3.22/Dockerfile b/3.14/alpine3.22/Dockerfile index 407a18c09..e32939bfd 100644 --- a/3.14/alpine3.22/Dockerfile +++ b/3.14/alpine3.22/Dockerfile @@ -71,7 +71,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(apk --print-arch)"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -99,7 +99,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.14/alpine3.23/Dockerfile b/3.14/alpine3.23/Dockerfile index 1e3a7afd6..b2d530afc 100644 --- a/3.14/alpine3.23/Dockerfile +++ b/3.14/alpine3.23/Dockerfile @@ -71,7 +71,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(apk --print-arch)"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -99,7 +99,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.14/bookworm/Dockerfile b/3.14/bookworm/Dockerfile index 16995692d..4c3b74a15 100644 --- a/3.14/bookworm/Dockerfile +++ b/3.14/bookworm/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.14/slim-bookworm/Dockerfile b/3.14/slim-bookworm/Dockerfile index 9faa2fb5c..c957d0906 100644 --- a/3.14/slim-bookworm/Dockerfile +++ b/3.14/slim-bookworm/Dockerfile @@ -70,7 +70,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -98,7 +98,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.14/slim-trixie/Dockerfile b/3.14/slim-trixie/Dockerfile index 95ad66bdf..552a9e64b 100644 --- a/3.14/slim-trixie/Dockerfile +++ b/3.14/slim-trixie/Dockerfile @@ -70,7 +70,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -98,7 +98,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.14/trixie/Dockerfile b/3.14/trixie/Dockerfile index e70450270..b10f61355 100644 --- a/3.14/trixie/Dockerfile +++ b/3.14/trixie/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.15-rc/alpine3.22/Dockerfile b/3.15-rc/alpine3.22/Dockerfile index 1b10a6e60..379607cbc 100644 --- a/3.15-rc/alpine3.22/Dockerfile +++ b/3.15-rc/alpine3.22/Dockerfile @@ -71,7 +71,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(apk --print-arch)"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -99,7 +99,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.15-rc/alpine3.23/Dockerfile b/3.15-rc/alpine3.23/Dockerfile index e66f8dd6c..29770b3a7 100644 --- a/3.15-rc/alpine3.23/Dockerfile +++ b/3.15-rc/alpine3.23/Dockerfile @@ -71,7 +71,7 @@ RUN set -eux; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(apk --print-arch)"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -99,7 +99,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.15-rc/bookworm/Dockerfile b/3.15-rc/bookworm/Dockerfile index 18abaf936..7be6c0497 100644 --- a/3.15-rc/bookworm/Dockerfile +++ b/3.15-rc/bookworm/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.15-rc/slim-bookworm/Dockerfile b/3.15-rc/slim-bookworm/Dockerfile index 6bc6b2d9a..c9750daec 100644 --- a/3.15-rc/slim-bookworm/Dockerfile +++ b/3.15-rc/slim-bookworm/Dockerfile @@ -70,7 +70,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -98,7 +98,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.15-rc/slim-trixie/Dockerfile b/3.15-rc/slim-trixie/Dockerfile index ee1a2ec86..8243a5ffe 100644 --- a/3.15-rc/slim-trixie/Dockerfile +++ b/3.15-rc/slim-trixie/Dockerfile @@ -70,7 +70,7 @@ RUN set -eux; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ # https://docs.python.org/3.12/howto/perf_profiling.html # https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 @@ -98,7 +98,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.15-rc/trixie/Dockerfile b/3.15-rc/trixie/Dockerfile index 6e3435f52..e83cdde1e 100644 --- a/3.15-rc/trixie/Dockerfile +++ b/3.15-rc/trixie/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 3e4b54cfa..92cc4f2b5 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -217,7 +217,7 @@ RUN set -eux; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ {{ ) end -}} {{ if is_slim or is_alpine then ( -}} - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ {{ ) else "" end -}} {{ # Enabling frame-pointers only makes sense for Python 3.12 and newer as those have perf profiler support @@ -263,7 +263,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \