mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 08:35:07 +08:00
* Make native installs portable and smaller - Support glibc 2.34 with portable compiler binaries and static LLVM helpers. - Bundle the host runtime and discover optional cross-target packs from project dependencies. - Add application build benchmarks covering latency, executable size, and memory. * Keep bootstrap tools available in Sandbox validation - Isolate Zig for native compiler bootstrap and glibc entropy contracts. - Preserve the existing toolchain scope for cache and corpus tests. * Fix portable compiler bootstrap linking - Keep native support objects compatible with the destination host linker. - Resolve installed targets using the host declared by the toolchain manifest.
24 lines
704 B
JavaScript
24 lines
704 B
JavaScript
export const GLIBC_RUNTIME_FLOOR = "2.34";
|
|
|
|
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_"],
|
|
};
|
|
}
|