From aa94aa0b87564cf864cf6f2dc84273e9302edcc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Wed, 9 Sep 2026 21:40:00 +0200 Subject: [PATCH] fix(build): use libgit2's bundled zlib so the image builds on arm64 hosts Building the server image on an arm64 host fails while linking libgit2 for the amd64 target: /rootfs-amd64/usr/lib/x86_64-linux-gnu/libz.a(deflate.o): relocation R_X86_64_PC32 against symbol `z_errmsg' can not be used when making a shared object; recompile with -fPIC ld: final link failed: bad value libgit2 is built with BUILD_SHARED_LIBS=ON, but the staged cross sysroot offers only a static, non-PIC libz.a, which cannot go into a shared object. Point libgit2 at its own bundled zlib for both cross targets; it is compiled as part of the shared library and so is position independent. Verified on an Apple Silicon host: `docker build --platform linux/amd64` now links libgit2.so and proceeds to the Go build, where it failed before. Generated-by: Claude Code (Claude Opus 5) Co-Authored-By: Claude Opus 5 (1M context) --- backend/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index e77fe682eec..d0023958451 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -68,11 +68,11 @@ RUN for arch in aarch64 x86_64 ; do \ mkdir build && cd build && \ if [ "$arch" = "aarch64" ] ; then \ cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \ - -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSROOT=/rootfs-arm64 \ + -DBUILD_SHARED_LIBS=ON -DUSE_BUNDLED_ZLIB=ON -DCMAKE_SYSROOT=/rootfs-arm64 \ -DCMAKE_INSTALL_PREFIX=/usr/local/deps/${arch} ; \ elif [ "$arch" = "x86_64" ] ; then \ cmake .. -DCMAKE_C_COMPILER=x86_64-linux-gnu-gcc \ - -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSROOT=/rootfs-amd64 \ + -DBUILD_SHARED_LIBS=ON -DUSE_BUNDLED_ZLIB=ON -DCMAKE_SYSROOT=/rootfs-amd64 \ -DCMAKE_INSTALL_PREFIX=/usr/local/deps/${arch} ; \ fi && \ make -j install ; \