Skip to content

Commit c29a5d3

Browse files
authored
Merge pull request #129 from infosiftr/trixie
Update to Debian Trixie
2 parents 8ffde12 + 6db8263 commit c29a5d3

File tree

13 files changed

+51
-13
lines changed

13 files changed

+51
-13
lines changed

Dockerfile.build

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# explicitly use Debian for maximum cross-architecture compatibility
2-
FROM debian:bookworm-slim
2+
FROM debian:trixie-slim
33

44
RUN set -eux; \
5-
apt-get update; \
65
dpkgArch="$(dpkg --print-architecture)"; \
7-
apt-get install -y --no-install-recommends \
6+
apt-get install --update -y --no-install-recommends \
87
ca-certificates \
9-
gnupg \
8+
sq \
109
wget \
1110
\
1211
gcc \
@@ -37,20 +36,35 @@ RUN set -eux; \
3736
\
3837
arch-test \
3938
file \
39+
patch \
4040
; \
41-
rm -rf /var/lib/apt/lists/*
41+
apt-get dist-clean
4242

4343
# https://musl.libc.org/releases.html
4444
ENV MUSL_VERSION 1.2.5
4545
RUN set -eux; \
46-
wget -O musl.tgz.asc "https://musl.libc.org/releases/musl-$MUSL_VERSION.tar.gz.asc"; \
47-
wget -O musl.tgz "https://musl.libc.org/releases/musl-$MUSL_VERSION.tar.gz"; \
48-
\
49-
export GNUPGHOME="$(mktemp -d)"; \
50-
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '836489290BB6B70F99FFDA0556BCDB593020450F'; \
51-
gpg --batch --verify musl.tgz.asc musl.tgz; \
52-
gpgconf --kill all; \
53-
rm -rf "$GNUPGHOME" musl.tgz.asc; \
46+
# > Since 1.1.7, releases are signed with the project GPG key. Its fingerprint is 8364 8929 0BB6 B70F 99FF DA05 56BC DB59 3020 450F.
47+
muslKey='8364 8929 0BB6 B70F 99FF DA05 56BC DB59 3020 450F'; \
48+
#
49+
# Error: No binding signature at time 2025-08-12T23:23:25Z
50+
# because: Policy rejected non-revocation signature (PositiveCertification) requiring second pre-image resistance
51+
# because: SHA1 is not considered secure since 2023-02-01T00:00:00Z
52+
#
53+
# and then:
54+
#
55+
# Error: Policy rejected non-revocation signature (Binary) requiring collision resistance
56+
# because: SHA1 is not considered secure since 2013-02-01T00:00:00Z
57+
# 0 authenticated signatures, 1 bad signature.
58+
#
59+
sq='sq --policy-as-of 2013-01-01T00:00:00Z'; \
60+
$sq network search "$muslKey"; \
61+
$sq pki link add --cert "$muslKey" --userid 'musl libc <musl@libc.org>'; \
62+
$sq download \
63+
--output 'musl.tgz' \
64+
--url "https://musl.libc.org/releases/musl-$MUSL_VERSION.tar.gz" \
65+
--signature-url "https://musl.libc.org/releases/musl-$MUSL_VERSION.tar.gz.asc" \
66+
--signer "$muslKey" \
67+
; \
5468
\
5569
mkdir /usr/local/src/musl; \
5670
tar --extract --file musl.tgz --directory /usr/local/src/musl --strip-components 1; \
@@ -59,6 +73,9 @@ RUN set -eux; \
5973
WORKDIR /usr/src/hello
6074
COPY . .
6175

76+
# https://bugs.debian.org/1050429: error: unrecognized command-line option '-EL' (on mips64le specifically/only)
77+
RUN patch --input="$PWD/musl-gcc-mips64le.patch" /usr/local/src/musl/tools/musl-gcc.specs.sh
78+
6279
# the following steps are grouped into "architecture families" and roughly ordered in a descending compatibility way such that we end up with the most accurate ".host-arch" symlink we can reasonably get
6380

6481
RUN set -ex; \

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ $(MUSL_GCC):
2020
mkdir -p '$(MUSL_DIR)'
2121
cd '$(MUSL_DIR)' && '$(MUSL_SRC)/configure' --disable-shared --prefix='$(MUSL_PREFIX)' > /dev/null
2222
$(MAKE) -C '$(MUSL_DIR)' -j '$(shell nproc)' install > /dev/null
23+
.PHONY: musl
24+
musl: $(MUSL_GCC)
2325

2426
$(C_TARGETS): hello.c $(MUSL_GCC)
2527
$(MUSL_GCC) $(CFLAGS) -Wl,--gc-sections -static \

amd64/hello-world/hello

0 Bytes
Binary file not shown.

arm32v5/hello-world/hello

-12 Bytes
Binary file not shown.

arm32v6/hello-world/hello

-12 Bytes
Binary file not shown.

arm32v7/hello-world/hello

-8 Bytes
Binary file not shown.

arm64v8/hello-world/hello

0 Bytes
Binary file not shown.

i386/hello-world/hello

0 Bytes
Binary file not shown.

mips64le/hello-world/hello

-32 Bytes
Binary file not shown.

musl-gcc-mips64le.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Origin: https://bugs.debian.org/1050429#64
2+
3+
--- tools/musl-gcc.specs.sh 2024-03-01 02:07:33.000000000 +0000
4+
+++ tools/musl-gcc.specs.sh.new 2025-06-17 21:19:01.669504848 +0000
5+
@@ -3,12 +3,13 @@
6+
ldso=$3
7+
cat <<EOF
8+
%rename cpp_options old_cpp_options
9+
+%rename cc1 old_cc1
10+
11+
*cpp_options:
12+
-nostdinc -isystem $incdir -isystem include%s %(old_cpp_options)
13+
14+
*cc1:
15+
-%(cc1_cpu) -nostdinc -isystem $incdir -isystem include%s
16+
+-nostdinc -isystem $incdir -isystem include%s %(old_cc1)
17+
18+
*link_libgcc:
19+
-L$libdir -L .%s

0 commit comments

Comments
 (0)