Skip to content

Commit a71acd2

Browse files
committed
Update to Bookworm + musl 1.2.5
Also, fix `CFLAGS` bug and add `norelro` to avoid huge size increases on some architectures. πŸš€
1 parent 680f908 commit a71acd2

File tree

12 files changed

+8
-7
lines changed

12 files changed

+8
-7
lines changed

β€ŽDockerfile.build

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

44
RUN set -eux; \
55
apt-get update; \
@@ -36,7 +36,7 @@ RUN set -eux; \
3636
rm -rf /var/lib/apt/lists/*
3737

3838
# https://musl.libc.org/releases.html
39-
ENV MUSL_VERSION 1.2.4
39+
ENV MUSL_VERSION 1.2.5
4040
RUN set -eux; \
4141
wget -O musl.tgz.asc "https://musl.libc.org/releases/musl-$MUSL_VERSION.tar.gz.asc"; \
4242
wget -O musl.tgz "https://musl.libc.org/releases/musl-$MUSL_VERSION.tar.gz"; \
@@ -64,21 +64,21 @@ RUN set -ex; \
6464
make clean all test \
6565
TARGET_ARCH='arm32v5' \
6666
CROSS_COMPILE='arm-linux-gnueabi-' \
67-
# CFLAGS+='-march=armv5te' \
67+
# EXTRA_CFLAGS='-march=armv5te' \
6868
ARCH_TEST='armel'
6969

7070
RUN set -ex; \
7171
make clean all test \
7272
TARGET_ARCH='arm32v6' \
7373
CROSS_COMPILE='arm-linux-gnueabi-' \
74-
CFLAGS+='-march=armv6+fp' \
74+
EXTRA_CFLAGS='-march=armv6+fp' \
7575
ARCH_TEST='armhf'
7676

7777
RUN set -ex; \
7878
make clean all test \
7979
TARGET_ARCH='arm32v7' \
8080
CROSS_COMPILE='arm-linux-gnueabihf-' \
81-
# CFLAGS+='-march=armv7-a+fp' \
81+
# EXTRA_CFLAGS='-march=armv7-a+fp' \
8282
ARCH_TEST='armhf'
8383

8484
RUN set -ex; \
@@ -103,7 +103,7 @@ RUN set -ex; \
103103
make clean all test \
104104
TARGET_ARCH='ppc64le' \
105105
CROSS_COMPILE='powerpc64le-linux-gnu-' \
106-
CFLAGS+='-mlong-double-64' \
106+
EXTRA_CFLAGS='-mlong-double-64' \
107107
ARCH_TEST='ppc64el'
108108

109109
RUN set -ex; \

β€ŽMakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ TARGET_ARCH := amd64
44
export ARCH_TEST :=
55
C_TARGETS := $(addsuffix hello, $(wildcard $(TARGET_ARCH)/*/))
66

7-
export CFLAGS := -Os -fdata-sections -ffunction-sections -s
7+
# norelro: https://stackoverflow.com/a/59084373/433558
8+
export CFLAGS := -Os -fdata-sections -ffunction-sections -Wl,-z,norelro -s $(EXTRA_CFLAGS)
89
STRIP := $(CROSS_COMPILE)strip
910

1011
.PHONY: all

β€Žamd64/hello-world/hello

-3.11 KB
Binary file not shown.

β€Žarm32v5/hello-world/hello

-3.39 KB
Binary file not shown.

β€Žarm32v6/hello-world/hello

-3.41 KB
Binary file not shown.

β€Žarm32v7/hello-world/hello

-800 Bytes
Binary file not shown.

β€Žarm64v8/hello-world/hello

-3.84 KB
Binary file not shown.

β€Ži386/hello-world/hello

-3.09 KB
Binary file not shown.

β€Žmips64le/hello-world/hello

-280 Bytes
Binary file not shown.

β€Žppc64le/hello-world/hello

-58.7 KB
Binary file not shown.

0 commit comments

Comments
Β (0)