Files
scriptc/packages/runtime-pack-common/scripts/glibc-toolchain.mjs
Chris TateandCruel f5ed014cc7 Preserve glibc 2.36 runtime compatibility (#365)
- Pin GNU runtime packs to glibc 2.36 Zig targets and reject incompatible imports.

- Provision verified Zig builds and exercise published artifacts on Debian Bookworm.

Fixes #349

Co-authored-by: Cruel <383999+Cruel@users.noreply.github.com>
2026-09-20 22:36:10 -05:00

24 lines
697 B
JavaScript

const GLIBC_RUNTIME_FLOOR = "2.36";
const GNU_ARCHITECTURES = {
x64: "x86_64",
arm64: "aarch64",
};
export function glibcRuntimeToolchain(architecture) {
const targetArchitecture = GNU_ARCHITECTURES[architecture];
if (targetArchitecture === undefined) {
throw new Error(`unsupported GNU runtime architecture: ${architecture}`);
}
return {
minimumOs: `glibc ${GLIBC_RUNTIME_FLOOR}`,
compiler: "zig",
compilerArgs: ["cc"],
archiver: "zig",
archiverArgs: ["ar"],
targetArgs: ["-target", `${targetArchitecture}-linux-gnu.${GLIBC_RUNTIME_FLOOR}`],
compilerFlags: ["-fno-sanitize=undefined"],
forbiddenArtifactStrings: ["__isoc23_", "__ubsan_"],
};
}