Skip to content

Conversation

@tianon
Copy link
Member

@tianon tianon commented Jan 20, 2026

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.

@tianon
Copy link
Member Author

tianon commented Jan 20, 2026

Verified locally by building with docker buildx build --pull 3.14/slim-trixie --pull --build-context debian:trixie-slim=docker-image://debian:forky-slim (and it was successful).

Additionally, a basic test that --strip-all is indeed taking effect:

tag master this PR
slim-trixie 119MB 119MB
slim-bookworm 122MB 122MB

@tianon tianon mentioned this pull request Jan 20, 2026
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.
@tianon
Copy link
Member Author

tianon commented Jan 20, 2026

Hah, I created a conflict by merging #1108 first 😂

@tianon tianon merged commit 850e1ea into docker-library:master Jan 20, 2026
44 checks passed
@tianon tianon deleted the LDFLAGS branch January 20, 2026 20:52
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Jan 20, 2026
Changes:

- docker-library/python@850e1ea3: Merge pull request docker-library/python#1107 from infosiftr/LDFLAGS
- docker-library/python@90e9ca41: Use more defensive `LDFLAGS` append method
- docker-library/python@12629ffd: Merge pull request docker-library/python#1108 from infosiftr/indentation
- docker-library/python@37025e2a: Fix indentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong parameters from dpkg-buildflags for LDFLAGS on Forky

2 participants