From afce95c9e471e2a3e70e6c7c0736728da1f86d44 Mon Sep 17 00:00:00 2001 From: KingKDot Date: Fri, 3 Apr 2026 11:30:01 -0500 Subject: [PATCH] remove old zig shit and hopefully fix static compilation for linux --- Dockerfile | 3 +++ Overlord-Server/src/server/build-process.ts | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index df4e09f..6bdf275 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,9 @@ RUN apt-get update \ build-essential \ gcc-mingw-w64-x86-64 \ gcc-mingw-w64-i686 \ + musl-tools \ + gcc-aarch64-linux-gnu \ + gcc-arm-linux-gnueabihf \ openssl \ curl \ ca-certificates \ diff --git a/Overlord-Server/src/server/build-process.ts b/Overlord-Server/src/server/build-process.ts index a5addf1..83baebd 100644 --- a/Overlord-Server/src/server/build-process.ts +++ b/Overlord-Server/src/server/build-process.ts @@ -642,7 +642,9 @@ func runBoundFiles() { if (env.CGO_ENABLED === "1") { const cCompilerByTarget: Record = { - "linux/amd64": "gcc", + "linux/amd64": "musl-gcc", + "linux/arm64": "aarch64-linux-gnu-gcc", + "linux/arm/v7": "arm-linux-gnueabihf-gcc", "windows/amd64": "x86_64-w64-mingw32-gcc", "windows/386": "i686-w64-mingw32-gcc", ...(ndkBin ? { @@ -653,6 +655,8 @@ func runBoundFiles() { }; const cxxCompilerByTarget: Record = { "linux/amd64": "g++", + "linux/arm64": "aarch64-linux-gnu-g++", + "linux/arm/v7": "arm-linux-gnueabihf-g++", "windows/amd64": "x86_64-w64-mingw32-g++", "windows/386": "i686-w64-mingw32-g++", ...(ndkBin ? { @@ -764,6 +768,14 @@ func runBoundFiles() { sendToStream({ type: "output", text: "Client printing disabled (noprint tag)\n", level: "info" }); } + // Linux CGO builds must be fully statically linked to avoid glibc version + // mismatches between the build server and target machines. + if (os === "linux" && env.CGO_ENABLED === "1") { + const staticFlag = "-extldflags '-static'"; + ldflags = ldflags ? `${ldflags} ${staticFlag}` : staticFlag; + sendToStream({ type: "output", text: "Linux CGO: static linking enabled (avoids GLIBC version mismatch)\n", level: "info" }); + } + try { const buildTool = config.obfuscate ? "garble" : "go"; const buildTags: string[] = [];