Skip to content
This repository was archived by the owner on Sep 20, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions bminor/glibc/glibc-2.27/glibc_llar.gox
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import (
"os"
"path/filepath"
)

id "bminor/glibc"

fromVer "glibc-2.27"

filter => {
return target.require["os"][0] == "linux" &&
(target.require["arch"][0] == "amd64" || target.require["arch"][0] == "arm64")
}

onRequire (proj, deps) => {
deps.require "torvalds/linux", "v7.2"
}

onBuild ctx => {
headers := ctx.outputDir(ctx.Proj.Deps[0])
// Keep configure's UAPI input separate from any previous libc installation.
cp! "-a", headers+"/usr/.", ctx.outputDir+"/usr/"
a := autotools.new(ctx.SourceDir, filepath.join(ctx.SourceDir, "_build"), "/usr")
// GCC 10+ defaults to -fno-common; glibc 2.27's nsswitch.h contains
// tentative definitions such as __nss_passwd_database in multiple objects.
a.configure "--with-headers="+filepath.join(headers, "usr", "include"),
"--libdir=/usr/lib", "--enable-shared", "--disable-profile", "--disable-werror",
"CFLAGS=-O2 -fcommon", "CXXFLAGS=-O2", "CPPFLAGS="
a.build
a.install "install_root="+ctx.outputDir
ctx.setMetadata "--sysroot="+ctx.outputDir
}

onTest ctx => {
source := filepath.join(ctx.SourceDir, "consumer.c")
binary := filepath.join(ctx.SourceDir, "consumer")
os.writeFile! source, []byte(`#include <errno.h>
#include <asm/unistd.h>
#include <gnu/libc-version.h>
#include <linux/futex.h>
#include <linux/netlink.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static void *worker(void *arg) {
return arg;
}

int main(void) {
pthread_t thread;
void *result = NULL;
char *text = strdup("glibc consumer");
if (sizeof(struct nlmsghdr) != 16 || FUTEX_WAIT != 0 || __NR_futex <= 0)
return 5;
if (text == NULL || strcmp(text, "glibc consumer") != 0)
return 1;
if (pthread_create(&thread, NULL, worker, text) != 0)
return 2;
if (pthread_join(thread, &result) != 0 || result != text)
return 3;
errno = EINVAL;
if (strerror(errno) == NULL)
return 4;
printf("glibc %s\n", gnu_get_libc_version());
free(text);
return 0;
}
`), 0o644
// Native GCC also searches its host multiarch directories. Prefer this
// installation's startup objects and linker scripts for the consumer.
cc! "--sysroot="+ctx.outputDir, "-B"+ctx.outputDir+"/usr/lib/",
"-L"+ctx.outputDir+"/usr/lib", source, "-pthread", "-o", binary
loader := filepath.join(ctx.outputDir, "lib64", "ld-linux-x86-64.so.2")
if target.require["arch"][0] == "arm64" {
loader = filepath.join(ctx.outputDir, "lib", "ld-linux-aarch64.so.1")
}
exec! loader, "--library-path", ctx.outputDir+"/lib:"+ctx.outputDir+"/lib64:"+ctx.outputDir+"/usr/lib", binary
}
4 changes: 4 additions & 0 deletions bminor/glibc/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"path": "bminor/glibc",
"deps": {}
}
7 changes: 7 additions & 0 deletions joseluisq/macosx-sdks/sdk-14_5/macosxSdks_llar.gox
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id "joseluisq/macosx-sdks"

fromVer "14.5"

// The SDK will be supplied as a prebuilt Kodo artifact.
onBuild ctx => {
}
4 changes: 4 additions & 0 deletions joseluisq/macosx-sdks/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"path": "joseluisq/macosx-sdks",
"deps": {}
}
42 changes: 42 additions & 0 deletions torvalds/linux/v5.7/linuxHeaders_llar.gox
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import (
"os"
"path/filepath"
)

id "torvalds/linux"

// Linux 5.7 introduced LLVM=1 for both target tools and host Clang.
fromVer "v5.7"

filter => {
return target.require["os"][0] == "linux" &&
(target.require["arch"][0] == "amd64" || target.require["arch"][0] == "arm64")
}

onBuild ctx => {
arch := "x86"
if target.require["arch"][0] == "arm64" {
arch = "arm64"
}
a := autotools.new(ctx.SourceDir, ctx.SourceDir, ctx.outputDir)
a.build "headers_install", "ARCH="+arch, "LLVM=1", "INSTALL_HDR_PATH="+ctx.outputDir+"/usr"
}

onTest ctx => {
triple := "x86_64-linux-gnu"
readNumber := "0"
if target.require["arch"][0] == "arm64" {
triple = "aarch64-linux-gnu"
readNumber = "63"
}
source := filepath.join(ctx.SourceDir, "headers-consumer.c")
os.writeFile! source, []byte(`#include <asm/unistd.h>
#include <linux/futex.h>
#include <linux/netlink.h>
_Static_assert(__NR_read == EXPECT_NR_READ, "wrong architecture headers");
_Static_assert(sizeof(struct nlmsghdr) == 16, "invalid netlink ABI");
_Static_assert(sizeof(__u64) == 8, "invalid UAPI integer size");
`), 0o644
clang! "--target="+triple, "-fsyntax-only", "-nostdinc",
"-I"+filepath.join(ctx.outputDir, "usr", "include"), "-DEXPECT_NR_READ="+readNumber, source
}
4 changes: 4 additions & 0 deletions torvalds/linux/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"path": "torvalds/linux",
"deps": {}
}
Loading