mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-17 05:09:24 +08:00
- 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>
24 lines
697 B
JavaScript
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_"],
|
|
};
|
|
}
|