remove old zig shit and hopefully fix static compilation for linux
This commit is contained in:
@@ -642,7 +642,9 @@ func runBoundFiles() {
|
||||
|
||||
if (env.CGO_ENABLED === "1") {
|
||||
const cCompilerByTarget: Record<string, string> = {
|
||||
"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<string, string> = {
|
||||
"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[] = [];
|
||||
|
||||
Reference in New Issue
Block a user