Skip to content

Commit 7104f54

Browse files
committed
Build static PIE binaries with clang
gcc is not capable of linking with -static-pie, therefore we switch to using clang.
1 parent f06d0b6 commit 7104f54

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

scripts/chroot/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ find /scripts
1212
apk update
1313
apk add alpine-sdk util-linux strace file autoconf automake libtool xz bash \
1414
eudev-dev gettext-dev linux-headers meson \
15-
zstd-dev zlib-dev zlib-static # fuse3-dev fuse3-static fuse-static fuse-dev
15+
zstd-dev zlib-dev zlib-static clang
1616

1717
/scripts/common/install-dependencies.sh
1818
/scripts/build-runtime.sh

scripts/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM ${docker_arch}/alpine:latest
55
RUN apk add --no-cache \
66
bash alpine-sdk util-linux strace file autoconf automake libtool xz \
77
eudev-dev gettext-dev linux-headers meson \
8-
zstd-dev zstd-static zlib-dev zlib-static # fuse3-dev fuse3-static fuse-static fuse-dev
8+
zstd-dev zstd-static zlib-dev zlib-static clang
99

1010
COPY scripts/common/install-dependencies.sh /tmp/scripts/common/install-dependencies.sh
1111
COPY patches/ /tmp/patches/

src/runtime/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CC = gcc
2-
CFLAGS = -std=gnu99 -Os -D_FILE_OFFSET_BITS=64 -DGIT_COMMIT=\"${GIT_COMMIT}\" -T data_sections.ld -ffunction-sections -fdata-sections -Wl,--gc-sections -static -Wall -Werror -fPIE
1+
CC = clang
2+
CFLAGS = -std=gnu99 -Os -D_FILE_OFFSET_BITS=64 -DGIT_COMMIT=\"${GIT_COMMIT}\" -T data_sections.ld -ffunction-sections -fdata-sections -Wl,--gc-sections -static -Wall -Werror
33
LIBS = -lsquashfuse -lsquashfuse_ll -lzstd -lz -lfuse3
44

55
all: runtime

0 commit comments

Comments
 (0)