Fix builds for arm32vX, mips64le, ppc64le, riscv64, and s390x#1003
Fix builds for arm32vX, mips64le, ppc64le, riscv64, and s390x#1003tianon merged 1 commit intodocker-library:masterfrom
arm32vX, mips64le, ppc64le, riscv64, and s390x#1003Conversation
| x86_64|aarch64) \ | ||
| {{ ) else ( -}} | ||
| amd64|arm64) \ | ||
| {{ ) end -}} |
There was a problem hiding this comment.
Im wondering if these should be in a jq function to make it more readable but other than that, all good
There was a problem hiding this comment.
Yeah, I was tempted to do something like golang, but couldn't decide on a good way to embed it.
I was thinking something like the following, but it'll either interrupt the mental parsing of the RUN if placed where it is used, or the flags will be far from their context if placed before the RUN.
{{
def os_arches:
if is_alpine then
{
x86_64: " -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
...
Dockerfile-linux.template
Outdated
| {{ if is_alpine then ( -}} | ||
| armhf|armv7|ppc64le|riscv64|s390x) \ | ||
| {{ ) else ( -}} | ||
| armel|armhf|mips64el|ppc64el|riscv64|s390x) \ | ||
| {{ ) end -}} | ||
| # these arches don't support "-mno-omit-leaf" | ||
| EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ | ||
| ;; \ | ||
| {{ if is_alpine then ( -}} | ||
| x86) \ | ||
| {{ ) else ( -}} | ||
| i386) \ | ||
| {{ ) end -}} | ||
| # don't enable frame-pointers on 32bit x86 due to performance drop. | ||
| ;; \ | ||
| # no default |
There was a problem hiding this comment.
Instead of explicitly listing "everything else" like this, why not make them the default so we're only maintaining the lists of special cases?
There was a problem hiding this comment.
ie:
| {{ if is_alpine then ( -}} | |
| armhf|armv7|ppc64le|riscv64|s390x) \ | |
| {{ ) else ( -}} | |
| armel|armhf|mips64el|ppc64el|riscv64|s390x) \ | |
| {{ ) end -}} | |
| # these arches don't support "-mno-omit-leaf" | |
| EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ | |
| ;; \ | |
| {{ if is_alpine then ( -}} | |
| x86) \ | |
| {{ ) else ( -}} | |
| i386) \ | |
| {{ ) end -}} | |
| # don't enable frame-pointers on 32bit x86 due to performance drop. | |
| ;; \ | |
| # no default | |
| {{ if is_alpine then ( -}} | |
| x86) \ | |
| {{ ) else ( -}} | |
| i386) \ | |
| {{ ) end -}} | |
| # don't enable frame-pointers on 32bit x86 due to performance drop. | |
| ;; \ | |
| *) \ | |
| # other arches don't support "-mno-omit-leaf" | |
| EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ | |
| ;; \ |
By removing the unsupported `-mno-omit-leaf-frame-pointer` flag when building on them
| ;; \ | ||
| *) \ | ||
| # other arches don't support "-mno-omit-leaf" | ||
| EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ |
There was a problem hiding this comment.
Looking at this one last time before merging, if we come back to this again, we should move this outside the case with a simple if [ "$arch" != i386 ]; then ... so that the amd64 | arm64 case can be just the extra -mno-... flag.
| x86_64|aarch64) \ | ||
| {{ ) else ( -}} | ||
| amd64|arm64) \ |
There was a problem hiding this comment.
Next time we touch this, we should add more whitespace here:
| x86_64|aarch64) \ | |
| {{ ) else ( -}} | |
| amd64|arm64) \ | |
| x86_64 | aarch64) \ | |
| {{ ) else ( -}} | |
| amd64 | arm64) \ |
Changes: - docker-library/python@0330f0ba: Update 3.13 to 3.13.2 - docker-library/python@9c50e071: Update 3.12 to 3.12.9 - docker-library/python@393cf619: Merge pull request docker-library/python#1003 from infosiftr/less-leaf - docker-library/python@3186ee40: Fix builds for `arm32vX`, `mips64le`, `ppc64le`, `riscv64`, and `s390x`
By removing the unsupported
-mno-omit-leaf-frame-pointerflag when building on themVerifying the supported arches (
amd64andarm64v8):