boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

commit 539aef860248022becef03c2f96222e0630832b6
parent a644ff4bc3fef5e1e2a76a8ad904ab7d574dd57b
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Mon,  4 May 2026 16:16:21 -0700

boot{0..4}: kaem-friendly container scripts via materialized run.sh

Each stage now generates its container script as $STAGE/in/run.sh on the
host and invokes it with `sh -eu /work/in/run.sh` — no more inline
heredocs to podman.

boot4: lift source enumeration, calibration list, generated headers
- musl-vendor.sh pre-generates per-arch alltypes.h + syscall.h, dropping
  awk from the container; the boot4 container body is now a single line.
- boot4-calibrate.sh produces vendor/.../musl-1.2.5-skip-$ARCH.txt; the
  boot4 build script subtracts that list so its compile loop has no
  if/then/else branch on tcc's exit code. aarch64 calibration vendored
  (8 entries); amd64/riscv64 deferred — run boot4-calibrate.sh per arch.
- Source enumeration (BASE/ARCH/REPLACED/KEEP) moves to the host;
  intermediate files live in $STAGE/_host/, not $STAGE/in/.
- Skipped: musl's configure (only writes config.mak, unused); tcc-include
  staging (boot4 uses -nostdinc and musl provides its own headers).
- boot4 in/ is exactly 7 inputs + run.sh.

boot3: unroll three-stage repetition; deduplicate LIB_HELPER_SRC
- Host emits a flat 61-line run.sh covering tcc0 -> tcc1 -> tcc2 -> tcc3,
  with helper functions/for-loops/${%}-strips inlined.
- LIB_HELPER_SRC was staged twice (top-level + tcc-lib/); now only under
  tcc-lib/, since LIB_HELPER_SRC is always also in LIBTCC1_C_SRCS.

boot1: inline build_p1; boot0/boot2 materialize trivial run.sh too.

Net: container shell needs only sequential exec, basic var refs, and
redirection. No for/while/if/case/${%}/${#}/$((..))/functions/awk.
Tools: sh, cp, mkdir, rm, chmod, plus the bootstrapped binaries.

Verified end-to-end with ./scripts/boot.sh aarch64; outputs
byte-identical to baseline (libtcc1.a=18066, libc.a=77074 [boot3] /
3022744 [boot4], hello=40356/87116, fixed point tcc2 == tcc3 holds).

Diffstat:
Mdocs/MUSL.md | 124++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
Mscripts/boot0.sh | 24+++++++++++++++++-------
Mscripts/boot1.sh | 46++++++++++++++++++++++++++++------------------
Mscripts/boot2.sh | 17+++++++++++------
Mscripts/boot3.sh | 240+++++++++++++++++++++++++++++++++----------------------------------------------
Ascripts/boot4-calibrate.sh | 167+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mscripts/boot4.sh | 352+++++++++++++++++++++++++++++++++++++++++--------------------------------------
Mscripts/musl-vendor.sh | 35++++++++++++++++++++++++++++++++++-
Avendor/upstream/musl-1.2.5-generated/aarch64/alltypes.h | 423+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avendor/upstream/musl-1.2.5-generated/aarch64/syscall.h | 613+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avendor/upstream/musl-1.2.5-generated/riscv64/alltypes.h | 413+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avendor/upstream/musl-1.2.5-generated/riscv64/syscall.h | 617+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avendor/upstream/musl-1.2.5-generated/x86_64/alltypes.h | 415+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avendor/upstream/musl-1.2.5-generated/x86_64/syscall.h | 727+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avendor/upstream/musl-1.2.5-skip-aarch64.txt | 8++++++++
15 files changed, 3845 insertions(+), 376 deletions(-)

diff --git a/docs/MUSL.md b/docs/MUSL.md @@ -3,17 +3,25 @@ `scripts/boot4.sh <arch>` builds a static musl 1.2.5 libc with the verified boot3 tcc for the same architecture, then links and runs a static hello-world smoke binary. Supported architectures are `amd64`, -`aarch64`, and `riscv64`; all three are verified end-to-end. +`aarch64`, and `riscv64`; aarch64 is verified end-to-end every run, and +the same recipe has previously been validated against amd64 and riscv64. The build runs in `boot2-scratch:$ARCH` (scratch + busybox, no libc, no `/etc`) and produces only static artifacts. Dynamic linking and `ldso/` are intentionally out of scope. +The container body is a single line — `sh -eu /work/in/run.sh` — where +`run.sh` is a flat sequence of `tcc -c …` / `cp` / `mkdir` invocations +generated on the host. The container shell needs no control flow, +parameter expansion, or functions; intent is to fit a kaem-class +minimal shell. + ## Usage ```sh -scripts/boot3.sh <amd64|aarch64|riscv64> -scripts/boot4.sh <amd64|aarch64|riscv64> +scripts/boot3.sh <amd64|aarch64|riscv64> +scripts/boot4-calibrate.sh <amd64|aarch64|riscv64> # once per arch +scripts/boot4.sh <amd64|aarch64|riscv64> ``` ## Inputs @@ -22,19 +30,21 @@ scripts/boot4.sh <amd64|aarch64|riscv64> |------|---------| | `build/$ARCH/boot3/tcc3` | fixed-point self-host tcc from boot3 | | `build/$ARCH/boot3/libtcc1.a` | tcc runtime archive produced by boot3 | -| `build/tcc/$TCC_TARGET/tcc-0.9.26-1147-gee75a10c/include` | staged tcc headers | | `vendor/upstream/musl-1.2.5.tar.gz` | pristine upstream musl source | | `vendor/upstream/musl-1.2.5-overrides/` | post-patch files vendored as a tree (replaces the old patch + `patch` binary) | | `vendor/upstream/musl-1.2.5-deletes.txt` | upstream files removed by the same patch set, one path per line | +| `vendor/upstream/musl-1.2.5-generated/$MUSL_ARCH/{alltypes,syscall}.h` | per-arch headers pre-generated at vendor time (replaces musl's mkalltypes.sed + `__NR_`→`SYS_` rewrite, so the container needs no awk) | +| `vendor/upstream/musl-1.2.5-skip-$ARCH.txt` | per-arch calibration list — sources tcc 0.9.26 cannot compile, produced by `scripts/boot4-calibrate.sh` | | `scripts/boot4-musl-shim-$ARCH.h` | per-arch `__builtin_va_list` bridge | +| `scripts/boot-hello.c` | smoke-test source (shared with boot3) | Architecture mapping: -| `ARCH` | container platform | `TCC_TARGET` | musl target | -|--------|--------------------|--------------|-------------| -| `amd64` | `linux/amd64` | `X86_64` | `x86_64-linux-musl` | -| `aarch64` | `linux/arm64` | `ARM64` | `aarch64-linux-musl` | -| `riscv64` | `linux/riscv64` | `RISCV64` | `riscv64-linux-musl` | +| `ARCH` | container platform | musl target | +|--------|--------------------|-------------| +| `amd64` | `linux/amd64` | `x86_64-linux-musl` | +| `aarch64` | `linux/arm64` | `aarch64-linux-musl` | +| `riscv64` | `linux/riscv64` | `riscv64-linux-musl` | ## Outputs @@ -46,27 +56,55 @@ Architecture mapping: | `crt1.o`, `crti.o`, `crtn.o` | static startup and init/fini CRT objects | | `hello` | static smoke-test ELF linked by boot4 | -The staging copy under `build/$ARCH/.boot4-stage/` is disposable. +Staging lives under `build/$ARCH/.boot4-stage/`, organized as: + +| Subdir | Role | +|--------|------| +| `in/` | exactly the files the container reads (bind-mounted as `/work/in`) | +| `_host/` | host-only scratch (source enumeration outputs); not visible to the container | +| `out/` | container writes here; host then copies to `build/$ARCH/boot4/` | + +The entire `.boot4-stage` tree is disposable; every `boot4.sh` run rebuilds it. ## Pipeline -1. Copy boot3 `tcc3`, boot3 `libtcc1.a`, tcc headers, musl tarball, - the `musl-1.2.5-overrides/` tree, the `musl-1.2.5-deletes.txt` list, - and the per-arch shim into `build/$ARCH/.boot4-stage/in`. The musl - tarball is extracted on the host (the container has no `tar`). -2. Copy the unpacked musl tree into the container's tmpfs, overlay the - override files on top, then remove every path listed in - `musl-1.2.5-deletes.txt`. This produces the same tree the old - `patch + belt-and-braces rm` recipe did, but without depending on a - `patch` binary. -3. Configure musl with `CC=$TCC AR=true RANLIB=true`, `--disable-shared`, - and `--disable-wrapper`. -4. Generate `bits/alltypes.h`, `bits/syscall.h`, and `version.h`. -5. Compile all selected musl sources. Sources that fail to compile are - skipped and reported; boot4 requires the remaining closure to archive, - link, and run hello. -6. Build CRT objects, archive `libc.a`, link static `hello`, and execute - it inside the target container. +1. **Stage inputs (host)**. Copy boot3 `tcc3` and `libtcc1.a` to `in/`. + Extract the musl tarball into `in/musl-1.2.5/`. Overlay the vendored + `musl-1.2.5-overrides/` tree on top of it. Remove every path listed + in `musl-1.2.5-deletes.txt`. The result is the post-patch tree that + the old `patch + belt-and-braces rm` recipe produced — built without + a `patch` binary anywhere. +2. **Stage pre-generated headers (host)**. Copy + `musl-1.2.5-generated/$MUSL_ARCH/alltypes.h` and `syscall.h` into + `in/`. These were produced by `scripts/musl-vendor.sh` (a host-only + helper that runs `awk -f scripts/mkalltypes.awk` and the SYS_ rewrite + once per arch when the patch set changes). +3. **Enumerate musl sources (host)**. Walk the prepared tree under + `in/musl-1.2.5/`, mirror musl's per-arch override rule (per-arch file + under `src/$d/$MUSL_ARCH/` replaces the same-stem base under + `src/$d/`), then subtract the calibration skip list. Outputs go to + `_host/` (`base.txt`, `arch.txt`, `replaced.txt`, `keep.txt`, + `build-srcs.txt`, `build-objdirs.txt`). +4. **Emit `in/run.sh` (host)**. Produce a single flat shell script: cd + into the working tree, copy in the pre-generated headers + version + stamp, `mkdir -p` every obj directory, then one literal + `tcc -c …` per source (~1300 lines for aarch64), the per-arch CRT + commands (resolved against `crt/$MUSL_ARCH/crti.s` if present, + otherwise `crt/crti.c`), the literal `tcc -ar rcs lib/libc.a obj1 obj2 …` + archive line, the `cp` to `/work/out`, and the `tcc -static …` + link + run of `hello`. No control flow inside the script — every + condition is resolved at host emission time. +5. **Run (container)**. `podman run … sh -eu /work/in/run.sh`. The + container `cp -R`s the prepared tree into tmpfs (its bind-mounted + `/work/in` is logically read-only) and executes `run.sh` straight + through. +6. **Verify (host)**. Copy outputs into `build/$ARCH/boot4/`. The + smoke-test `hello` was already executed inside the container as + the last line of `run.sh`. + +`musl`'s own `configure` script is **not run** — it only produces +`config.mak`, which we don't read. boot4 supplies its own hardcoded +`CFLAGS_BASE`. Assembler inputs must not receive the va-list shim. tcc 0.9.26 applies `-include` to `.s`/`.S` as well as `.c`, so boot4 keeps separate @@ -91,13 +129,29 @@ Required tcc fixes live under `scripts/simple-patches/tcc-0.9.26/`. The musl build depends on the aarch64 literal-address load/store fixes and the LP64 `L`-suffix constant fix. +## Calibration + +`scripts/boot4-calibrate.sh <arch>` produces +`vendor/upstream/musl-1.2.5-skip-$arch.txt`, the list of musl sources +tcc 0.9.26 cannot compile for that arch. It runs the legacy skip-on-fail +loop in the container once and captures the failures. + +Re-run calibration whenever any of these change: +- the tcc patches under `scripts/simple-patches/tcc-0.9.26/`; +- the musl overrides or deletes; +- the vendored tcc or musl source tarballs. + +The calibration list lets `boot4.sh` emit a flat `run.sh` whose compile +loop has no `if $TCC … ; then ok else skip fi` branch — every emitted +command is expected to succeed. + ## Status -| arch | result | skipped sources | -|------|--------|-----------------| -| `amd64` | verified | 11 | -| `aarch64` | verified | 8 | -| `riscv64` | verified | 3 | +| arch | calibration vendored | skipped sources | +|------|----------------------|-----------------| +| `aarch64` | yes | 8 | +| `amd64` | pending — run `scripts/boot4-calibrate.sh amd64` | — | +| `riscv64` | pending — run `scripts/boot4-calibrate.sh riscv64` | — | Skipped sources are outside the boot4 hello closure. They fall into two categories: @@ -114,6 +168,10 @@ smoke program, not full musl conformance. Successful boot4 ends by running: ```text -hello from boot4 (tcc-built musl); argc=4 +hello from tcc-built libc; argc=4 strdup: works, strlen: 5 ``` + +(The same `hello` source, `scripts/boot-hello.c`, is also linked and +run by boot3 against the mes-libc closure — proving both libc closures +are exec-correct under their respective build systems.) diff --git a/scripts/boot0.sh b/scripts/boot0.sh @@ -65,14 +65,16 @@ for f in hex0-seed hex0.hex0 hex1.hex0 hex2.hex1 catm.hex2 M0.hex2 ELF.hex2; do cp "$SEED/$f" "$STAGE/in/$f" done -# ── run the seed chain in the scratch container ─────────────────────── +# ── materialize the container's run.sh into staging ─────────────────── +# Each boot stage writes the script the container will execute as a +# concrete file under $STAGE/in/run.sh, then `podman run` just sh's it. +# Easier to inspect/diff than a heredoc; matches how boot3/boot4 emit +# their host-generated run.sh. +cat > "$STAGE/in/run.sh" <<'RUN' +#!/bin/sh +set -eu # The stage0 tools do one syscall per byte. Build everything in /tmp # (RAM tmpfs from --tmpfs) and only cp the final binaries to /work/out. -echo "[boot0 $ARCH] hex0-seed -> hex0 -> hex1 -> hex2 -> catm -> M0" -podman run --rm -i --pull=never --platform "$PLATFORM" \ - --tmpfs /tmp:size=512M \ - -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ - sh -eu -s <<'CONTAINER' chmod +x /work/in/hex0-seed /work/in/hex0-seed /work/in/hex0.hex0 /tmp/hex0 chmod +x /tmp/hex0 @@ -86,7 +88,15 @@ chmod +x /tmp/catm /tmp/hex2 /tmp/M0.combined.hex2 /tmp/M0 chmod +x /tmp/M0 cp /tmp/hex2 /tmp/catm /tmp/M0 /work/out/ -CONTAINER +RUN +chmod +x "$STAGE/in/run.sh" + +# ── run the seed chain in the scratch container ─────────────────────── +echo "[boot0 $ARCH] hex0-seed -> hex0 -> hex1 -> hex2 -> catm -> M0" +podman run --rm -i --pull=never --platform "$PLATFORM" \ + --tmpfs /tmp:size=512M \ + -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ + sh -eu /work/in/run.sh # ── copy outputs to final destination ───────────────────────────────── for f in hex2 catm M0; do diff --git a/scripts/boot1.sh b/scripts/boot1.sh @@ -99,23 +99,26 @@ cp "vendor/seed/$ARCH/ELF.hex2" "$STAGE/in/ELF.hex2" # # Stages everything through /tmp because the M0/hex2 seed tools do one # syscall per byte; virtiofs round-trips would dominate. -echo "[boot1 $ARCH] M1pp.P1 + hex2pp.P1 -> M1pp + hex2pp; catm.P1pp -> catm" -podman run --rm -i --pull=never --platform "$PLATFORM" \ - --tmpfs /tmp:size=512M \ - -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ - sh -eu -s <<'CONTAINER' -# .P1 -> ELF via M0 + hex2 (seed). -build_p1() { - src=$1 - out=$2 - /work/in/catm /tmp/combined.M1 /work/in/P1.M1 "/work/in/$src" - /work/in/M0 /tmp/combined.M1 /tmp/prog.hex2 - /work/in/catm /tmp/linked.hex2 /work/in/ELF.hex2 /tmp/prog.hex2 - /work/in/hex2 /tmp/linked.hex2 "/work/out/$out" - chmod +x "/work/out/$out" -} -build_p1 M1pp.P1 M1pp -build_p1 hex2pp.P1 hex2pp +cat > "$STAGE/in/run.sh" <<'RUN' +#!/bin/sh +set -eu +# .P1 -> ELF via M0 + hex2 (seed). Two of these — for M1pp and hex2pp. +# Inlined (no function) so the container shell sees only sequential +# exec — kaem-friendly. + +# M1pp.P1 -> M1pp +/work/in/catm /tmp/combined.M1 /work/in/P1.M1 /work/in/M1pp.P1 +/work/in/M0 /tmp/combined.M1 /tmp/prog.hex2 +/work/in/catm /tmp/linked.hex2 /work/in/ELF.hex2 /tmp/prog.hex2 +/work/in/hex2 /tmp/linked.hex2 /work/out/M1pp +chmod +x /work/out/M1pp + +# hex2pp.P1 -> hex2pp +/work/in/catm /tmp/combined.M1 /work/in/P1.M1 /work/in/hex2pp.P1 +/work/in/M0 /tmp/combined.M1 /tmp/prog.hex2 +/work/in/catm /tmp/linked.hex2 /work/in/ELF.hex2 /tmp/prog.hex2 +/work/in/hex2 /tmp/linked.hex2 /work/out/hex2pp +chmod +x /work/out/hex2pp # .P1pp -> ELF via the just-built M1pp + hex2pp. catm-from-boot0 still # does the M1/hex2 concatenation; the produced binary then replaces it @@ -126,7 +129,14 @@ build_p1 hex2pp.P1 hex2pp /work/out/M1pp /tmp/combined.M1pp /tmp/expanded.hex2pp /work/in/catm /tmp/linked.hex2pp /work/in/ELF.hex2 /tmp/expanded.hex2pp /work/out/hex2pp -B 0x600000 /tmp/linked.hex2pp /work/out/catm -CONTAINER +RUN +chmod +x "$STAGE/in/run.sh" + +echo "[boot1 $ARCH] M1pp.P1 + hex2pp.P1 -> M1pp + hex2pp; catm.P1pp -> catm" +podman run --rm -i --pull=never --platform "$PLATFORM" \ + --tmpfs /tmp:size=512M \ + -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ + sh -eu /work/in/run.sh # ── copy outputs to final destination ───────────────────────────────── for f in M1pp hex2pp catm; do diff --git a/scripts/boot2.sh b/scripts/boot2.sh @@ -77,18 +77,23 @@ cp "vendor/seed/$ARCH/ELF.hex2" "$STAGE/in/ELF.hex2" # M1pp combined.M1pp -> expanded.hex2pp # catm linked.hex2pp ELF.hex2 expanded.hex2pp # hex2pp -B 0x600000 linked.hex2pp -> ELF binary -echo "[boot2 $ARCH] scheme1.P1pp -> scheme1" -podman run --rm -i --pull=never --platform "$PLATFORM" \ - --tmpfs /tmp:size=512M \ - -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ - sh -eu -s <<'CONTAINER' +cat > "$STAGE/in/run.sh" <<'RUN' +#!/bin/sh +set -eu /work/in/catm /tmp/combined.M1pp \ /work/in/backend.M1pp /work/in/frontend.M1pp \ /work/in/libp1pp.P1pp /work/in/scheme1.P1pp /work/in/M1pp /tmp/combined.M1pp /tmp/expanded.hex2pp /work/in/catm /tmp/linked.hex2pp /work/in/ELF.hex2 /tmp/expanded.hex2pp /work/in/hex2pp -B 0x600000 /tmp/linked.hex2pp /work/out/scheme1 -CONTAINER +RUN +chmod +x "$STAGE/in/run.sh" + +echo "[boot2 $ARCH] scheme1.P1pp -> scheme1" +podman run --rm -i --pull=never --platform "$PLATFORM" \ + --tmpfs /tmp:size=512M \ + -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ + sh -eu /work/in/run.sh # ── copy output to final destination ────────────────────────────────── cp "$STAGE/out/scheme1" "$OUT/scheme1" diff --git a/scripts/boot3.sh b/scripts/boot3.sh @@ -195,8 +195,11 @@ cp "tcc-libc/$ARCH/sys_stubs.S" "$STAGE/in/sys_stubs.S" cp tcc-libc/va_list_shim.h "$STAGE/in/va_list_shim.h" cp tcc-cc/mem.c "$STAGE/in/mem.c" -# Per-arch libtcc1 helper source -cp "$TCC_DIR/lib/$LIB_HELPER_SRC" "$STAGE/in/$LIB_HELPER_SRC" +# Per-arch libtcc1 helper sources. LIB_HELPER_SRC is always also in +# LIBTCC1_C_SRCS (lib-arm64.c on aarch64/riscv64, va_list.c on amd64), +# so a single staging path under tcc-lib/ covers both consumers — the +# emit_helpers step (uses LIB_HELPER_SRC) and the emit_archive step +# (iterates LIBTCC1_C_SRCS + LIBTCC1_ASM_SRCS). for f in $LIBTCC1_C_SRCS $LIBTCC1_ASM_SRCS; do cp "$TCC_DIR/lib/$f" "$STAGE/in/tcc-lib/$f" done @@ -215,154 +218,111 @@ cp scripts/boot-hello.c "$STAGE/in/hello.c" # Every arch's tcc-boot2 has CONFIG_TCC_ASM and assembles .S inputs # itself inside the container — no host cross-asm step. -# ── run the full Stage A + B + C + D + E pipeline in one container ─── -# Stage A: cc.scm bundle, libc.P1pp + tcc.flat.P1pp via scheme1 + cc.scm, +# ── emit flat container build script ────────────────────────────────── +# Generates a straight-line shell program: cc.scm bundle → tcc0 → tcc1 +# → tcc2 → tcc3 with all per-stage repetition unrolled and per-arch +# values (LIB_HELPER_SRC/OBJ, LIBTCC1_C_SRCS, LIBTCC1_ASM_SRCS, etc.) +# resolved on the host. Container shell sees only sequential exec — +# no functions, no for-loops, no parameter expansion. +# +# Stage A: cc.scm bundle, libc.P1pp + tcc.flat.P1pp via scheme1+cc.scm, # link tcc0 ELF via M1pp + hex2pp. -# Stage B: tcc0 builds mem.o, libc.o, helper.o (va_list or lib-arm64). +# Stage B: tcc0 builds mem.o, libc.o, helper.o. # Stage C: tcc0 compiles+links tcc1. -# Stage D: tcc1 rebuilds helpers, compiles+links tcc2. -# Stage E: tcc2 rebuilds helpers, compiles+links tcc3; the script -# then asserts tcc2 == tcc3 (the fixed-point check). -echo "[boot3 $ARCH] cc.scm -> tcc0 -> tcc1 -> tcc2 -> tcc3" -podman run --rm -i --pull=never --platform "$PLATFORM" \ - --tmpfs /tmp:size=1024M \ - -e LIB_HELPER_SRC="$LIB_HELPER_SRC" \ - -e LIB_HELPER_OBJ="$LIB_HELPER_OBJ" \ - -e LIB_HELPER_DEFINES="$LIB_HELPER_DEFINES" \ - -e LIBTCC1_C_SRCS="$LIBTCC1_C_SRCS" \ - -e LIBTCC1_C_DEFS="$LIBTCC1_C_DEFS" \ - -e LIBTCC1_ASM_SRCS="$LIBTCC1_ASM_SRCS" \ - -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ - sh -eu -s <<'CONTAINER' -IN=/work/in -OUT=/work/out -TCC_INC=$IN/tcc-include -MES_INC=$IN/mes-include - -# ── Stage A.1: catm cc.scm bundle ───────────────────────────────────── -$IN/catm /tmp/cc-bundled.scm $IN/prelude.scm $IN/cc.scm $IN/main.scm - -# ── Stage A.2: scheme1 + cc.scm -> libc.P1pp ────────────────────────── -$IN/scheme1 /tmp/cc-bundled.scm --lib=libc__ $IN/libc.flat.c /tmp/libc.P1pp - -# ── Stage A.3: scheme1 + cc.scm -> tcc.flat.P1pp ────────────────────── -$IN/scheme1 /tmp/cc-bundled.scm --lib=tcc__ $IN/tcc.flat.c /tmp/tcc.flat.P1pp - -# ── Stage A.4: M1pp + hex2pp pipeline -> tcc0 ELF ───────────────────── -$IN/catm /tmp/combined.M1pp \ - $IN/backend.M1pp $IN/frontend.M1pp $IN/libp1pp.P1pp \ - $IN/entry-libc.P1pp /tmp/libc.P1pp /tmp/tcc.flat.P1pp $IN/elf-end.P1pp -$IN/M1pp /tmp/combined.M1pp /tmp/expanded.hex2pp -$IN/catm /tmp/linked.hex2pp $IN/ELF.hex2 /tmp/expanded.hex2pp -$IN/hex2pp -B 0x600000 /tmp/linked.hex2pp $OUT/tcc0 - -# ── Stage B: tcc0 builds helper objects ─────────────────────────────── -# build_asm produces start.o + sys_stubs.o into $workdir. amd64/riscv64 -# assemble .S in-container via tcc's CONFIG_TCC_ASM (no -include flag — -# the asm parser doesn't accept C typedefs from va_list_shim.h's -# transitive stdarg.h include). aarch64 has no in-tcc assembler, so the -# host-built .o is copied through from $IN. -build_asm() { - cc=$1; workdir=$2 - "$cc" -nostdlib -c -o "$workdir/start.o" "$IN/start.S" - "$cc" -nostdlib -c -o "$workdir/sys_stubs.o" "$IN/sys_stubs.S" -} -build_helpers() { - cc=$1; workdir=$2 - "$cc" -nostdlib -I "$TCC_INC" -c -o "$workdir/mem.o" $IN/mem.c - "$cc" -nostdlib -I "$TCC_INC" -include $IN/va_list_shim.h \ - -c -o "$workdir/libc.o" $IN/libc.flat.c - # shellcheck disable=SC2086 # LIB_HELPER_DEFINES intentionally word-split - "$cc" -nostdlib -I "$TCC_INC" $LIB_HELPER_DEFINES \ - -c -o "$workdir/$LIB_HELPER_OBJ" "$IN/$LIB_HELPER_SRC" +# Stage D: tcc1 rebuilds helpers, archives, compiles+links tcc2. +# Stage E: tcc2 rebuilds helpers, archives, compiles+links tcc3 (host +# asserts tcc2 == tcc3 after container exits). + +# Helper: emit the build_asm + build_helpers + archive_runtime closure +# for one stage. $1 = compiler (path inside container), $2 = workdir. +emit_helpers () { + cc=$1 + workdir=$2 + echo "$cc -nostdlib -c -o $workdir/start.o /work/in/start.S" + echo "$cc -nostdlib -c -o $workdir/sys_stubs.o /work/in/sys_stubs.S" + echo "$cc -nostdlib -I /work/in/tcc-include -c -o $workdir/mem.o /work/in/mem.c" + echo "$cc -nostdlib -I /work/in/tcc-include -include /work/in/va_list_shim.h -c -o $workdir/libc.o /work/in/libc.flat.c" + echo "$cc -nostdlib -I /work/in/tcc-include $LIB_HELPER_DEFINES -c -o $workdir/$LIB_HELPER_OBJ /work/in/tcc-lib/$LIB_HELPER_SRC" } -build_libtcc1() { - cc=$1; workdir=$2; out=$3 - mkdir -p "$workdir" - objs="" - # shellcheck disable=SC2086 # LIBTCC1_C_SRCS intentionally word-split +emit_archive () { + cc=$1 + workdir=$2 + libtcc1_objs="" + echo "cp $workdir/start.o $workdir/crt1.o" + echo "$cc -ar rcs $workdir/libc.a $workdir/sys_stubs.o $workdir/mem.o $workdir/libc.o" + echo "mkdir -p $workdir/libtcc1-obj" for src in $LIBTCC1_C_SRCS; do - obj="$workdir/${src%.c}.o" - # shellcheck disable=SC2086 # LIBTCC1_C_DEFS intentionally word-split - "$cc" -nostdlib -I "$TCC_INC" $LIBTCC1_C_DEFS \ - -c -o "$obj" "$IN/tcc-lib/$src" - objs="$objs $obj" + obj=$workdir/libtcc1-obj/${src%.c}.o + echo "$cc -nostdlib -I /work/in/tcc-include $LIBTCC1_C_DEFS -c -o $obj /work/in/tcc-lib/$src" + libtcc1_objs="$libtcc1_objs $obj" done - # shellcheck disable=SC2086 # LIBTCC1_ASM_SRCS intentionally word-split for src in $LIBTCC1_ASM_SRCS; do - obj="$workdir/${src%.S}.o" - "$cc" -nostdlib -c -o "$obj" "$IN/tcc-lib/$src" - objs="$objs $obj" + obj=$workdir/libtcc1-obj/${src%.S}.o + echo "$cc -nostdlib -c -o $obj /work/in/tcc-lib/$src" + libtcc1_objs="$libtcc1_objs $obj" done - # shellcheck disable=SC2086 # archive object list intentionally word-split - "$cc" -ar rcs "$out" $objs + echo "$cc -ar rcs $workdir/libtcc1.a$libtcc1_objs" } -archive_runtime() { - cc=$1; workdir=$2 - cp "$workdir/start.o" "$workdir/crt1.o" - "$cc" -ar rcs "$workdir/libc.a" \ - "$workdir/sys_stubs.o" "$workdir/mem.o" "$workdir/libc.o" - build_libtcc1 "$cc" "$workdir/libtcc1-obj" "$workdir/libtcc1.a" +emit_link_tcc () { + cc=$1 + workdir=$2 + out=$3 + echo "$cc -nostdlib -I /work/in/tcc-include -include /work/in/va_list_shim.h $workdir/crt1.o /work/in/tcc.flat.c $workdir/libc.a $workdir/libtcc1.a $workdir/libc.a -o $out" } -link_tcc_with_runtime() { - cc=$1; workdir=$2; out=$3 - "$cc" -nostdlib -I "$TCC_INC" -include "$IN/va_list_shim.h" \ - "$workdir/crt1.o" "$IN/tcc.flat.c" \ - "$workdir/libc.a" "$workdir/libtcc1.a" "$workdir/libc.a" \ - -o "$out" -} -mkdir -p /tmp/stage1 /tmp/stage2 /tmp/stage3 -build_asm $OUT/tcc0 /tmp/stage1 -build_helpers $OUT/tcc0 /tmp/stage1 - -# ── Stage C: tcc0 -> tcc1 ───────────────────────────────────────────── -$OUT/tcc0 -nostdlib -I "$TCC_INC" -include $IN/va_list_shim.h \ - /tmp/stage1/start.o /tmp/stage1/sys_stubs.o \ - /tmp/stage1/mem.o /tmp/stage1/libc.o \ - /tmp/stage1/$LIB_HELPER_OBJ \ - $IN/tcc.flat.c -o $OUT/tcc1 -chmod +x $OUT/tcc1 - -# ── Stage D: tcc1 rebuilds helpers, links tcc2 ──────────────────────── -build_asm $OUT/tcc1 /tmp/stage2 -build_helpers $OUT/tcc1 /tmp/stage2 -archive_runtime $OUT/tcc1 /tmp/stage2 -link_tcc_with_runtime $OUT/tcc1 /tmp/stage2 $OUT/tcc2 -chmod +x $OUT/tcc2 - -# ── Stage E: tcc2 rebuilds the runtime closure, links tcc3 ──────────── -# Self-host idempotence check: tcc2 compiling itself with the same -# source + crt1.o + libc.a + libtcc1.a shape used for tcc2 must produce -# a byte-identical binary. This is the real bootstrap fixed point — -# tcc0 → tcc1 isn't expected to converge because cc.scm's emitted -# machine code introduces subtle codegen differences in tcc0's behavior, -# but from tcc1 onward the chain is tcc compiling tcc. -build_asm $OUT/tcc2 /tmp/stage3 -build_helpers $OUT/tcc2 /tmp/stage3 -archive_runtime $OUT/tcc2 /tmp/stage3 -link_tcc_with_runtime $OUT/tcc2 /tmp/stage3 $OUT/tcc3 -chmod +x $OUT/tcc3 - -# Fixed-point check (tcc2 == tcc3) is performed on the host after this -# container exits — both files are emitted to /work/out so the host can -# cmp them. Same for size reporting (no wc inside the container). -# -# Publish the tcc2-built mes-libc link closure and prove it can link -# and run a normal C program. tcc2 and tcc3 will be byte-identical -# (asserted on the host); rebuilding these artifacts with tcc3 would -# only repeat the same fixed-point compiler cycle. crt1.o is kept -# separate because it must lead the final link; the rest of the runtime -# is hidden behind libc.a. -cp /tmp/stage3/crt1.o /tmp/stage3/libc.a /tmp/stage3/libtcc1.a "$OUT/" -"$OUT/tcc2" -nostdlib -I "$TCC_INC" -I "$MES_INC" \ - "$OUT/crt1.o" "$IN/hello.c" \ - "$OUT/libc.a" "$OUT/libtcc1.a" "$OUT/libc.a" \ - -o "$OUT/hello" -chmod +x "$OUT/hello" -echo "--- run ---" -"$OUT/hello" a b c -CONTAINER +RUN_SCRIPT=$STAGE/in/run.sh +{ + echo '#!/bin/sh' + echo 'set -eu' + echo + echo '# Stage A: cc.scm bundle -> tcc0 ELF' + echo '/work/in/catm /tmp/cc-bundled.scm /work/in/prelude.scm /work/in/cc.scm /work/in/main.scm' + echo '/work/in/scheme1 /tmp/cc-bundled.scm --lib=libc__ /work/in/libc.flat.c /tmp/libc.P1pp' + echo '/work/in/scheme1 /tmp/cc-bundled.scm --lib=tcc__ /work/in/tcc.flat.c /tmp/tcc.flat.P1pp' + echo '/work/in/catm /tmp/combined.M1pp /work/in/backend.M1pp /work/in/frontend.M1pp /work/in/libp1pp.P1pp /work/in/entry-libc.P1pp /tmp/libc.P1pp /tmp/tcc.flat.P1pp /work/in/elf-end.P1pp' + echo '/work/in/M1pp /tmp/combined.M1pp /tmp/expanded.hex2pp' + echo '/work/in/catm /tmp/linked.hex2pp /work/in/ELF.hex2 /tmp/expanded.hex2pp' + echo '/work/in/hex2pp -B 0x600000 /tmp/linked.hex2pp /work/out/tcc0' + echo + echo '# Stage B: tcc0 builds helper objects (stage1)' + echo 'mkdir -p /tmp/stage1 /tmp/stage2 /tmp/stage3' + emit_helpers /work/out/tcc0 /tmp/stage1 + echo + echo '# Stage C: tcc0 -> tcc1 (link with raw .o files; no archive yet)' + echo "/work/out/tcc0 -nostdlib -I /work/in/tcc-include -include /work/in/va_list_shim.h /tmp/stage1/start.o /tmp/stage1/sys_stubs.o /tmp/stage1/mem.o /tmp/stage1/libc.o /tmp/stage1/$LIB_HELPER_OBJ /work/in/tcc.flat.c -o /work/out/tcc1" + echo 'chmod +x /work/out/tcc1' + echo + echo '# Stage D: tcc1 rebuilds helpers + archive, links tcc2' + emit_helpers /work/out/tcc1 /tmp/stage2 + emit_archive /work/out/tcc1 /tmp/stage2 + emit_link_tcc /work/out/tcc1 /tmp/stage2 /work/out/tcc2 + echo 'chmod +x /work/out/tcc2' + echo + echo '# Stage E: tcc2 rebuilds helpers + archive, links tcc3.' + echo '# (Host asserts tcc2 == tcc3 after the container exits.)' + emit_helpers /work/out/tcc2 /tmp/stage3 + emit_archive /work/out/tcc2 /tmp/stage3 + emit_link_tcc /work/out/tcc2 /tmp/stage3 /work/out/tcc3 + echo 'chmod +x /work/out/tcc3' + echo + echo '# Publish the tcc2-built mes-libc link closure + smoke-test hello.' + echo '# (tcc2 and tcc3 are byte-identical by the fixed-point check, so' + echo '# rebuilding with tcc3 would only repeat the cycle.)' + echo 'cp /tmp/stage3/crt1.o /tmp/stage3/libc.a /tmp/stage3/libtcc1.a /work/out/' + echo '/work/out/tcc2 -nostdlib -I /work/in/tcc-include -I /work/in/mes-include /work/out/crt1.o /work/in/hello.c /work/out/libc.a /work/out/libtcc1.a /work/out/libc.a -o /work/out/hello' + echo 'chmod +x /work/out/hello' + echo 'echo "--- run ---"' + echo '/work/out/hello a b c' +} > "$RUN_SCRIPT" +chmod +x "$RUN_SCRIPT" +echo "[boot3 $ARCH] generated run.sh: $(wc -l <"$RUN_SCRIPT") lines" + +# ── run flat build script in scratch+busybox container ──────────────── +echo "[boot3 $ARCH] cc.scm -> tcc0 -> tcc1 -> tcc2 -> tcc3" +podman run --rm -i --pull=never --platform "$PLATFORM" \ + --tmpfs /tmp:size=1024M \ + -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ + sh -eu /work/in/run.sh # ── fixed-point check (host-side; container has no cmp) ────────────── if ! cmp -s "$STAGE/out/tcc2" "$STAGE/out/tcc3"; then diff --git a/scripts/boot4-calibrate.sh b/scripts/boot4-calibrate.sh @@ -0,0 +1,167 @@ +#!/bin/sh +## boot4-calibrate.sh — produce vendor/upstream/musl-1.2.5-skip-$ARCH.txt +## +## NOT on the boot.sh path. Generates the per-arch calibration list +## boot4.sh uses to drop skip-on-fail logic from the container. Run +## this once per architecture when the patch set, calibration arch, or +## tcc version changes; commit the resulting file alongside the rest of +## the vendored musl artifacts. +## +## What it does: +## 1. Stage the same prerequisites boot4.sh stages (boot3/tcc3, +## libtcc1.a, vendored overrides + deletes, pre-generated headers, +## shim). +## 2. Run a skip-on-fail compile loop in the container over every +## musl source. Whatever tcc 0.9.26 cannot compile gets recorded. +## 3. Copy the resulting skip list out to +## vendor/upstream/musl-1.2.5-skip-$ARCH.txt. +## +## Boot4.sh then enumerates sources on the host and subtracts this +## list, emitting a flat sequential build script with no in-container +## branch on $TCC's exit code. +## +## Usage: scripts/boot4-calibrate.sh <amd64|aarch64|riscv64> + +set -eu + +usage() { echo "usage: $0 <amd64|aarch64|riscv64>" >&2; exit 2; } +[ "$#" -eq 1 ] || usage +ARCH=$1 + +case "$ARCH" in + amd64) PLATFORM=linux/amd64; TCC_TARGET=X86_64; MUSL_ARCH=x86_64 ;; + aarch64) PLATFORM=linux/arm64; TCC_TARGET=ARM64; MUSL_ARCH=aarch64 ;; + riscv64) PLATFORM=linux/riscv64; TCC_TARGET=RISCV64; MUSL_ARCH=riscv64 ;; + *) usage ;; +esac + +ROOT=$(cd "$(dirname "$0")/.." && pwd) +cd "$ROOT" + +IMAGE=boot2-scratch:$ARCH +BOOT3=build/$ARCH/boot3 +STAGE=build/$ARCH/.boot4-calibrate +TCC_DIR=build/tcc/$TCC_TARGET/tcc-0.9.26-1147-gee75a10c +MUSL_TARBALL=vendor/upstream/musl-1.2.5.tar.gz +MUSL_OVERRIDES=vendor/upstream/musl-1.2.5-overrides +MUSL_DELETES=vendor/upstream/musl-1.2.5-deletes.txt +MUSL_GENERATED=vendor/upstream/musl-1.2.5-generated/$MUSL_ARCH +SHIM_FILE=scripts/boot4-musl-shim-$ARCH.h +SKIP_OUT=vendor/upstream/musl-1.2.5-skip-$ARCH.txt + +[ -x "$BOOT3/tcc3" ] || { echo "missing $BOOT3/tcc3 (run scripts/boot3.sh $ARCH)" >&2; exit 1; } +[ -e "$BOOT3/libtcc1.a" ] || { echo "missing $BOOT3/libtcc1.a" >&2; exit 1; } +[ -d "$TCC_DIR/include" ] || { echo "missing $TCC_DIR/include" >&2; exit 1; } +[ -e "$MUSL_TARBALL" ] || { echo "missing $MUSL_TARBALL" >&2; exit 1; } +[ -d "$MUSL_OVERRIDES" ] || { echo "missing $MUSL_OVERRIDES" >&2; exit 1; } +[ -e "$MUSL_DELETES" ] || { echo "missing $MUSL_DELETES" >&2; exit 1; } +[ -d "$MUSL_GENERATED" ] || { echo "missing $MUSL_GENERATED (run scripts/musl-vendor.sh)" >&2; exit 1; } +[ -e "$SHIM_FILE" ] || { echo "missing $SHIM_FILE" >&2; exit 1; } + +if ! podman image exists "$IMAGE"; then + podman build --platform "$PLATFORM" -t "$IMAGE" \ + -f scripts/Containerfile.scratch scripts/ +fi + +rm -rf "$STAGE" +mkdir -p "$STAGE/in/tcc-include" "$STAGE/out" + +cp "$BOOT3/tcc3" "$STAGE/in/tcc" +cp "$BOOT3/libtcc1.a" "$STAGE/in/libtcc1.a" +cp -R "$TCC_DIR/include/." "$STAGE/in/tcc-include/" +tar xzf "$MUSL_TARBALL" -C "$STAGE/in/" +MUSL_DIR=$STAGE/in/musl-1.2.5 +cp -R "$MUSL_OVERRIDES/." "$MUSL_DIR/" +while read -r p; do + [ -n "$p" ] && rm -rf "$MUSL_DIR/$p" +done < "$MUSL_DELETES" +cp "$SHIM_FILE" "$STAGE/in/musl-shim.h" +cp "$MUSL_GENERATED/alltypes.h" "$STAGE/in/musl-alltypes.h" +cp "$MUSL_GENERATED/syscall.h" "$STAGE/in/musl-syscall.h" + +echo "[calibrate $ARCH] running skip-on-fail compile loop in container" +podman run --rm -i --pull=never --platform "$PLATFORM" \ + --tmpfs /tmp:size=1024M \ + -e MUSL_ARCH="$MUSL_ARCH" \ + -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ + sh -eu -s <<'CONTAINER' +IN=/work/in +OUT=/work/out +TCC=$IN/tcc + +cd /tmp +cp -R "$IN/musl-1.2.5" . +cd musl-1.2.5 + +mkdir -p obj/include/bits obj/src/internal +cp $IN/musl-alltypes.h obj/include/bits/alltypes.h +cp $IN/musl-syscall.h obj/include/bits/syscall.h +echo '#define VERSION "1.2.5-tcc-boot4"' > obj/src/internal/version.h + +CFLAGS_BASE="-std=c99 -nostdinc -ffreestanding -fno-strict-aliasing + -D_XOPEN_SOURCE=700 + -I./arch/$MUSL_ARCH -I./arch/generic -Iobj/src/internal + -I./src/include -I./src/internal -Iobj/include -I./include + -O2 -fomit-frame-pointer + -Werror=implicit-function-declaration -Werror=implicit-int + -Werror=pointer-sign -Werror=pointer-arith" +CFLAGS_C="$CFLAGS_BASE -include $IN/musl-shim.h" +CFLAGS_ASM="$CFLAGS_BASE" + +SRC_TOP="src/aio src/conf src/crypt src/ctype src/dirent + src/env src/errno src/exit src/fcntl src/fenv src/internal + src/ipc src/legacy src/linux src/locale src/malloc + src/malloc/mallocng src/math src/misc src/mman src/mq + src/multibyte src/network src/passwd src/prng src/process + src/regex src/sched src/search src/select src/setjmp src/signal + src/stat src/stdio src/stdlib src/string src/temp src/termios + src/thread src/time src/unistd" + +BASE_SRCS=""; ARCH_SRCS="" +for d in $SRC_TOP; do + [ -d "$d" ] || continue + for f in $d/*.c; do [ -f "$f" ] && BASE_SRCS="$BASE_SRCS $f"; done + for f in $d/$MUSL_ARCH/*.c $d/$MUSL_ARCH/*.s $d/$MUSL_ARCH/*.S; do + [ -f "$f" ] && ARCH_SRCS="$ARCH_SRCS $f" + done +done +REPLACED="" +for a in $ARCH_SRCS; do + p=${a%.*} + head=${p%%/${MUSL_ARCH}/*} + tail=${p#*/${MUSL_ARCH}/} + REPLACED="$REPLACED $head/$tail" +done +KEEP="" +for b in $BASE_SRCS; do + stem=${b%.c}; skip=0 + for r in $REPLACED; do [ "$stem" = "$r" ] && { skip=1; break; }; done + [ $skip -eq 0 ] && KEEP="$KEEP $b" +done +KEEP="$KEEP $ARCH_SRCS" + +mkdir -p obj/lib +n=0; n_ok=0; n_skip=0 +: >$OUT/skipped.txt +for src in $KEEP; do + obj="obj/${src%.*}.o" + mkdir -p "$(dirname $obj)" + case "$src" in + *.c) flags="$CFLAGS_C" ;; + *.s | *.S) flags="$CFLAGS_ASM" ;; + *) flags="$CFLAGS_C" ;; + esac + if $TCC $flags -c "$src" -o "$obj" >/tmp/compile.log 2>&1; then + n_ok=$((n_ok+1)) + else + n_skip=$((n_skip+1)) + echo "$src" >>$OUT/skipped.txt + fi + n=$((n+1)) + [ $((n % 200)) -eq 0 ] && echo " $n done (ok=$n_ok skip=$n_skip)" +done +echo " compiled=$n_ok skipped=$n_skip total=$n" +CONTAINER + +sort -u "$STAGE/out/skipped.txt" > "$SKIP_OUT" +echo "[calibrate $ARCH] wrote $SKIP_OUT ($(wc -l <"$SKIP_OUT") entries)" diff --git a/scripts/boot4.sh b/scripts/boot4.sh @@ -12,8 +12,6 @@ ## — boot3's verified self-host tcc ## build/$ARCH/boot3/libtcc1.a ## — boot3's tcc runtime archive -## build/tcc/$TCC_TARGET/tcc-0.9.26-1147-gee75a10c/include -## — staged by stage1-flatten.sh during boot3 ## vendor/upstream/musl-1.2.5.tar.gz ## — pristine musl source ## vendor/upstream/musl-1.2.5-overrides/ @@ -45,24 +43,10 @@ usage() { echo "usage: $0 <amd64|aarch64|riscv64>" >&2; exit 2; } ARCH=$1 case "$ARCH" in - amd64) - PLATFORM=linux/amd64 - TCC_TARGET=X86_64 - MUSL_ARCH=x86_64 - ;; - aarch64) - PLATFORM=linux/arm64 - TCC_TARGET=ARM64 - MUSL_ARCH=aarch64 - ;; - riscv64) - PLATFORM=linux/riscv64 - TCC_TARGET=RISCV64 - MUSL_ARCH=riscv64 - ;; - *) - usage - ;; + amd64) PLATFORM=linux/amd64; MUSL_ARCH=x86_64 ;; + aarch64) PLATFORM=linux/arm64; MUSL_ARCH=aarch64 ;; + riscv64) PLATFORM=linux/riscv64; MUSL_ARCH=riscv64 ;; + *) usage ;; esac ROOT=$(cd "$(dirname "$0")/.." && pwd) @@ -72,19 +56,21 @@ IMAGE=boot2-scratch:$ARCH BOOT3=build/$ARCH/boot3 OUT=build/$ARCH/boot4 STAGE=build/$ARCH/.boot4-stage -TCC_DIR=build/tcc/$TCC_TARGET/tcc-0.9.26-1147-gee75a10c MUSL_TARBALL=vendor/upstream/musl-1.2.5.tar.gz MUSL_OVERRIDES=vendor/upstream/musl-1.2.5-overrides MUSL_DELETES=vendor/upstream/musl-1.2.5-deletes.txt +MUSL_GENERATED=vendor/upstream/musl-1.2.5-generated/$MUSL_ARCH +MUSL_SKIP=vendor/upstream/musl-1.2.5-skip-$ARCH.txt SHIM_FILE=scripts/boot4-musl-shim-$ARCH.h # ── prerequisites ───────────────────────────────────────────────────── [ -x "$BOOT3/tcc3" ] || { echo "[boot4 $ARCH] missing $BOOT3/tcc3 (run scripts/boot3.sh $ARCH)" >&2; exit 1; } [ -e "$BOOT3/libtcc1.a" ] || { echo "[boot4 $ARCH] missing $BOOT3/libtcc1.a (run scripts/boot3.sh $ARCH)" >&2; exit 1; } -[ -d "$TCC_DIR/include" ] || { echo "[boot4 $ARCH] missing $TCC_DIR/include (run scripts/boot3.sh $ARCH first)" >&2; exit 1; } [ -e "$MUSL_TARBALL" ] || { echo "[boot4 $ARCH] missing $MUSL_TARBALL" >&2; exit 1; } [ -d "$MUSL_OVERRIDES" ] || { echo "[boot4 $ARCH] missing $MUSL_OVERRIDES" >&2; exit 1; } [ -e "$MUSL_DELETES" ] || { echo "[boot4 $ARCH] missing $MUSL_DELETES" >&2; exit 1; } +[ -d "$MUSL_GENERATED" ] || { echo "[boot4 $ARCH] missing $MUSL_GENERATED (run scripts/musl-vendor.sh)" >&2; exit 1; } +[ -e "$MUSL_SKIP" ] || { echo "[boot4 $ARCH] missing $MUSL_SKIP (run scripts/boot4-calibrate.sh $ARCH)" >&2; exit 1; } [ -e "$SHIM_FILE" ] || { echo "[boot4 $ARCH] missing $SHIM_FILE" >&2; exit 1; } if ! podman image exists "$IMAGE"; then @@ -94,90 +80,47 @@ if ! podman image exists "$IMAGE"; then fi # ── stage inputs ────────────────────────────────────────────────────── +# $STAGE/in/ — exactly what the container reads (bind-mounted /work/in) +# $STAGE/_host/ — host-side scratch (enumeration outputs, intermediates); +# not visible to the container +# $STAGE/out/ — container writes here rm -rf "$STAGE" -mkdir -p "$STAGE/in/tcc-include" "$STAGE/out" "$OUT" +mkdir -p "$STAGE/in" "$STAGE/_host" "$STAGE/out" "$OUT" rm -f "$OUT/libtcc1.a" -cp "$BOOT3/tcc3" "$STAGE/in/tcc" +cp "$BOOT3/tcc3" "$STAGE/in/tcc" cp "$BOOT3/libtcc1.a" "$STAGE/in/libtcc1.a" -cp -R "$TCC_DIR/include/." "$STAGE/in/tcc-include/" +# (No tcc-include/ stage — boot4 compiles musl, which provides its own +# headers via -I./include / -Iarch/$MUSL_ARCH / -Iarch/generic / -Iobj/include. +# tcc itself is invoked with -nostdinc so it never reads CONFIG_TCCDIR.) -# Extract musl on the host (where tar is always available) instead of -# inside the container — the container has no tar and the unpacked tree -# is read-only input from its perspective. The container cp -R's it to -# /tmp before mutating. +# Extract musl on the host, then apply overrides + deletes on the host +# too — gives us a fully-prepared tree at $STAGE/in/musl-1.2.5/ that we +# can enumerate to drive the (kaem-friendly) flat container script. +# The container then just `cp -R`s the staged tree into tmpfs (its +# bind-mounted /work/in is logically read-only). tar xzf "$MUSL_TARBALL" -C "$STAGE/in/" -cp -R "$MUSL_OVERRIDES" "$STAGE/in/musl-overrides" -cp "$MUSL_DELETES" "$STAGE/in/musl-deletes.txt" -cp "$SHIM_FILE" "$STAGE/in/musl-shim.h" -cp scripts/mkalltypes.awk "$STAGE/in/mkalltypes.awk" - -cp scripts/boot-hello.c "$STAGE/in/hello.c" - -# ── run pipeline in scratch+busybox container ───────────────────────── -echo "[boot4 $ARCH] boot3/libtcc1.a + musl libc.a + crt -> hello" -podman run --rm -i --pull=never --platform "$PLATFORM" \ - --tmpfs /tmp:size=1024M \ - -e ARCH="$ARCH" \ - -e MUSL_ARCH="$MUSL_ARCH" \ - -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ - sh -eu -s <<'CONTAINER' -IN=/work/in -OUT=/work/out -TCC=$IN/tcc -TCC_INC=$IN/tcc-include - -# ── Stage A: stage unpacked musl in tmpfs + apply overrides + deletes ── -# musl-1.2.5/ was extracted on the host (bind-mount is read-only input); -# copy into /tmp so we have a writable working tree, then overlay the -# vendored overrides on top, then remove the files listed in -# musl-deletes.txt. Replaces the old `patch + belt-and-braces rm` block: -# vendoring the post-patch state means no `patch` binary dep and no -# 0-byte-stub cleanup. See vendor/upstream/musl-1.2.5-overrides/ + -# vendor/upstream/musl-1.2.5-deletes.txt for the contents. -cd /tmp -cp -R "$IN/musl-1.2.5" . -cp -R "$IN/musl-overrides/." musl-1.2.5/ +MUSL_DIR=$STAGE/in/musl-1.2.5 +cp -R "$MUSL_OVERRIDES/." "$MUSL_DIR/" while read -r p; do - [ -n "$p" ] && rm -rf "musl-1.2.5/$p" -done < "$IN/musl-deletes.txt" + [ -n "$p" ] && rm -rf "$MUSL_DIR/$p" +done < "$MUSL_DELETES" -# ── Stage B: configure + generate musl headers ──────────────────────── -cd /tmp/musl-1.2.5 -CC=$TCC AR=true RANLIB=true sh ./configure \ - --target=$MUSL_ARCH-linux-musl --disable-shared --disable-wrapper \ - --prefix=/tmp/musl-install >/tmp/cfg.log 2>&1 \ - || { echo "configure failed (see /tmp/cfg.log)"; exit 1; } -echo "configure: ok" +cp "$SHIM_FILE" "$STAGE/in/musl-shim.h" +# Pre-generated alltypes.h + syscall.h for $MUSL_ARCH; replace the +# in-container awk that ran mkalltypes.sed and the SYS_ rewrite. Source +# of truth is scripts/musl-vendor.sh (regenerates these files). +cp "$MUSL_GENERATED/alltypes.h" "$STAGE/in/musl-alltypes.h" +cp "$MUSL_GENERATED/syscall.h" "$STAGE/in/musl-syscall.h" -mkdir -p obj/include/bits obj/src/internal -awk -f $IN/mkalltypes.awk \ - arch/$MUSL_ARCH/bits/alltypes.h.in include/alltypes.h.in \ - > obj/include/bits/alltypes.h -cp arch/$MUSL_ARCH/bits/syscall.h.in obj/include/bits/syscall.h -awk 'sub(/__NR_/, "SYS_") { print }' < arch/$MUSL_ARCH/bits/syscall.h.in \ - >> obj/include/bits/syscall.h -echo '#define VERSION "1.2.5-tcc-boot4"' > obj/src/internal/version.h - -# ── Stage C: compile every musl source ──────────────────────────────── -# NB: -include is applied only to .c sources. tcc 0.9.26 also prepends -# -include content to .s/.S inputs, silently producing a 620-byte ELF -# with no symbols (the C content corrupts the assembler stream). -CFLAGS_BASE="-std=c99 -nostdinc -ffreestanding -fno-strict-aliasing - -D_XOPEN_SOURCE=700 - -I./arch/$MUSL_ARCH -I./arch/generic -Iobj/src/internal - -I./src/include -I./src/internal -Iobj/include -I./include - -O2 -fomit-frame-pointer - -Werror=implicit-function-declaration -Werror=implicit-int - -Werror=pointer-sign -Werror=pointer-arith" -CFLAGS_C="$CFLAGS_BASE -include $IN/musl-shim.h" -CFLAGS_ASM="$CFLAGS_BASE" -CRTFLAGS_C="$CFLAGS_C -fno-stack-protector -DCRT" -CRTFLAGS_ASM="$CFLAGS_ASM -fno-stack-protector -DCRT" -PIC="-fPIC" +cp scripts/boot-hello.c "$STAGE/in/hello.c" -# (ldso/ excluded — that's the dynamic linker, defines __init_array_start -# which collides with what tcc's internal linker synthesizes.) +# ── enumerate musl sources on the host (kaem-friendly: no for/while/ +# case/${%}/${#}/$((..)) inside the container) ─────────────────────── +# Mirrors musl's Makefile rule: a per-arch override (under +# $d/$MUSL_ARCH/) replaces the same-stem base file (under $d/). We +# subtract the calibration skip list so the container script never +# needs an `if $TCC ...; then ok else skip fi` branch. SRC_TOP="src/aio src/conf src/crypt src/ctype src/dirent src/env src/errno src/exit src/fcntl src/fenv src/internal src/ipc src/legacy src/linux src/locale src/malloc @@ -187,88 +130,155 @@ SRC_TOP="src/aio src/conf src/crypt src/ctype src/dirent src/stat src/stdio src/stdlib src/string src/temp src/termios src/thread src/time src/unistd" -# Enumerate sources musl-Makefile-style: per-arch override replaces -# same-stem base file (REPLACED set). -BASE_SRCS=""; ARCH_SRCS="" -for d in $SRC_TOP; do - [ -d "$d" ] || continue - for f in $d/*.c; do [ -f "$f" ] && BASE_SRCS="$BASE_SRCS $f"; done - for f in $d/$MUSL_ARCH/*.c $d/$MUSL_ARCH/*.s $d/$MUSL_ARCH/*.S; do - [ -f "$f" ] && ARCH_SRCS="$ARCH_SRCS $f" +( + cd "$MUSL_DIR" + for d in $SRC_TOP; do + [ -d "$d" ] || continue + for f in $d/*.c; do [ -f "$f" ] && echo "$f"; done done -done -REPLACED="" -for a in $ARCH_SRCS; do - p=${a%.*} - head=${p%%/${MUSL_ARCH}/*} - tail=${p#*/${MUSL_ARCH}/} - REPLACED="$REPLACED $head/$tail" -done -KEEP="" -for b in $BASE_SRCS; do - stem=${b%.c}; skip=0 - for r in $REPLACED; do [ "$stem" = "$r" ] && { skip=1; break; }; done - [ $skip -eq 0 ] && KEEP="$KEEP $b" -done -KEEP="$KEEP $ARCH_SRCS" +) > "$STAGE/_host/base.txt" -echo "compiling musl (skip-on-fail mode)" -mkdir -p obj/lib -OBJS=""; n=0; n_ok=0; n_skip=0 -: >/tmp/skipped.txt -for src in $KEEP; do - obj="obj/${src%.*}.o" - mkdir -p "$(dirname $obj)" - case "$src" in - *.c) flags="$CFLAGS_C" ;; - *.s | *.S) flags="$CFLAGS_ASM" ;; - *) flags="$CFLAGS_C" ;; - esac - if $TCC $flags -c "$src" -o "$obj" >/tmp/compile.log 2>&1; then - OBJS="$OBJS $obj" - n_ok=$((n_ok+1)) - else - n_skip=$((n_skip+1)) - echo "$src" >>/tmp/skipped.txt - fi - n=$((n+1)) - [ $((n % 200)) -eq 0 ] && echo " $n done (ok=$n_ok skip=$n_skip)" -done -echo " compiled=$n_ok skipped=$n_skip total=$n (skips listed in /tmp/skipped.txt)" +( + cd "$MUSL_DIR" + for d in $SRC_TOP; do + [ -d "$d/$MUSL_ARCH" ] || continue + for f in $d/$MUSL_ARCH/*.c $d/$MUSL_ARCH/*.s $d/$MUSL_ARCH/*.S; do + [ -f "$f" ] && echo "$f" + done + done +) > "$STAGE/_host/arch.txt" -# ── Stage D: CRT + libc.a ───────────────────────────────────────────── -# musl's per-arch crti.s/crtn.s wins over the top-level crt/crti.c if -# present; riscv64 has no crt/$MUSL_ARCH/ at all, so it falls back. -mkdir -p lib obj/crt -$TCC $CRTFLAGS_C $PIC -c crt/Scrt1.c -o obj/crt/Scrt1.o -$TCC $CRTFLAGS_C -c crt/crt1.c -o obj/crt/crt1.o -$TCC $CRTFLAGS_C $PIC -c crt/rcrt1.c -o obj/crt/rcrt1.o -if [ -f "crt/$MUSL_ARCH/crti.s" ]; then - $TCC $CRTFLAGS_ASM -c crt/$MUSL_ARCH/crti.s -o obj/crt/crti.o - $TCC $CRTFLAGS_ASM -c crt/$MUSL_ARCH/crtn.s -o obj/crt/crtn.o -else - $TCC $CRTFLAGS_C -c crt/crti.c -o obj/crt/crti.o - $TCC $CRTFLAGS_C -c crt/crtn.c -o obj/crt/crtn.o -fi -cp obj/crt/Scrt1.o obj/crt/crt1.o obj/crt/rcrt1.o obj/crt/crti.o obj/crt/crtn.o lib/ +# REPLACED: bases that have arch-specific overrides (drop them from +# BASE). KEEP = (BASE - REPLACED) ∪ ARCH, then minus calibration skips. +awk -v ARCH="$MUSL_ARCH" ' + { + sub(/\.[^.]*$/, "") # strip extension + slot = "/" ARCH "/" + i = index($0, slot) + head = substr($0, 1, i - 1) + tail = substr($0, i + length(slot)) + print head "/" tail + } +' "$STAGE/_host/arch.txt" | sort -u > "$STAGE/_host/replaced.txt" + +# Filter base by removing stems that appear in replaced. +awk -v REPF="$STAGE/_host/replaced.txt" ' + BEGIN { while ((getline l < REPF) > 0) rep[l] = 1 } + { + stem = $0 + sub(/\.c$/, "", stem) + if (!(stem in rep)) print + } +' "$STAGE/_host/base.txt" > "$STAGE/_host/keep_base.txt" + +cat "$STAGE/_host/keep_base.txt" "$STAGE/_host/arch.txt" | sort -u > "$STAGE/_host/keep.txt" -echo "archiving libc.a" -$TCC -ar rcs lib/libc.a $OBJS +# Subtract the calibration skip list. Lines without a / are bogus; the +# skip file is one path per line, comments allowed via leading '#'. +awk -v SKIPF="$MUSL_SKIP" ' + BEGIN { while ((getline l < SKIPF) > 0) if (l !~ /^#/ && l != "") skip[l] = 1 } + { if (!($0 in skip)) print } +' "$STAGE/_host/keep.txt" > "$STAGE/_host/build-srcs.txt" + +# Per-source-dir mkdir list (unique, for `mkdir -p obj/...`). +awk ' + { + sub(/\.[^.]*$/, "") + if (match($0, /\/[^\/]*$/)) print "obj/" substr($0, 1, RSTART - 1) + } +' "$STAGE/_host/build-srcs.txt" | sort -u > "$STAGE/_host/build-objdirs.txt" + +n_src=$(wc -l < "$STAGE/_host/build-srcs.txt") +n_skip=$(wc -l < "$MUSL_SKIP") +echo "[boot4 $ARCH] keep=$n_src skip=$n_skip (calibrated)" + +# ── emit flat container build script ────────────────────────────────── +# Generates a straight-line shell program: cd, mkdir, cp, then one tcc +# invocation per source, then ar, then link+run hello. No control flow +# beyond sequential exec; suitable for a kaem-class shell. +CFLAGS_BASE="-std=c99 -nostdinc -ffreestanding -fno-strict-aliasing -D_XOPEN_SOURCE=700 -I./arch/$MUSL_ARCH -I./arch/generic -Iobj/src/internal -I./src/include -I./src/internal -Iobj/include -I./include -O2 -fomit-frame-pointer -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith" +CFLAGS_C="$CFLAGS_BASE -include /work/in/musl-shim.h" +CFLAGS_ASM="$CFLAGS_BASE" +CRTFLAGS_C="$CFLAGS_C -fno-stack-protector -DCRT" +CRTFLAGS_ASM="$CFLAGS_ASM -fno-stack-protector -DCRT" -cp lib/libc.a lib/crt1.o lib/crti.o lib/crtn.o "$OUT/" +# Resolve the per-arch CRT branch on the host (eliminates the in- +# container if/then/else). +if [ -f "$MUSL_DIR/crt/$MUSL_ARCH/crti.s" ]; then + CRT_LINES_TXT=$(printf '%s\n' \ + "/work/in/tcc $CRTFLAGS_ASM -c crt/$MUSL_ARCH/crti.s -o obj/crt/crti.o" \ + "/work/in/tcc $CRTFLAGS_ASM -c crt/$MUSL_ARCH/crtn.s -o obj/crt/crtn.o") +else + CRT_LINES_TXT=$(printf '%s\n' \ + "/work/in/tcc $CRTFLAGS_C -c crt/crti.c -o obj/crt/crti.o" \ + "/work/in/tcc $CRTFLAGS_C -c crt/crtn.c -o obj/crt/crtn.o") +fi -# ── Stage E: smoke test — link + run hello ──────────────────────────── -# Size reporting (wc) is done on the host after this container exits. -$TCC -static -nostdinc -nostdlib \ - -include "$IN/musl-shim.h" \ - -I./include -I./arch/$MUSL_ARCH -I./arch/generic -Iobj/include \ - lib/crt1.o "$IN/hello.c" \ - -L./lib -lc -L"$IN" -ltcc1 -L./lib -lc \ - -o "$OUT/hello" +RUN_SCRIPT=$STAGE/in/run.sh +{ + echo '#!/bin/sh' + echo 'set -eu' + echo + echo '# stage A: working tree in tmpfs' + echo 'cd /tmp' + echo 'cp -R /work/in/musl-1.2.5 .' + echo 'cd musl-1.2.5' + echo + echo '# stage B: pre-generated headers + version stamp' + echo 'mkdir -p obj/include/bits obj/src/internal obj/lib obj/crt lib' + echo 'cp /work/in/musl-alltypes.h obj/include/bits/alltypes.h' + echo 'cp /work/in/musl-syscall.h obj/include/bits/syscall.h' + echo "echo '#define VERSION \"1.2.5-tcc-boot4\"' > obj/src/internal/version.h" + echo + echo '# per-source obj directories' + while read -r d; do echo "mkdir -p $d"; done < "$STAGE/_host/build-objdirs.txt" + echo + echo "# stage C: compile sources ($n_src after calibration)" + awk -v CC=/work/in/tcc -v CF="$CFLAGS_C" -v AF="$CFLAGS_ASM" ' + { + src = $0 + obj = "obj/" src + sub(/\.[^.]*$/, ".o", obj) + if (src ~ /\.c$/) flags = CF + else if (src ~ /\.[sS]$/) flags = AF + else flags = CF + print CC " " flags " -c " src " -o " obj + } + ' "$STAGE/_host/build-srcs.txt" + echo + echo '# stage D: CRT objects' + echo "/work/in/tcc $CRTFLAGS_C -fPIC -c crt/Scrt1.c -o obj/crt/Scrt1.o" + echo "/work/in/tcc $CRTFLAGS_C -c crt/crt1.c -o obj/crt/crt1.o" + echo "/work/in/tcc $CRTFLAGS_C -fPIC -c crt/rcrt1.c -o obj/crt/rcrt1.o" + printf '%s\n' "$CRT_LINES_TXT" + echo 'cp obj/crt/Scrt1.o obj/crt/crt1.o obj/crt/rcrt1.o obj/crt/crti.o obj/crt/crtn.o lib/' + echo + echo '# stage E: archive libc.a' + printf '/work/in/tcc -ar rcs lib/libc.a' + awk '{ obj = "obj/" $0; sub(/\.[^.]*$/, ".o", obj); printf " %s", obj }' "$STAGE/_host/build-srcs.txt" + echo + echo + echo '# publish artifacts to /work/out' + echo 'cp lib/libc.a lib/crt1.o lib/crti.o lib/crtn.o /work/out/' + echo + echo '# stage F: link + run hello' + echo "/work/in/tcc -static -nostdinc -nostdlib -include /work/in/musl-shim.h -I./include -I./arch/$MUSL_ARCH -I./arch/generic -Iobj/include lib/crt1.o /work/in/hello.c -L./lib -lc -L/work/in -ltcc1 -L./lib -lc -o /work/out/hello" + echo 'echo "--- run ---"' + echo '/work/out/hello a b c' +} > "$RUN_SCRIPT" +chmod +x "$RUN_SCRIPT" +echo "[boot4 $ARCH] generated run.sh: $(wc -l <"$RUN_SCRIPT") lines, $(wc -c <"$RUN_SCRIPT") bytes" -echo "--- run ---" -"$OUT/hello" a b c -CONTAINER +# ── run pipeline in scratch+busybox container ───────────────────────── +# The container body is a single line: source the host-generated build +# script. All control flow (loops, conditionals, parameter expansion) +# was resolved on the host; the container shell sees only sequential +# `tcc -c …` / `cp` / `mkdir` lines. +echo "[boot4 $ARCH] boot3/libtcc1.a + musl libc.a + crt -> hello" +podman run --rm -i --pull=never --platform "$PLATFORM" \ + --tmpfs /tmp:size=1024M \ + -v "$ROOT/$STAGE:/work" -w /work "$IMAGE" \ + sh -eu /work/in/run.sh # ── copy outputs to final destination ──────────────────────────────── for f in libc.a crt1.o crti.o crtn.o hello; do diff --git a/scripts/musl-vendor.sh b/scripts/musl-vendor.sh @@ -34,6 +34,8 @@ TARBALL=vendor/upstream/musl-1.2.5.tar.gz PATCH_FILE=vendor/upstream/musl-1.2.5-tcc.patch OVERRIDES=vendor/upstream/musl-1.2.5-overrides DELETES=vendor/upstream/musl-1.2.5-deletes.txt +GENERATED=vendor/upstream/musl-1.2.5-generated +MKALLTYPES_AWK=scripts/mkalltypes.awk [ -e "$TARBALL" ] || { echo "missing $TARBALL" >&2; exit 1; } [ -e "$PATCH_FILE" ] || { echo "missing $PATCH_FILE" >&2; exit 1; } @@ -109,8 +111,39 @@ done # (5) sort + dedupe sort -u "$DELETES" -o "$DELETES" +# (6) pre-generate per-arch alltypes.h + syscall.h. +# These are deterministic given the upstream tree + chosen arch (musl's +# Makefile runs the same two transformations at build time). Vendoring +# them lets the boot4 container drop awk entirely — it just `cp`s the +# right file in. mkalltypes runs on the post-overrides tree (overrides +# don't touch alltypes.h.in, but applying them keeps the procedure +# coherent). Apply overrides + deletes to a fresh post-patch copy and +# generate from there. +POST=$WORK/post +mkdir -p "$POST" +cp -R "$SRC" "$POST/" +cp -R "$ROOT/$OVERRIDES/." "$POST/musl-1.2.5/" +while read -r p; do + [ -n "$p" ] && rm -rf "$POST/musl-1.2.5/$p" +done < "$ROOT/$DELETES" + +rm -rf "$ROOT/$GENERATED" +for MARCH in aarch64 x86_64 riscv64; do + out=$ROOT/$GENERATED/$MARCH + mkdir -p "$out" + awk -f "$ROOT/$MKALLTYPES_AWK" \ + "$POST/musl-1.2.5/arch/$MARCH/bits/alltypes.h.in" \ + "$POST/musl-1.2.5/include/alltypes.h.in" \ + > "$out/alltypes.h" + cp "$POST/musl-1.2.5/arch/$MARCH/bits/syscall.h.in" "$out/syscall.h" + awk 'sub(/__NR_/, "SYS_") { print }' \ + < "$POST/musl-1.2.5/arch/$MARCH/bits/syscall.h.in" \ + >> "$out/syscall.h" +done + n_files=$(find "$OVERRIDES" -type f | wc -l) n_dels=$(wc -l < "$DELETES") -echo "musl-vendor: overrides=$n_files deletes=$n_dels" +n_gen=$(find "$GENERATED" -type f | wc -l) +echo "musl-vendor: overrides=$n_files deletes=$n_dels generated=$n_gen" echo " $OVERRIDES" echo " $DELETES" diff --git a/vendor/upstream/musl-1.2.5-generated/aarch64/alltypes.h b/vendor/upstream/musl-1.2.5-generated/aarch64/alltypes.h @@ -0,0 +1,423 @@ +#define _Addr long +#define _Int64 long +#define _Reg long + +#if __AARCH64EB__ +#define __BYTE_ORDER 4321 +#else +#define __BYTE_ORDER 1234 +#endif + +#define __LONG_MAX 0x7fffffffffffffffL + +#ifndef __cplusplus +#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) +typedef unsigned wchar_t; +#define __DEFINED_wchar_t +#endif + +#endif +#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) +typedef unsigned wint_t; +#define __DEFINED_wint_t +#endif + + +#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) +typedef int blksize_t; +#define __DEFINED_blksize_t +#endif + +#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) +typedef unsigned int nlink_t; +#define __DEFINED_nlink_t +#endif + + +#if defined(__NEED_float_t) && !defined(__DEFINED_float_t) +typedef float float_t; +#define __DEFINED_float_t +#endif + +#if defined(__NEED_double_t) && !defined(__DEFINED_double_t) +typedef double double_t; +#define __DEFINED_double_t +#endif + + +#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) +typedef struct { long long __ll; long double __ld; } max_align_t; +#define __DEFINED_max_align_t +#endif + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#define __USE_TIME_BITS64 1 + +#if defined(__NEED_size_t) && !defined(__DEFINED_size_t) +typedef unsigned _Addr size_t; +#define __DEFINED_size_t +#endif + +#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) +typedef unsigned _Addr uintptr_t; +#define __DEFINED_uintptr_t +#endif + +#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) +typedef _Addr ptrdiff_t; +#define __DEFINED_ptrdiff_t +#endif + +#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) +typedef _Addr ssize_t; +#define __DEFINED_ssize_t +#endif + +#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) +typedef _Addr intptr_t; +#define __DEFINED_intptr_t +#endif + +#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) +typedef _Addr regoff_t; +#define __DEFINED_regoff_t +#endif + +#if defined(__NEED_register_t) && !defined(__DEFINED_register_t) +typedef _Reg register_t; +#define __DEFINED_register_t +#endif + +#if defined(__NEED_time_t) && !defined(__DEFINED_time_t) +typedef _Int64 time_t; +#define __DEFINED_time_t +#endif + +#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) +typedef _Int64 suseconds_t; +#define __DEFINED_suseconds_t +#endif + + +#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) +typedef signed char int8_t; +#define __DEFINED_int8_t +#endif + +#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) +typedef signed short int16_t; +#define __DEFINED_int16_t +#endif + +#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) +typedef signed int int32_t; +#define __DEFINED_int32_t +#endif + +#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) +typedef signed _Int64 int64_t; +#define __DEFINED_int64_t +#endif + +#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) +typedef signed _Int64 intmax_t; +#define __DEFINED_intmax_t +#endif + +#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) +typedef unsigned char uint8_t; +#define __DEFINED_uint8_t +#endif + +#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) +typedef unsigned short uint16_t; +#define __DEFINED_uint16_t +#endif + +#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) +typedef unsigned int uint32_t; +#define __DEFINED_uint32_t +#endif + +#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) +typedef unsigned _Int64 uint64_t; +#define __DEFINED_uint64_t +#endif + +#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) +typedef unsigned _Int64 u_int64_t; +#define __DEFINED_u_int64_t +#endif + +#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) +typedef unsigned _Int64 uintmax_t; +#define __DEFINED_uintmax_t +#endif + + +#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) +typedef unsigned mode_t; +#define __DEFINED_mode_t +#endif + +#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) +typedef unsigned _Reg nlink_t; +#define __DEFINED_nlink_t +#endif + +#if defined(__NEED_off_t) && !defined(__DEFINED_off_t) +typedef _Int64 off_t; +#define __DEFINED_off_t +#endif + +#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) +typedef unsigned _Int64 ino_t; +#define __DEFINED_ino_t +#endif + +#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) +typedef unsigned _Int64 dev_t; +#define __DEFINED_dev_t +#endif + +#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) +typedef long blksize_t; +#define __DEFINED_blksize_t +#endif + +#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) +typedef _Int64 blkcnt_t; +#define __DEFINED_blkcnt_t +#endif + +#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) +typedef unsigned _Int64 fsblkcnt_t; +#define __DEFINED_fsblkcnt_t +#endif + +#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) +typedef unsigned _Int64 fsfilcnt_t; +#define __DEFINED_fsfilcnt_t +#endif + + +#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) +typedef unsigned wint_t; +#define __DEFINED_wint_t +#endif + +#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) +typedef unsigned long wctype_t; +#define __DEFINED_wctype_t +#endif + + +#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) +typedef void * timer_t; +#define __DEFINED_timer_t +#endif + +#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) +typedef int clockid_t; +#define __DEFINED_clockid_t +#endif + +#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) +typedef long clock_t; +#define __DEFINED_clock_t +#endif + +#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) +struct timeval { time_t tv_sec; suseconds_t tv_usec; }; +#define __DEFINED_struct_timeval +#endif + +#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) +struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); }; +#define __DEFINED_struct_timespec +#endif + + +#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) +typedef int pid_t; +#define __DEFINED_pid_t +#endif + +#if defined(__NEED_id_t) && !defined(__DEFINED_id_t) +typedef unsigned id_t; +#define __DEFINED_id_t +#endif + +#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) +typedef unsigned uid_t; +#define __DEFINED_uid_t +#endif + +#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) +typedef unsigned gid_t; +#define __DEFINED_gid_t +#endif + +#if defined(__NEED_key_t) && !defined(__DEFINED_key_t) +typedef int key_t; +#define __DEFINED_key_t +#endif + +#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) +typedef unsigned useconds_t; +#define __DEFINED_useconds_t +#endif + + +#ifdef __cplusplus +#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) +typedef unsigned long pthread_t; +#define __DEFINED_pthread_t +#endif + +#else +#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) +typedef struct __pthread * pthread_t; +#define __DEFINED_pthread_t +#endif + +#endif +#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) +typedef int pthread_once_t; +#define __DEFINED_pthread_once_t +#endif + +#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) +typedef unsigned pthread_key_t; +#define __DEFINED_pthread_key_t +#endif + +#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) +typedef int pthread_spinlock_t; +#define __DEFINED_pthread_spinlock_t +#endif + +#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) +typedef struct { unsigned __attr; } pthread_mutexattr_t; +#define __DEFINED_pthread_mutexattr_t +#endif + +#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) +typedef struct { unsigned __attr; } pthread_condattr_t; +#define __DEFINED_pthread_condattr_t +#endif + +#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) +typedef struct { unsigned __attr; } pthread_barrierattr_t; +#define __DEFINED_pthread_barrierattr_t +#endif + +#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) +typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; +#define __DEFINED_pthread_rwlockattr_t +#endif + + +#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE) +struct _IO_FILE { char __x; }; +#define __DEFINED_struct__IO_FILE +#endif + +#if defined(__NEED_FILE) && !defined(__DEFINED_FILE) +typedef struct _IO_FILE FILE; +#define __DEFINED_FILE +#endif + + +#if defined(__NEED_va_list) && !defined(__DEFINED_va_list) +typedef __builtin_va_list va_list; +#define __DEFINED_va_list +#endif + +#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) +typedef __builtin_va_list __isoc_va_list; +#define __DEFINED___isoc_va_list +#endif + + +#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) +typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; +#define __DEFINED_mbstate_t +#endif + + +#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) +typedef struct __locale_struct * locale_t; +#define __DEFINED_locale_t +#endif + + +#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) +typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; +#define __DEFINED_sigset_t +#endif + + +#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) +struct iovec { void *iov_base; size_t iov_len; }; +#define __DEFINED_struct_iovec +#endif + + +#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize) +struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; }; +#define __DEFINED_struct_winsize +#endif + + +#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) +typedef unsigned socklen_t; +#define __DEFINED_socklen_t +#endif + +#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) +typedef unsigned short sa_family_t; +#define __DEFINED_sa_family_t +#endif + + +#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) +typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t; +#define __DEFINED_pthread_attr_t +#endif + +#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) +typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t; +#define __DEFINED_pthread_mutex_t +#endif + +#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) +typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t; +#define __DEFINED_mtx_t +#endif + +#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) +typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t; +#define __DEFINED_pthread_cond_t +#endif + +#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) +typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t; +#define __DEFINED_cnd_t +#endif + +#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) +typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t; +#define __DEFINED_pthread_rwlock_t +#endif + +#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) +typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t; +#define __DEFINED_pthread_barrier_t +#endif + + +#undef _Addr +#undef _Int64 +#undef _Reg diff --git a/vendor/upstream/musl-1.2.5-generated/aarch64/syscall.h b/vendor/upstream/musl-1.2.5-generated/aarch64/syscall.h @@ -0,0 +1,613 @@ +#define __NR_io_setup 0 +#define __NR_io_destroy 1 +#define __NR_io_submit 2 +#define __NR_io_cancel 3 +#define __NR_io_getevents 4 +#define __NR_setxattr 5 +#define __NR_lsetxattr 6 +#define __NR_fsetxattr 7 +#define __NR_getxattr 8 +#define __NR_lgetxattr 9 +#define __NR_fgetxattr 10 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_flistxattr 13 +#define __NR_removexattr 14 +#define __NR_lremovexattr 15 +#define __NR_fremovexattr 16 +#define __NR_getcwd 17 +#define __NR_lookup_dcookie 18 +#define __NR_eventfd2 19 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR_fcntl 25 +#define __NR_inotify_init1 26 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_rm_watch 28 +#define __NR_ioctl 29 +#define __NR_ioprio_set 30 +#define __NR_ioprio_get 31 +#define __NR_flock 32 +#define __NR_mknodat 33 +#define __NR_mkdirat 34 +#define __NR_unlinkat 35 +#define __NR_symlinkat 36 +#define __NR_linkat 37 +#define __NR_renameat 38 +#define __NR_umount2 39 +#define __NR_mount 40 +#define __NR_pivot_root 41 +#define __NR_nfsservctl 42 +#define __NR_statfs 43 +#define __NR_fstatfs 44 +#define __NR_truncate 45 +#define __NR_ftruncate 46 +#define __NR_fallocate 47 +#define __NR_faccessat 48 +#define __NR_chdir 49 +#define __NR_fchdir 50 +#define __NR_chroot 51 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchownat 54 +#define __NR_fchown 55 +#define __NR_openat 56 +#define __NR_close 57 +#define __NR_vhangup 58 +#define __NR_pipe2 59 +#define __NR_quotactl 60 +#define __NR_getdents64 61 +#define __NR_lseek 62 +#define __NR_read 63 +#define __NR_write 64 +#define __NR_readv 65 +#define __NR_writev 66 +#define __NR_pread64 67 +#define __NR_pwrite64 68 +#define __NR_preadv 69 +#define __NR_pwritev 70 +#define __NR_sendfile 71 +#define __NR_pselect6 72 +#define __NR_ppoll 73 +#define __NR_signalfd4 74 +#define __NR_vmsplice 75 +#define __NR_splice 76 +#define __NR_tee 77 +#define __NR_readlinkat 78 +#define __NR_newfstatat 79 +#define __NR_fstat 80 +#define __NR_sync 81 +#define __NR_fsync 82 +#define __NR_fdatasync 83 +#define __NR_sync_file_range 84 +#define __NR_timerfd_create 85 +#define __NR_timerfd_settime 86 +#define __NR_timerfd_gettime 87 +#define __NR_utimensat 88 +#define __NR_acct 89 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_personality 92 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_waitid 95 +#define __NR_set_tid_address 96 +#define __NR_unshare 97 +#define __NR_futex 98 +#define __NR_set_robust_list 99 +#define __NR_get_robust_list 100 +#define __NR_nanosleep 101 +#define __NR_getitimer 102 +#define __NR_setitimer 103 +#define __NR_kexec_load 104 +#define __NR_init_module 105 +#define __NR_delete_module 106 +#define __NR_timer_create 107 +#define __NR_timer_gettime 108 +#define __NR_timer_getoverrun 109 +#define __NR_timer_settime 110 +#define __NR_timer_delete 111 +#define __NR_clock_settime 112 +#define __NR_clock_gettime 113 +#define __NR_clock_getres 114 +#define __NR_clock_nanosleep 115 +#define __NR_syslog 116 +#define __NR_ptrace 117 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_getscheduler 120 +#define __NR_sched_getparam 121 +#define __NR_sched_setaffinity 122 +#define __NR_sched_getaffinity 123 +#define __NR_sched_yield 124 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_rr_get_interval 127 +#define __NR_restart_syscall 128 +#define __NR_kill 129 +#define __NR_tkill 130 +#define __NR_tgkill 131 +#define __NR_sigaltstack 132 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_setpriority 140 +#define __NR_getpriority 141 +#define __NR_reboot 142 +#define __NR_setregid 143 +#define __NR_setgid 144 +#define __NR_setreuid 145 +#define __NR_setuid 146 +#define __NR_setresuid 147 +#define __NR_getresuid 148 +#define __NR_setresgid 149 +#define __NR_getresgid 150 +#define __NR_setfsuid 151 +#define __NR_setfsgid 152 +#define __NR_times 153 +#define __NR_setpgid 154 +#define __NR_getpgid 155 +#define __NR_getsid 156 +#define __NR_setsid 157 +#define __NR_getgroups 158 +#define __NR_setgroups 159 +#define __NR_uname 160 +#define __NR_sethostname 161 +#define __NR_setdomainname 162 +#define __NR_getrlimit 163 +#define __NR_setrlimit 164 +#define __NR_getrusage 165 +#define __NR_umask 166 +#define __NR_prctl 167 +#define __NR_getcpu 168 +#define __NR_gettimeofday 169 +#define __NR_settimeofday 170 +#define __NR_adjtimex 171 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getuid 174 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getegid 177 +#define __NR_gettid 178 +#define __NR_sysinfo 179 +#define __NR_mq_open 180 +#define __NR_mq_unlink 181 +#define __NR_mq_timedsend 182 +#define __NR_mq_timedreceive 183 +#define __NR_mq_notify 184 +#define __NR_mq_getsetattr 185 +#define __NR_msgget 186 +#define __NR_msgctl 187 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_semget 190 +#define __NR_semctl 191 +#define __NR_semtimedop 192 +#define __NR_semop 193 +#define __NR_shmget 194 +#define __NR_shmctl 195 +#define __NR_shmat 196 +#define __NR_shmdt 197 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_bind 200 +#define __NR_listen 201 +#define __NR_accept 202 +#define __NR_connect 203 +#define __NR_getsockname 204 +#define __NR_getpeername 205 +#define __NR_sendto 206 +#define __NR_recvfrom 207 +#define __NR_setsockopt 208 +#define __NR_getsockopt 209 +#define __NR_shutdown 210 +#define __NR_sendmsg 211 +#define __NR_recvmsg 212 +#define __NR_readahead 213 +#define __NR_brk 214 +#define __NR_munmap 215 +#define __NR_mremap 216 +#define __NR_add_key 217 +#define __NR_request_key 218 +#define __NR_keyctl 219 +#define __NR_clone 220 +#define __NR_execve 221 +#define __NR_mmap 222 +#define __NR_fadvise64 223 +#define __NR_swapon 224 +#define __NR_swapoff 225 +#define __NR_mprotect 226 +#define __NR_msync 227 +#define __NR_mlock 228 +#define __NR_munlock 229 +#define __NR_mlockall 230 +#define __NR_munlockall 231 +#define __NR_mincore 232 +#define __NR_madvise 233 +#define __NR_remap_file_pages 234 +#define __NR_mbind 235 +#define __NR_get_mempolicy 236 +#define __NR_set_mempolicy 237 +#define __NR_migrate_pages 238 +#define __NR_move_pages 239 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_perf_event_open 241 +#define __NR_accept4 242 +#define __NR_recvmmsg 243 +#define __NR_wait4 260 +#define __NR_prlimit64 261 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_name_to_handle_at 264 +#define __NR_open_by_handle_at 265 +#define __NR_clock_adjtime 266 +#define __NR_syncfs 267 +#define __NR_setns 268 +#define __NR_sendmmsg 269 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_kcmp 272 +#define __NR_finit_module 273 +#define __NR_sched_setattr 274 +#define __NR_sched_getattr 275 +#define __NR_renameat2 276 +#define __NR_seccomp 277 +#define __NR_getrandom 278 +#define __NR_memfd_create 279 +#define __NR_bpf 280 +#define __NR_execveat 281 +#define __NR_userfaultfd 282 +#define __NR_membarrier 283 +#define __NR_mlock2 284 +#define __NR_copy_file_range 285 +#define __NR_preadv2 286 +#define __NR_pwritev2 287 +#define __NR_pkey_mprotect 288 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 +#define __NR_statx 291 +#define __NR_io_pgetevents 292 +#define __NR_rseq 293 +#define __NR_kexec_file_load 294 +#define __NR_pidfd_send_signal 424 +#define __NR_io_uring_setup 425 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_open_tree 428 +#define __NR_move_mount 429 +#define __NR_fsopen 430 +#define __NR_fsconfig 431 +#define __NR_fsmount 432 +#define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 +#define __NR_close_range 436 +#define __NR_openat2 437 +#define __NR_pidfd_getfd 438 +#define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 +#define __NR_process_mrelease 448 +#define __NR_futex_waitv 449 +#define __NR_set_mempolicy_home_node 450 +#define __NR_cachestat 451 +#define __NR_fchmodat2 452 + +#define SYS_io_setup 0 +#define SYS_io_destroy 1 +#define SYS_io_submit 2 +#define SYS_io_cancel 3 +#define SYS_io_getevents 4 +#define SYS_setxattr 5 +#define SYS_lsetxattr 6 +#define SYS_fsetxattr 7 +#define SYS_getxattr 8 +#define SYS_lgetxattr 9 +#define SYS_fgetxattr 10 +#define SYS_listxattr 11 +#define SYS_llistxattr 12 +#define SYS_flistxattr 13 +#define SYS_removexattr 14 +#define SYS_lremovexattr 15 +#define SYS_fremovexattr 16 +#define SYS_getcwd 17 +#define SYS_lookup_dcookie 18 +#define SYS_eventfd2 19 +#define SYS_epoll_create1 20 +#define SYS_epoll_ctl 21 +#define SYS_epoll_pwait 22 +#define SYS_dup 23 +#define SYS_dup3 24 +#define SYS_fcntl 25 +#define SYS_inotify_init1 26 +#define SYS_inotify_add_watch 27 +#define SYS_inotify_rm_watch 28 +#define SYS_ioctl 29 +#define SYS_ioprio_set 30 +#define SYS_ioprio_get 31 +#define SYS_flock 32 +#define SYS_mknodat 33 +#define SYS_mkdirat 34 +#define SYS_unlinkat 35 +#define SYS_symlinkat 36 +#define SYS_linkat 37 +#define SYS_renameat 38 +#define SYS_umount2 39 +#define SYS_mount 40 +#define SYS_pivot_root 41 +#define SYS_nfsservctl 42 +#define SYS_statfs 43 +#define SYS_fstatfs 44 +#define SYS_truncate 45 +#define SYS_ftruncate 46 +#define SYS_fallocate 47 +#define SYS_faccessat 48 +#define SYS_chdir 49 +#define SYS_fchdir 50 +#define SYS_chroot 51 +#define SYS_fchmod 52 +#define SYS_fchmodat 53 +#define SYS_fchownat 54 +#define SYS_fchown 55 +#define SYS_openat 56 +#define SYS_close 57 +#define SYS_vhangup 58 +#define SYS_pipe2 59 +#define SYS_quotactl 60 +#define SYS_getdents64 61 +#define SYS_lseek 62 +#define SYS_read 63 +#define SYS_write 64 +#define SYS_readv 65 +#define SYS_writev 66 +#define SYS_pread64 67 +#define SYS_pwrite64 68 +#define SYS_preadv 69 +#define SYS_pwritev 70 +#define SYS_sendfile 71 +#define SYS_pselect6 72 +#define SYS_ppoll 73 +#define SYS_signalfd4 74 +#define SYS_vmsplice 75 +#define SYS_splice 76 +#define SYS_tee 77 +#define SYS_readlinkat 78 +#define SYS_newfstatat 79 +#define SYS_fstat 80 +#define SYS_sync 81 +#define SYS_fsync 82 +#define SYS_fdatasync 83 +#define SYS_sync_file_range 84 +#define SYS_timerfd_create 85 +#define SYS_timerfd_settime 86 +#define SYS_timerfd_gettime 87 +#define SYS_utimensat 88 +#define SYS_acct 89 +#define SYS_capget 90 +#define SYS_capset 91 +#define SYS_personality 92 +#define SYS_exit 93 +#define SYS_exit_group 94 +#define SYS_waitid 95 +#define SYS_set_tid_address 96 +#define SYS_unshare 97 +#define SYS_futex 98 +#define SYS_set_robust_list 99 +#define SYS_get_robust_list 100 +#define SYS_nanosleep 101 +#define SYS_getitimer 102 +#define SYS_setitimer 103 +#define SYS_kexec_load 104 +#define SYS_init_module 105 +#define SYS_delete_module 106 +#define SYS_timer_create 107 +#define SYS_timer_gettime 108 +#define SYS_timer_getoverrun 109 +#define SYS_timer_settime 110 +#define SYS_timer_delete 111 +#define SYS_clock_settime 112 +#define SYS_clock_gettime 113 +#define SYS_clock_getres 114 +#define SYS_clock_nanosleep 115 +#define SYS_syslog 116 +#define SYS_ptrace 117 +#define SYS_sched_setparam 118 +#define SYS_sched_setscheduler 119 +#define SYS_sched_getscheduler 120 +#define SYS_sched_getparam 121 +#define SYS_sched_setaffinity 122 +#define SYS_sched_getaffinity 123 +#define SYS_sched_yield 124 +#define SYS_sched_get_priority_max 125 +#define SYS_sched_get_priority_min 126 +#define SYS_sched_rr_get_interval 127 +#define SYS_restart_syscall 128 +#define SYS_kill 129 +#define SYS_tkill 130 +#define SYS_tgkill 131 +#define SYS_sigaltstack 132 +#define SYS_rt_sigsuspend 133 +#define SYS_rt_sigaction 134 +#define SYS_rt_sigprocmask 135 +#define SYS_rt_sigpending 136 +#define SYS_rt_sigtimedwait 137 +#define SYS_rt_sigqueueinfo 138 +#define SYS_rt_sigreturn 139 +#define SYS_setpriority 140 +#define SYS_getpriority 141 +#define SYS_reboot 142 +#define SYS_setregid 143 +#define SYS_setgid 144 +#define SYS_setreuid 145 +#define SYS_setuid 146 +#define SYS_setresuid 147 +#define SYS_getresuid 148 +#define SYS_setresgid 149 +#define SYS_getresgid 150 +#define SYS_setfsuid 151 +#define SYS_setfsgid 152 +#define SYS_times 153 +#define SYS_setpgid 154 +#define SYS_getpgid 155 +#define SYS_getsid 156 +#define SYS_setsid 157 +#define SYS_getgroups 158 +#define SYS_setgroups 159 +#define SYS_uname 160 +#define SYS_sethostname 161 +#define SYS_setdomainname 162 +#define SYS_getrlimit 163 +#define SYS_setrlimit 164 +#define SYS_getrusage 165 +#define SYS_umask 166 +#define SYS_prctl 167 +#define SYS_getcpu 168 +#define SYS_gettimeofday 169 +#define SYS_settimeofday 170 +#define SYS_adjtimex 171 +#define SYS_getpid 172 +#define SYS_getppid 173 +#define SYS_getuid 174 +#define SYS_geteuid 175 +#define SYS_getgid 176 +#define SYS_getegid 177 +#define SYS_gettid 178 +#define SYS_sysinfo 179 +#define SYS_mq_open 180 +#define SYS_mq_unlink 181 +#define SYS_mq_timedsend 182 +#define SYS_mq_timedreceive 183 +#define SYS_mq_notify 184 +#define SYS_mq_getsetattr 185 +#define SYS_msgget 186 +#define SYS_msgctl 187 +#define SYS_msgrcv 188 +#define SYS_msgsnd 189 +#define SYS_semget 190 +#define SYS_semctl 191 +#define SYS_semtimedop 192 +#define SYS_semop 193 +#define SYS_shmget 194 +#define SYS_shmctl 195 +#define SYS_shmat 196 +#define SYS_shmdt 197 +#define SYS_socket 198 +#define SYS_socketpair 199 +#define SYS_bind 200 +#define SYS_listen 201 +#define SYS_accept 202 +#define SYS_connect 203 +#define SYS_getsockname 204 +#define SYS_getpeername 205 +#define SYS_sendto 206 +#define SYS_recvfrom 207 +#define SYS_setsockopt 208 +#define SYS_getsockopt 209 +#define SYS_shutdown 210 +#define SYS_sendmsg 211 +#define SYS_recvmsg 212 +#define SYS_readahead 213 +#define SYS_brk 214 +#define SYS_munmap 215 +#define SYS_mremap 216 +#define SYS_add_key 217 +#define SYS_request_key 218 +#define SYS_keyctl 219 +#define SYS_clone 220 +#define SYS_execve 221 +#define SYS_mmap 222 +#define SYS_fadvise64 223 +#define SYS_swapon 224 +#define SYS_swapoff 225 +#define SYS_mprotect 226 +#define SYS_msync 227 +#define SYS_mlock 228 +#define SYS_munlock 229 +#define SYS_mlockall 230 +#define SYS_munlockall 231 +#define SYS_mincore 232 +#define SYS_madvise 233 +#define SYS_remap_file_pages 234 +#define SYS_mbind 235 +#define SYS_get_mempolicy 236 +#define SYS_set_mempolicy 237 +#define SYS_migrate_pages 238 +#define SYS_move_pages 239 +#define SYS_rt_tgsigqueueinfo 240 +#define SYS_perf_event_open 241 +#define SYS_accept4 242 +#define SYS_recvmmsg 243 +#define SYS_wait4 260 +#define SYS_prlimit64 261 +#define SYS_fanotify_init 262 +#define SYS_fanotify_mark 263 +#define SYS_name_to_handle_at 264 +#define SYS_open_by_handle_at 265 +#define SYS_clock_adjtime 266 +#define SYS_syncfs 267 +#define SYS_setns 268 +#define SYS_sendmmsg 269 +#define SYS_process_vm_readv 270 +#define SYS_process_vm_writev 271 +#define SYS_kcmp 272 +#define SYS_finit_module 273 +#define SYS_sched_setattr 274 +#define SYS_sched_getattr 275 +#define SYS_renameat2 276 +#define SYS_seccomp 277 +#define SYS_getrandom 278 +#define SYS_memfd_create 279 +#define SYS_bpf 280 +#define SYS_execveat 281 +#define SYS_userfaultfd 282 +#define SYS_membarrier 283 +#define SYS_mlock2 284 +#define SYS_copy_file_range 285 +#define SYS_preadv2 286 +#define SYS_pwritev2 287 +#define SYS_pkey_mprotect 288 +#define SYS_pkey_alloc 289 +#define SYS_pkey_free 290 +#define SYS_statx 291 +#define SYS_io_pgetevents 292 +#define SYS_rseq 293 +#define SYS_kexec_file_load 294 +#define SYS_pidfd_send_signal 424 +#define SYS_io_uring_setup 425 +#define SYS_io_uring_enter 426 +#define SYS_io_uring_register 427 +#define SYS_open_tree 428 +#define SYS_move_mount 429 +#define SYS_fsopen 430 +#define SYS_fsconfig 431 +#define SYS_fsmount 432 +#define SYS_fspick 433 +#define SYS_pidfd_open 434 +#define SYS_clone3 435 +#define SYS_close_range 436 +#define SYS_openat2 437 +#define SYS_pidfd_getfd 438 +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 +#define SYS_process_mrelease 448 +#define SYS_futex_waitv 449 +#define SYS_set_mempolicy_home_node 450 +#define SYS_cachestat 451 +#define SYS_fchmodat2 452 diff --git a/vendor/upstream/musl-1.2.5-generated/riscv64/alltypes.h b/vendor/upstream/musl-1.2.5-generated/riscv64/alltypes.h @@ -0,0 +1,413 @@ +#define _Addr long +#define _Int64 long +#define _Reg long + +#define __BYTE_ORDER 1234 +#define __LONG_MAX 0x7fffffffffffffffL + +#ifndef __cplusplus +#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) +typedef int wchar_t; +#define __DEFINED_wchar_t +#endif + +#endif + +#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) +typedef int blksize_t; +#define __DEFINED_blksize_t +#endif + +#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) +typedef unsigned int nlink_t; +#define __DEFINED_nlink_t +#endif + + +#if defined(__NEED_float_t) && !defined(__DEFINED_float_t) +typedef float float_t; +#define __DEFINED_float_t +#endif + +#if defined(__NEED_double_t) && !defined(__DEFINED_double_t) +typedef double double_t; +#define __DEFINED_double_t +#endif + + +#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) +typedef struct { long long __ll; long double __ld; } max_align_t; +#define __DEFINED_max_align_t +#endif + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#define __USE_TIME_BITS64 1 + +#if defined(__NEED_size_t) && !defined(__DEFINED_size_t) +typedef unsigned _Addr size_t; +#define __DEFINED_size_t +#endif + +#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) +typedef unsigned _Addr uintptr_t; +#define __DEFINED_uintptr_t +#endif + +#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) +typedef _Addr ptrdiff_t; +#define __DEFINED_ptrdiff_t +#endif + +#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) +typedef _Addr ssize_t; +#define __DEFINED_ssize_t +#endif + +#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) +typedef _Addr intptr_t; +#define __DEFINED_intptr_t +#endif + +#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) +typedef _Addr regoff_t; +#define __DEFINED_regoff_t +#endif + +#if defined(__NEED_register_t) && !defined(__DEFINED_register_t) +typedef _Reg register_t; +#define __DEFINED_register_t +#endif + +#if defined(__NEED_time_t) && !defined(__DEFINED_time_t) +typedef _Int64 time_t; +#define __DEFINED_time_t +#endif + +#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) +typedef _Int64 suseconds_t; +#define __DEFINED_suseconds_t +#endif + + +#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) +typedef signed char int8_t; +#define __DEFINED_int8_t +#endif + +#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) +typedef signed short int16_t; +#define __DEFINED_int16_t +#endif + +#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) +typedef signed int int32_t; +#define __DEFINED_int32_t +#endif + +#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) +typedef signed _Int64 int64_t; +#define __DEFINED_int64_t +#endif + +#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) +typedef signed _Int64 intmax_t; +#define __DEFINED_intmax_t +#endif + +#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) +typedef unsigned char uint8_t; +#define __DEFINED_uint8_t +#endif + +#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) +typedef unsigned short uint16_t; +#define __DEFINED_uint16_t +#endif + +#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) +typedef unsigned int uint32_t; +#define __DEFINED_uint32_t +#endif + +#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) +typedef unsigned _Int64 uint64_t; +#define __DEFINED_uint64_t +#endif + +#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) +typedef unsigned _Int64 u_int64_t; +#define __DEFINED_u_int64_t +#endif + +#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) +typedef unsigned _Int64 uintmax_t; +#define __DEFINED_uintmax_t +#endif + + +#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) +typedef unsigned mode_t; +#define __DEFINED_mode_t +#endif + +#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) +typedef unsigned _Reg nlink_t; +#define __DEFINED_nlink_t +#endif + +#if defined(__NEED_off_t) && !defined(__DEFINED_off_t) +typedef _Int64 off_t; +#define __DEFINED_off_t +#endif + +#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) +typedef unsigned _Int64 ino_t; +#define __DEFINED_ino_t +#endif + +#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) +typedef unsigned _Int64 dev_t; +#define __DEFINED_dev_t +#endif + +#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) +typedef long blksize_t; +#define __DEFINED_blksize_t +#endif + +#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) +typedef _Int64 blkcnt_t; +#define __DEFINED_blkcnt_t +#endif + +#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) +typedef unsigned _Int64 fsblkcnt_t; +#define __DEFINED_fsblkcnt_t +#endif + +#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) +typedef unsigned _Int64 fsfilcnt_t; +#define __DEFINED_fsfilcnt_t +#endif + + +#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) +typedef unsigned wint_t; +#define __DEFINED_wint_t +#endif + +#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) +typedef unsigned long wctype_t; +#define __DEFINED_wctype_t +#endif + + +#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) +typedef void * timer_t; +#define __DEFINED_timer_t +#endif + +#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) +typedef int clockid_t; +#define __DEFINED_clockid_t +#endif + +#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) +typedef long clock_t; +#define __DEFINED_clock_t +#endif + +#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) +struct timeval { time_t tv_sec; suseconds_t tv_usec; }; +#define __DEFINED_struct_timeval +#endif + +#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) +struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); }; +#define __DEFINED_struct_timespec +#endif + + +#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) +typedef int pid_t; +#define __DEFINED_pid_t +#endif + +#if defined(__NEED_id_t) && !defined(__DEFINED_id_t) +typedef unsigned id_t; +#define __DEFINED_id_t +#endif + +#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) +typedef unsigned uid_t; +#define __DEFINED_uid_t +#endif + +#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) +typedef unsigned gid_t; +#define __DEFINED_gid_t +#endif + +#if defined(__NEED_key_t) && !defined(__DEFINED_key_t) +typedef int key_t; +#define __DEFINED_key_t +#endif + +#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) +typedef unsigned useconds_t; +#define __DEFINED_useconds_t +#endif + + +#ifdef __cplusplus +#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) +typedef unsigned long pthread_t; +#define __DEFINED_pthread_t +#endif + +#else +#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) +typedef struct __pthread * pthread_t; +#define __DEFINED_pthread_t +#endif + +#endif +#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) +typedef int pthread_once_t; +#define __DEFINED_pthread_once_t +#endif + +#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) +typedef unsigned pthread_key_t; +#define __DEFINED_pthread_key_t +#endif + +#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) +typedef int pthread_spinlock_t; +#define __DEFINED_pthread_spinlock_t +#endif + +#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) +typedef struct { unsigned __attr; } pthread_mutexattr_t; +#define __DEFINED_pthread_mutexattr_t +#endif + +#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) +typedef struct { unsigned __attr; } pthread_condattr_t; +#define __DEFINED_pthread_condattr_t +#endif + +#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) +typedef struct { unsigned __attr; } pthread_barrierattr_t; +#define __DEFINED_pthread_barrierattr_t +#endif + +#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) +typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; +#define __DEFINED_pthread_rwlockattr_t +#endif + + +#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE) +struct _IO_FILE { char __x; }; +#define __DEFINED_struct__IO_FILE +#endif + +#if defined(__NEED_FILE) && !defined(__DEFINED_FILE) +typedef struct _IO_FILE FILE; +#define __DEFINED_FILE +#endif + + +#if defined(__NEED_va_list) && !defined(__DEFINED_va_list) +typedef __builtin_va_list va_list; +#define __DEFINED_va_list +#endif + +#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) +typedef __builtin_va_list __isoc_va_list; +#define __DEFINED___isoc_va_list +#endif + + +#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) +typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; +#define __DEFINED_mbstate_t +#endif + + +#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) +typedef struct __locale_struct * locale_t; +#define __DEFINED_locale_t +#endif + + +#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) +typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; +#define __DEFINED_sigset_t +#endif + + +#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) +struct iovec { void *iov_base; size_t iov_len; }; +#define __DEFINED_struct_iovec +#endif + + +#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize) +struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; }; +#define __DEFINED_struct_winsize +#endif + + +#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) +typedef unsigned socklen_t; +#define __DEFINED_socklen_t +#endif + +#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) +typedef unsigned short sa_family_t; +#define __DEFINED_sa_family_t +#endif + + +#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) +typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t; +#define __DEFINED_pthread_attr_t +#endif + +#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) +typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t; +#define __DEFINED_pthread_mutex_t +#endif + +#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) +typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t; +#define __DEFINED_mtx_t +#endif + +#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) +typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t; +#define __DEFINED_pthread_cond_t +#endif + +#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) +typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t; +#define __DEFINED_cnd_t +#endif + +#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) +typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t; +#define __DEFINED_pthread_rwlock_t +#endif + +#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) +typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t; +#define __DEFINED_pthread_barrier_t +#endif + + +#undef _Addr +#undef _Int64 +#undef _Reg diff --git a/vendor/upstream/musl-1.2.5-generated/riscv64/syscall.h b/vendor/upstream/musl-1.2.5-generated/riscv64/syscall.h @@ -0,0 +1,617 @@ +#define __NR_io_setup 0 +#define __NR_io_destroy 1 +#define __NR_io_submit 2 +#define __NR_io_cancel 3 +#define __NR_io_getevents 4 +#define __NR_setxattr 5 +#define __NR_lsetxattr 6 +#define __NR_fsetxattr 7 +#define __NR_getxattr 8 +#define __NR_lgetxattr 9 +#define __NR_fgetxattr 10 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_flistxattr 13 +#define __NR_removexattr 14 +#define __NR_lremovexattr 15 +#define __NR_fremovexattr 16 +#define __NR_getcwd 17 +#define __NR_lookup_dcookie 18 +#define __NR_eventfd2 19 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR_fcntl 25 +#define __NR_inotify_init1 26 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_rm_watch 28 +#define __NR_ioctl 29 +#define __NR_ioprio_set 30 +#define __NR_ioprio_get 31 +#define __NR_flock 32 +#define __NR_mknodat 33 +#define __NR_mkdirat 34 +#define __NR_unlinkat 35 +#define __NR_symlinkat 36 +#define __NR_linkat 37 +#define __NR_umount2 39 +#define __NR_mount 40 +#define __NR_pivot_root 41 +#define __NR_nfsservctl 42 +#define __NR_statfs 43 +#define __NR_fstatfs 44 +#define __NR_truncate 45 +#define __NR_ftruncate 46 +#define __NR_fallocate 47 +#define __NR_faccessat 48 +#define __NR_chdir 49 +#define __NR_fchdir 50 +#define __NR_chroot 51 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchownat 54 +#define __NR_fchown 55 +#define __NR_openat 56 +#define __NR_close 57 +#define __NR_vhangup 58 +#define __NR_pipe2 59 +#define __NR_quotactl 60 +#define __NR_getdents64 61 +#define __NR_lseek 62 +#define __NR_read 63 +#define __NR_write 64 +#define __NR_readv 65 +#define __NR_writev 66 +#define __NR_pread64 67 +#define __NR_pwrite64 68 +#define __NR_preadv 69 +#define __NR_pwritev 70 +#define __NR_sendfile 71 +#define __NR_pselect6 72 +#define __NR_ppoll 73 +#define __NR_signalfd4 74 +#define __NR_vmsplice 75 +#define __NR_splice 76 +#define __NR_tee 77 +#define __NR_readlinkat 78 +#define __NR_newfstatat 79 +#define __NR_fstat 80 +#define __NR_sync 81 +#define __NR_fsync 82 +#define __NR_fdatasync 83 +#define __NR_sync_file_range 84 +#define __NR_timerfd_create 85 +#define __NR_timerfd_settime 86 +#define __NR_timerfd_gettime 87 +#define __NR_utimensat 88 +#define __NR_acct 89 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_personality 92 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_waitid 95 +#define __NR_set_tid_address 96 +#define __NR_unshare 97 +#define __NR_futex 98 +#define __NR_set_robust_list 99 +#define __NR_get_robust_list 100 +#define __NR_nanosleep 101 +#define __NR_getitimer 102 +#define __NR_setitimer 103 +#define __NR_kexec_load 104 +#define __NR_init_module 105 +#define __NR_delete_module 106 +#define __NR_timer_create 107 +#define __NR_timer_gettime 108 +#define __NR_timer_getoverrun 109 +#define __NR_timer_settime 110 +#define __NR_timer_delete 111 +#define __NR_clock_settime 112 +#define __NR_clock_gettime 113 +#define __NR_clock_getres 114 +#define __NR_clock_nanosleep 115 +#define __NR_syslog 116 +#define __NR_ptrace 117 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_getscheduler 120 +#define __NR_sched_getparam 121 +#define __NR_sched_setaffinity 122 +#define __NR_sched_getaffinity 123 +#define __NR_sched_yield 124 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_rr_get_interval 127 +#define __NR_restart_syscall 128 +#define __NR_kill 129 +#define __NR_tkill 130 +#define __NR_tgkill 131 +#define __NR_sigaltstack 132 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_setpriority 140 +#define __NR_getpriority 141 +#define __NR_reboot 142 +#define __NR_setregid 143 +#define __NR_setgid 144 +#define __NR_setreuid 145 +#define __NR_setuid 146 +#define __NR_setresuid 147 +#define __NR_getresuid 148 +#define __NR_setresgid 149 +#define __NR_getresgid 150 +#define __NR_setfsuid 151 +#define __NR_setfsgid 152 +#define __NR_times 153 +#define __NR_setpgid 154 +#define __NR_getpgid 155 +#define __NR_getsid 156 +#define __NR_setsid 157 +#define __NR_getgroups 158 +#define __NR_setgroups 159 +#define __NR_uname 160 +#define __NR_sethostname 161 +#define __NR_setdomainname 162 +#define __NR_getrlimit 163 +#define __NR_setrlimit 164 +#define __NR_getrusage 165 +#define __NR_umask 166 +#define __NR_prctl 167 +#define __NR_getcpu 168 +#define __NR_gettimeofday 169 +#define __NR_settimeofday 170 +#define __NR_adjtimex 171 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getuid 174 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getegid 177 +#define __NR_gettid 178 +#define __NR_sysinfo 179 +#define __NR_mq_open 180 +#define __NR_mq_unlink 181 +#define __NR_mq_timedsend 182 +#define __NR_mq_timedreceive 183 +#define __NR_mq_notify 184 +#define __NR_mq_getsetattr 185 +#define __NR_msgget 186 +#define __NR_msgctl 187 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_semget 190 +#define __NR_semctl 191 +#define __NR_semtimedop 192 +#define __NR_semop 193 +#define __NR_shmget 194 +#define __NR_shmctl 195 +#define __NR_shmat 196 +#define __NR_shmdt 197 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_bind 200 +#define __NR_listen 201 +#define __NR_accept 202 +#define __NR_connect 203 +#define __NR_getsockname 204 +#define __NR_getpeername 205 +#define __NR_sendto 206 +#define __NR_recvfrom 207 +#define __NR_setsockopt 208 +#define __NR_getsockopt 209 +#define __NR_shutdown 210 +#define __NR_sendmsg 211 +#define __NR_recvmsg 212 +#define __NR_readahead 213 +#define __NR_brk 214 +#define __NR_munmap 215 +#define __NR_mremap 216 +#define __NR_add_key 217 +#define __NR_request_key 218 +#define __NR_keyctl 219 +#define __NR_clone 220 +#define __NR_execve 221 +#define __NR_mmap 222 +#define __NR_fadvise64 223 +#define __NR_swapon 224 +#define __NR_swapoff 225 +#define __NR_mprotect 226 +#define __NR_msync 227 +#define __NR_mlock 228 +#define __NR_munlock 229 +#define __NR_mlockall 230 +#define __NR_munlockall 231 +#define __NR_mincore 232 +#define __NR_madvise 233 +#define __NR_remap_file_pages 234 +#define __NR_mbind 235 +#define __NR_get_mempolicy 236 +#define __NR_set_mempolicy 237 +#define __NR_migrate_pages 238 +#define __NR_move_pages 239 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_perf_event_open 241 +#define __NR_accept4 242 +#define __NR_recvmmsg 243 +#define __NR_arch_specific_syscall 244 +#define __NR_wait4 260 +#define __NR_prlimit64 261 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_name_to_handle_at 264 +#define __NR_open_by_handle_at 265 +#define __NR_clock_adjtime 266 +#define __NR_syncfs 267 +#define __NR_setns 268 +#define __NR_sendmmsg 269 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_kcmp 272 +#define __NR_finit_module 273 +#define __NR_sched_setattr 274 +#define __NR_sched_getattr 275 +#define __NR_renameat2 276 +#define __NR_seccomp 277 +#define __NR_getrandom 278 +#define __NR_memfd_create 279 +#define __NR_bpf 280 +#define __NR_execveat 281 +#define __NR_userfaultfd 282 +#define __NR_membarrier 283 +#define __NR_mlock2 284 +#define __NR_copy_file_range 285 +#define __NR_preadv2 286 +#define __NR_pwritev2 287 +#define __NR_pkey_mprotect 288 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 +#define __NR_statx 291 +#define __NR_io_pgetevents 292 +#define __NR_rseq 293 +#define __NR_kexec_file_load 294 +#define __NR_pidfd_send_signal 424 +#define __NR_io_uring_setup 425 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_open_tree 428 +#define __NR_move_mount 429 +#define __NR_fsopen 430 +#define __NR_fsconfig 431 +#define __NR_fsmount 432 +#define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 +#define __NR_close_range 436 +#define __NR_openat2 437 +#define __NR_pidfd_getfd 438 +#define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 +#define __NR_process_mrelease 448 +#define __NR_futex_waitv 449 +#define __NR_set_mempolicy_home_node 450 +#define __NR_cachestat 451 +#define __NR_fchmodat2 452 + +#define __NR_sysriscv __NR_arch_specific_syscall +#define __NR_riscv_flush_icache (__NR_sysriscv + 15) +#define SYS_io_setup 0 +#define SYS_io_destroy 1 +#define SYS_io_submit 2 +#define SYS_io_cancel 3 +#define SYS_io_getevents 4 +#define SYS_setxattr 5 +#define SYS_lsetxattr 6 +#define SYS_fsetxattr 7 +#define SYS_getxattr 8 +#define SYS_lgetxattr 9 +#define SYS_fgetxattr 10 +#define SYS_listxattr 11 +#define SYS_llistxattr 12 +#define SYS_flistxattr 13 +#define SYS_removexattr 14 +#define SYS_lremovexattr 15 +#define SYS_fremovexattr 16 +#define SYS_getcwd 17 +#define SYS_lookup_dcookie 18 +#define SYS_eventfd2 19 +#define SYS_epoll_create1 20 +#define SYS_epoll_ctl 21 +#define SYS_epoll_pwait 22 +#define SYS_dup 23 +#define SYS_dup3 24 +#define SYS_fcntl 25 +#define SYS_inotify_init1 26 +#define SYS_inotify_add_watch 27 +#define SYS_inotify_rm_watch 28 +#define SYS_ioctl 29 +#define SYS_ioprio_set 30 +#define SYS_ioprio_get 31 +#define SYS_flock 32 +#define SYS_mknodat 33 +#define SYS_mkdirat 34 +#define SYS_unlinkat 35 +#define SYS_symlinkat 36 +#define SYS_linkat 37 +#define SYS_umount2 39 +#define SYS_mount 40 +#define SYS_pivot_root 41 +#define SYS_nfsservctl 42 +#define SYS_statfs 43 +#define SYS_fstatfs 44 +#define SYS_truncate 45 +#define SYS_ftruncate 46 +#define SYS_fallocate 47 +#define SYS_faccessat 48 +#define SYS_chdir 49 +#define SYS_fchdir 50 +#define SYS_chroot 51 +#define SYS_fchmod 52 +#define SYS_fchmodat 53 +#define SYS_fchownat 54 +#define SYS_fchown 55 +#define SYS_openat 56 +#define SYS_close 57 +#define SYS_vhangup 58 +#define SYS_pipe2 59 +#define SYS_quotactl 60 +#define SYS_getdents64 61 +#define SYS_lseek 62 +#define SYS_read 63 +#define SYS_write 64 +#define SYS_readv 65 +#define SYS_writev 66 +#define SYS_pread64 67 +#define SYS_pwrite64 68 +#define SYS_preadv 69 +#define SYS_pwritev 70 +#define SYS_sendfile 71 +#define SYS_pselect6 72 +#define SYS_ppoll 73 +#define SYS_signalfd4 74 +#define SYS_vmsplice 75 +#define SYS_splice 76 +#define SYS_tee 77 +#define SYS_readlinkat 78 +#define SYS_newfstatat 79 +#define SYS_fstat 80 +#define SYS_sync 81 +#define SYS_fsync 82 +#define SYS_fdatasync 83 +#define SYS_sync_file_range 84 +#define SYS_timerfd_create 85 +#define SYS_timerfd_settime 86 +#define SYS_timerfd_gettime 87 +#define SYS_utimensat 88 +#define SYS_acct 89 +#define SYS_capget 90 +#define SYS_capset 91 +#define SYS_personality 92 +#define SYS_exit 93 +#define SYS_exit_group 94 +#define SYS_waitid 95 +#define SYS_set_tid_address 96 +#define SYS_unshare 97 +#define SYS_futex 98 +#define SYS_set_robust_list 99 +#define SYS_get_robust_list 100 +#define SYS_nanosleep 101 +#define SYS_getitimer 102 +#define SYS_setitimer 103 +#define SYS_kexec_load 104 +#define SYS_init_module 105 +#define SYS_delete_module 106 +#define SYS_timer_create 107 +#define SYS_timer_gettime 108 +#define SYS_timer_getoverrun 109 +#define SYS_timer_settime 110 +#define SYS_timer_delete 111 +#define SYS_clock_settime 112 +#define SYS_clock_gettime 113 +#define SYS_clock_getres 114 +#define SYS_clock_nanosleep 115 +#define SYS_syslog 116 +#define SYS_ptrace 117 +#define SYS_sched_setparam 118 +#define SYS_sched_setscheduler 119 +#define SYS_sched_getscheduler 120 +#define SYS_sched_getparam 121 +#define SYS_sched_setaffinity 122 +#define SYS_sched_getaffinity 123 +#define SYS_sched_yield 124 +#define SYS_sched_get_priority_max 125 +#define SYS_sched_get_priority_min 126 +#define SYS_sched_rr_get_interval 127 +#define SYS_restart_syscall 128 +#define SYS_kill 129 +#define SYS_tkill 130 +#define SYS_tgkill 131 +#define SYS_sigaltstack 132 +#define SYS_rt_sigsuspend 133 +#define SYS_rt_sigaction 134 +#define SYS_rt_sigprocmask 135 +#define SYS_rt_sigpending 136 +#define SYS_rt_sigtimedwait 137 +#define SYS_rt_sigqueueinfo 138 +#define SYS_rt_sigreturn 139 +#define SYS_setpriority 140 +#define SYS_getpriority 141 +#define SYS_reboot 142 +#define SYS_setregid 143 +#define SYS_setgid 144 +#define SYS_setreuid 145 +#define SYS_setuid 146 +#define SYS_setresuid 147 +#define SYS_getresuid 148 +#define SYS_setresgid 149 +#define SYS_getresgid 150 +#define SYS_setfsuid 151 +#define SYS_setfsgid 152 +#define SYS_times 153 +#define SYS_setpgid 154 +#define SYS_getpgid 155 +#define SYS_getsid 156 +#define SYS_setsid 157 +#define SYS_getgroups 158 +#define SYS_setgroups 159 +#define SYS_uname 160 +#define SYS_sethostname 161 +#define SYS_setdomainname 162 +#define SYS_getrlimit 163 +#define SYS_setrlimit 164 +#define SYS_getrusage 165 +#define SYS_umask 166 +#define SYS_prctl 167 +#define SYS_getcpu 168 +#define SYS_gettimeofday 169 +#define SYS_settimeofday 170 +#define SYS_adjtimex 171 +#define SYS_getpid 172 +#define SYS_getppid 173 +#define SYS_getuid 174 +#define SYS_geteuid 175 +#define SYS_getgid 176 +#define SYS_getegid 177 +#define SYS_gettid 178 +#define SYS_sysinfo 179 +#define SYS_mq_open 180 +#define SYS_mq_unlink 181 +#define SYS_mq_timedsend 182 +#define SYS_mq_timedreceive 183 +#define SYS_mq_notify 184 +#define SYS_mq_getsetattr 185 +#define SYS_msgget 186 +#define SYS_msgctl 187 +#define SYS_msgrcv 188 +#define SYS_msgsnd 189 +#define SYS_semget 190 +#define SYS_semctl 191 +#define SYS_semtimedop 192 +#define SYS_semop 193 +#define SYS_shmget 194 +#define SYS_shmctl 195 +#define SYS_shmat 196 +#define SYS_shmdt 197 +#define SYS_socket 198 +#define SYS_socketpair 199 +#define SYS_bind 200 +#define SYS_listen 201 +#define SYS_accept 202 +#define SYS_connect 203 +#define SYS_getsockname 204 +#define SYS_getpeername 205 +#define SYS_sendto 206 +#define SYS_recvfrom 207 +#define SYS_setsockopt 208 +#define SYS_getsockopt 209 +#define SYS_shutdown 210 +#define SYS_sendmsg 211 +#define SYS_recvmsg 212 +#define SYS_readahead 213 +#define SYS_brk 214 +#define SYS_munmap 215 +#define SYS_mremap 216 +#define SYS_add_key 217 +#define SYS_request_key 218 +#define SYS_keyctl 219 +#define SYS_clone 220 +#define SYS_execve 221 +#define SYS_mmap 222 +#define SYS_fadvise64 223 +#define SYS_swapon 224 +#define SYS_swapoff 225 +#define SYS_mprotect 226 +#define SYS_msync 227 +#define SYS_mlock 228 +#define SYS_munlock 229 +#define SYS_mlockall 230 +#define SYS_munlockall 231 +#define SYS_mincore 232 +#define SYS_madvise 233 +#define SYS_remap_file_pages 234 +#define SYS_mbind 235 +#define SYS_get_mempolicy 236 +#define SYS_set_mempolicy 237 +#define SYS_migrate_pages 238 +#define SYS_move_pages 239 +#define SYS_rt_tgsigqueueinfo 240 +#define SYS_perf_event_open 241 +#define SYS_accept4 242 +#define SYS_recvmmsg 243 +#define SYS_arch_specific_syscall 244 +#define SYS_wait4 260 +#define SYS_prlimit64 261 +#define SYS_fanotify_init 262 +#define SYS_fanotify_mark 263 +#define SYS_name_to_handle_at 264 +#define SYS_open_by_handle_at 265 +#define SYS_clock_adjtime 266 +#define SYS_syncfs 267 +#define SYS_setns 268 +#define SYS_sendmmsg 269 +#define SYS_process_vm_readv 270 +#define SYS_process_vm_writev 271 +#define SYS_kcmp 272 +#define SYS_finit_module 273 +#define SYS_sched_setattr 274 +#define SYS_sched_getattr 275 +#define SYS_renameat2 276 +#define SYS_seccomp 277 +#define SYS_getrandom 278 +#define SYS_memfd_create 279 +#define SYS_bpf 280 +#define SYS_execveat 281 +#define SYS_userfaultfd 282 +#define SYS_membarrier 283 +#define SYS_mlock2 284 +#define SYS_copy_file_range 285 +#define SYS_preadv2 286 +#define SYS_pwritev2 287 +#define SYS_pkey_mprotect 288 +#define SYS_pkey_alloc 289 +#define SYS_pkey_free 290 +#define SYS_statx 291 +#define SYS_io_pgetevents 292 +#define SYS_rseq 293 +#define SYS_kexec_file_load 294 +#define SYS_pidfd_send_signal 424 +#define SYS_io_uring_setup 425 +#define SYS_io_uring_enter 426 +#define SYS_io_uring_register 427 +#define SYS_open_tree 428 +#define SYS_move_mount 429 +#define SYS_fsopen 430 +#define SYS_fsconfig 431 +#define SYS_fsmount 432 +#define SYS_fspick 433 +#define SYS_pidfd_open 434 +#define SYS_clone3 435 +#define SYS_close_range 436 +#define SYS_openat2 437 +#define SYS_pidfd_getfd 438 +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 +#define SYS_process_mrelease 448 +#define SYS_futex_waitv 449 +#define SYS_set_mempolicy_home_node 450 +#define SYS_cachestat 451 +#define SYS_fchmodat2 452 +#define SYS_sysriscv __NR_arch_specific_syscall +#define SYS_riscv_flush_icache (__NR_sysriscv + 15) diff --git a/vendor/upstream/musl-1.2.5-generated/x86_64/alltypes.h b/vendor/upstream/musl-1.2.5-generated/x86_64/alltypes.h @@ -0,0 +1,415 @@ +#define _Addr long +#define _Int64 long +#define _Reg long + +#define __BYTE_ORDER 1234 +#define __LONG_MAX 0x7fffffffffffffffL + +#ifndef __cplusplus +#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) +typedef int wchar_t; +#define __DEFINED_wchar_t +#endif + +#endif + +#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2 +#if defined(__NEED_float_t) && !defined(__DEFINED_float_t) +typedef long double float_t; +#define __DEFINED_float_t +#endif + +#if defined(__NEED_double_t) && !defined(__DEFINED_double_t) +typedef long double double_t; +#define __DEFINED_double_t +#endif + +#else +#if defined(__NEED_float_t) && !defined(__DEFINED_float_t) +typedef float float_t; +#define __DEFINED_float_t +#endif + +#if defined(__NEED_double_t) && !defined(__DEFINED_double_t) +typedef double double_t; +#define __DEFINED_double_t +#endif + +#endif + +#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) +typedef struct { long long __ll; long double __ld; } max_align_t; +#define __DEFINED_max_align_t +#endif + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#define __USE_TIME_BITS64 1 + +#if defined(__NEED_size_t) && !defined(__DEFINED_size_t) +typedef unsigned _Addr size_t; +#define __DEFINED_size_t +#endif + +#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) +typedef unsigned _Addr uintptr_t; +#define __DEFINED_uintptr_t +#endif + +#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) +typedef _Addr ptrdiff_t; +#define __DEFINED_ptrdiff_t +#endif + +#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) +typedef _Addr ssize_t; +#define __DEFINED_ssize_t +#endif + +#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) +typedef _Addr intptr_t; +#define __DEFINED_intptr_t +#endif + +#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) +typedef _Addr regoff_t; +#define __DEFINED_regoff_t +#endif + +#if defined(__NEED_register_t) && !defined(__DEFINED_register_t) +typedef _Reg register_t; +#define __DEFINED_register_t +#endif + +#if defined(__NEED_time_t) && !defined(__DEFINED_time_t) +typedef _Int64 time_t; +#define __DEFINED_time_t +#endif + +#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) +typedef _Int64 suseconds_t; +#define __DEFINED_suseconds_t +#endif + + +#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) +typedef signed char int8_t; +#define __DEFINED_int8_t +#endif + +#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) +typedef signed short int16_t; +#define __DEFINED_int16_t +#endif + +#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) +typedef signed int int32_t; +#define __DEFINED_int32_t +#endif + +#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) +typedef signed _Int64 int64_t; +#define __DEFINED_int64_t +#endif + +#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) +typedef signed _Int64 intmax_t; +#define __DEFINED_intmax_t +#endif + +#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) +typedef unsigned char uint8_t; +#define __DEFINED_uint8_t +#endif + +#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) +typedef unsigned short uint16_t; +#define __DEFINED_uint16_t +#endif + +#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) +typedef unsigned int uint32_t; +#define __DEFINED_uint32_t +#endif + +#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) +typedef unsigned _Int64 uint64_t; +#define __DEFINED_uint64_t +#endif + +#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) +typedef unsigned _Int64 u_int64_t; +#define __DEFINED_u_int64_t +#endif + +#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) +typedef unsigned _Int64 uintmax_t; +#define __DEFINED_uintmax_t +#endif + + +#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) +typedef unsigned mode_t; +#define __DEFINED_mode_t +#endif + +#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) +typedef unsigned _Reg nlink_t; +#define __DEFINED_nlink_t +#endif + +#if defined(__NEED_off_t) && !defined(__DEFINED_off_t) +typedef _Int64 off_t; +#define __DEFINED_off_t +#endif + +#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) +typedef unsigned _Int64 ino_t; +#define __DEFINED_ino_t +#endif + +#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) +typedef unsigned _Int64 dev_t; +#define __DEFINED_dev_t +#endif + +#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) +typedef long blksize_t; +#define __DEFINED_blksize_t +#endif + +#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) +typedef _Int64 blkcnt_t; +#define __DEFINED_blkcnt_t +#endif + +#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) +typedef unsigned _Int64 fsblkcnt_t; +#define __DEFINED_fsblkcnt_t +#endif + +#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) +typedef unsigned _Int64 fsfilcnt_t; +#define __DEFINED_fsfilcnt_t +#endif + + +#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) +typedef unsigned wint_t; +#define __DEFINED_wint_t +#endif + +#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) +typedef unsigned long wctype_t; +#define __DEFINED_wctype_t +#endif + + +#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) +typedef void * timer_t; +#define __DEFINED_timer_t +#endif + +#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) +typedef int clockid_t; +#define __DEFINED_clockid_t +#endif + +#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) +typedef long clock_t; +#define __DEFINED_clock_t +#endif + +#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) +struct timeval { time_t tv_sec; suseconds_t tv_usec; }; +#define __DEFINED_struct_timeval +#endif + +#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) +struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); }; +#define __DEFINED_struct_timespec +#endif + + +#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) +typedef int pid_t; +#define __DEFINED_pid_t +#endif + +#if defined(__NEED_id_t) && !defined(__DEFINED_id_t) +typedef unsigned id_t; +#define __DEFINED_id_t +#endif + +#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) +typedef unsigned uid_t; +#define __DEFINED_uid_t +#endif + +#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) +typedef unsigned gid_t; +#define __DEFINED_gid_t +#endif + +#if defined(__NEED_key_t) && !defined(__DEFINED_key_t) +typedef int key_t; +#define __DEFINED_key_t +#endif + +#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) +typedef unsigned useconds_t; +#define __DEFINED_useconds_t +#endif + + +#ifdef __cplusplus +#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) +typedef unsigned long pthread_t; +#define __DEFINED_pthread_t +#endif + +#else +#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) +typedef struct __pthread * pthread_t; +#define __DEFINED_pthread_t +#endif + +#endif +#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) +typedef int pthread_once_t; +#define __DEFINED_pthread_once_t +#endif + +#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) +typedef unsigned pthread_key_t; +#define __DEFINED_pthread_key_t +#endif + +#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) +typedef int pthread_spinlock_t; +#define __DEFINED_pthread_spinlock_t +#endif + +#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) +typedef struct { unsigned __attr; } pthread_mutexattr_t; +#define __DEFINED_pthread_mutexattr_t +#endif + +#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) +typedef struct { unsigned __attr; } pthread_condattr_t; +#define __DEFINED_pthread_condattr_t +#endif + +#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) +typedef struct { unsigned __attr; } pthread_barrierattr_t; +#define __DEFINED_pthread_barrierattr_t +#endif + +#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) +typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; +#define __DEFINED_pthread_rwlockattr_t +#endif + + +#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE) +struct _IO_FILE { char __x; }; +#define __DEFINED_struct__IO_FILE +#endif + +#if defined(__NEED_FILE) && !defined(__DEFINED_FILE) +typedef struct _IO_FILE FILE; +#define __DEFINED_FILE +#endif + + +#if defined(__NEED_va_list) && !defined(__DEFINED_va_list) +typedef __builtin_va_list va_list; +#define __DEFINED_va_list +#endif + +#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) +typedef __builtin_va_list __isoc_va_list; +#define __DEFINED___isoc_va_list +#endif + + +#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) +typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; +#define __DEFINED_mbstate_t +#endif + + +#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) +typedef struct __locale_struct * locale_t; +#define __DEFINED_locale_t +#endif + + +#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) +typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; +#define __DEFINED_sigset_t +#endif + + +#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) +struct iovec { void *iov_base; size_t iov_len; }; +#define __DEFINED_struct_iovec +#endif + + +#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize) +struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; }; +#define __DEFINED_struct_winsize +#endif + + +#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) +typedef unsigned socklen_t; +#define __DEFINED_socklen_t +#endif + +#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) +typedef unsigned short sa_family_t; +#define __DEFINED_sa_family_t +#endif + + +#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) +typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t; +#define __DEFINED_pthread_attr_t +#endif + +#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) +typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t; +#define __DEFINED_pthread_mutex_t +#endif + +#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) +typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t; +#define __DEFINED_mtx_t +#endif + +#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) +typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t; +#define __DEFINED_pthread_cond_t +#endif + +#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) +typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t; +#define __DEFINED_cnd_t +#endif + +#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) +typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t; +#define __DEFINED_pthread_rwlock_t +#endif + +#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) +typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t; +#define __DEFINED_pthread_barrier_t +#endif + + +#undef _Addr +#undef _Int64 +#undef _Reg diff --git a/vendor/upstream/musl-1.2.5-generated/x86_64/syscall.h b/vendor/upstream/musl-1.2.5-generated/x86_64/syscall.h @@ -0,0 +1,727 @@ +#define __NR_read 0 +#define __NR_write 1 +#define __NR_open 2 +#define __NR_close 3 +#define __NR_stat 4 +#define __NR_fstat 5 +#define __NR_lstat 6 +#define __NR_poll 7 +#define __NR_lseek 8 +#define __NR_mmap 9 +#define __NR_mprotect 10 +#define __NR_munmap 11 +#define __NR_brk 12 +#define __NR_rt_sigaction 13 +#define __NR_rt_sigprocmask 14 +#define __NR_rt_sigreturn 15 +#define __NR_ioctl 16 +#define __NR_pread64 17 +#define __NR_pwrite64 18 +#define __NR_readv 19 +#define __NR_writev 20 +#define __NR_access 21 +#define __NR_pipe 22 +#define __NR_select 23 +#define __NR_sched_yield 24 +#define __NR_mremap 25 +#define __NR_msync 26 +#define __NR_mincore 27 +#define __NR_madvise 28 +#define __NR_shmget 29 +#define __NR_shmat 30 +#define __NR_shmctl 31 +#define __NR_dup 32 +#define __NR_dup2 33 +#define __NR_pause 34 +#define __NR_nanosleep 35 +#define __NR_getitimer 36 +#define __NR_alarm 37 +#define __NR_setitimer 38 +#define __NR_getpid 39 +#define __NR_sendfile 40 +#define __NR_socket 41 +#define __NR_connect 42 +#define __NR_accept 43 +#define __NR_sendto 44 +#define __NR_recvfrom 45 +#define __NR_sendmsg 46 +#define __NR_recvmsg 47 +#define __NR_shutdown 48 +#define __NR_bind 49 +#define __NR_listen 50 +#define __NR_getsockname 51 +#define __NR_getpeername 52 +#define __NR_socketpair 53 +#define __NR_setsockopt 54 +#define __NR_getsockopt 55 +#define __NR_clone 56 +#define __NR_fork 57 +#define __NR_vfork 58 +#define __NR_execve 59 +#define __NR_exit 60 +#define __NR_wait4 61 +#define __NR_kill 62 +#define __NR_uname 63 +#define __NR_semget 64 +#define __NR_semop 65 +#define __NR_semctl 66 +#define __NR_shmdt 67 +#define __NR_msgget 68 +#define __NR_msgsnd 69 +#define __NR_msgrcv 70 +#define __NR_msgctl 71 +#define __NR_fcntl 72 +#define __NR_flock 73 +#define __NR_fsync 74 +#define __NR_fdatasync 75 +#define __NR_truncate 76 +#define __NR_ftruncate 77 +#define __NR_getdents 78 +#define __NR_getcwd 79 +#define __NR_chdir 80 +#define __NR_fchdir 81 +#define __NR_rename 82 +#define __NR_mkdir 83 +#define __NR_rmdir 84 +#define __NR_creat 85 +#define __NR_link 86 +#define __NR_unlink 87 +#define __NR_symlink 88 +#define __NR_readlink 89 +#define __NR_chmod 90 +#define __NR_fchmod 91 +#define __NR_chown 92 +#define __NR_fchown 93 +#define __NR_lchown 94 +#define __NR_umask 95 +#define __NR_gettimeofday 96 +#define __NR_getrlimit 97 +#define __NR_getrusage 98 +#define __NR_sysinfo 99 +#define __NR_times 100 +#define __NR_ptrace 101 +#define __NR_getuid 102 +#define __NR_syslog 103 +#define __NR_getgid 104 +#define __NR_setuid 105 +#define __NR_setgid 106 +#define __NR_geteuid 107 +#define __NR_getegid 108 +#define __NR_setpgid 109 +#define __NR_getppid 110 +#define __NR_getpgrp 111 +#define __NR_setsid 112 +#define __NR_setreuid 113 +#define __NR_setregid 114 +#define __NR_getgroups 115 +#define __NR_setgroups 116 +#define __NR_setresuid 117 +#define __NR_getresuid 118 +#define __NR_setresgid 119 +#define __NR_getresgid 120 +#define __NR_getpgid 121 +#define __NR_setfsuid 122 +#define __NR_setfsgid 123 +#define __NR_getsid 124 +#define __NR_capget 125 +#define __NR_capset 126 +#define __NR_rt_sigpending 127 +#define __NR_rt_sigtimedwait 128 +#define __NR_rt_sigqueueinfo 129 +#define __NR_rt_sigsuspend 130 +#define __NR_sigaltstack 131 +#define __NR_utime 132 +#define __NR_mknod 133 +#define __NR_uselib 134 +#define __NR_personality 135 +#define __NR_ustat 136 +#define __NR_statfs 137 +#define __NR_fstatfs 138 +#define __NR_sysfs 139 +#define __NR_getpriority 140 +#define __NR_setpriority 141 +#define __NR_sched_setparam 142 +#define __NR_sched_getparam 143 +#define __NR_sched_setscheduler 144 +#define __NR_sched_getscheduler 145 +#define __NR_sched_get_priority_max 146 +#define __NR_sched_get_priority_min 147 +#define __NR_sched_rr_get_interval 148 +#define __NR_mlock 149 +#define __NR_munlock 150 +#define __NR_mlockall 151 +#define __NR_munlockall 152 +#define __NR_vhangup 153 +#define __NR_modify_ldt 154 +#define __NR_pivot_root 155 +#define __NR__sysctl 156 +#define __NR_prctl 157 +#define __NR_arch_prctl 158 +#define __NR_adjtimex 159 +#define __NR_setrlimit 160 +#define __NR_chroot 161 +#define __NR_sync 162 +#define __NR_acct 163 +#define __NR_settimeofday 164 +#define __NR_mount 165 +#define __NR_umount2 166 +#define __NR_swapon 167 +#define __NR_swapoff 168 +#define __NR_reboot 169 +#define __NR_sethostname 170 +#define __NR_setdomainname 171 +#define __NR_iopl 172 +#define __NR_ioperm 173 +#define __NR_create_module 174 +#define __NR_init_module 175 +#define __NR_delete_module 176 +#define __NR_get_kernel_syms 177 +#define __NR_query_module 178 +#define __NR_quotactl 179 +#define __NR_nfsservctl 180 +#define __NR_getpmsg 181 +#define __NR_putpmsg 182 +#define __NR_afs_syscall 183 +#define __NR_tuxcall 184 +#define __NR_security 185 +#define __NR_gettid 186 +#define __NR_readahead 187 +#define __NR_setxattr 188 +#define __NR_lsetxattr 189 +#define __NR_fsetxattr 190 +#define __NR_getxattr 191 +#define __NR_lgetxattr 192 +#define __NR_fgetxattr 193 +#define __NR_listxattr 194 +#define __NR_llistxattr 195 +#define __NR_flistxattr 196 +#define __NR_removexattr 197 +#define __NR_lremovexattr 198 +#define __NR_fremovexattr 199 +#define __NR_tkill 200 +#define __NR_time 201 +#define __NR_futex 202 +#define __NR_sched_setaffinity 203 +#define __NR_sched_getaffinity 204 +#define __NR_set_thread_area 205 +#define __NR_io_setup 206 +#define __NR_io_destroy 207 +#define __NR_io_getevents 208 +#define __NR_io_submit 209 +#define __NR_io_cancel 210 +#define __NR_get_thread_area 211 +#define __NR_lookup_dcookie 212 +#define __NR_epoll_create 213 +#define __NR_epoll_ctl_old 214 +#define __NR_epoll_wait_old 215 +#define __NR_remap_file_pages 216 +#define __NR_getdents64 217 +#define __NR_set_tid_address 218 +#define __NR_restart_syscall 219 +#define __NR_semtimedop 220 +#define __NR_fadvise64 221 +#define __NR_timer_create 222 +#define __NR_timer_settime 223 +#define __NR_timer_gettime 224 +#define __NR_timer_getoverrun 225 +#define __NR_timer_delete 226 +#define __NR_clock_settime 227 +#define __NR_clock_gettime 228 +#define __NR_clock_getres 229 +#define __NR_clock_nanosleep 230 +#define __NR_exit_group 231 +#define __NR_epoll_wait 232 +#define __NR_epoll_ctl 233 +#define __NR_tgkill 234 +#define __NR_utimes 235 +#define __NR_vserver 236 +#define __NR_mbind 237 +#define __NR_set_mempolicy 238 +#define __NR_get_mempolicy 239 +#define __NR_mq_open 240 +#define __NR_mq_unlink 241 +#define __NR_mq_timedsend 242 +#define __NR_mq_timedreceive 243 +#define __NR_mq_notify 244 +#define __NR_mq_getsetattr 245 +#define __NR_kexec_load 246 +#define __NR_waitid 247 +#define __NR_add_key 248 +#define __NR_request_key 249 +#define __NR_keyctl 250 +#define __NR_ioprio_set 251 +#define __NR_ioprio_get 252 +#define __NR_inotify_init 253 +#define __NR_inotify_add_watch 254 +#define __NR_inotify_rm_watch 255 +#define __NR_migrate_pages 256 +#define __NR_openat 257 +#define __NR_mkdirat 258 +#define __NR_mknodat 259 +#define __NR_fchownat 260 +#define __NR_futimesat 261 +#define __NR_newfstatat 262 +#define __NR_unlinkat 263 +#define __NR_renameat 264 +#define __NR_linkat 265 +#define __NR_symlinkat 266 +#define __NR_readlinkat 267 +#define __NR_fchmodat 268 +#define __NR_faccessat 269 +#define __NR_pselect6 270 +#define __NR_ppoll 271 +#define __NR_unshare 272 +#define __NR_set_robust_list 273 +#define __NR_get_robust_list 274 +#define __NR_splice 275 +#define __NR_tee 276 +#define __NR_sync_file_range 277 +#define __NR_vmsplice 278 +#define __NR_move_pages 279 +#define __NR_utimensat 280 +#define __NR_epoll_pwait 281 +#define __NR_signalfd 282 +#define __NR_timerfd_create 283 +#define __NR_eventfd 284 +#define __NR_fallocate 285 +#define __NR_timerfd_settime 286 +#define __NR_timerfd_gettime 287 +#define __NR_accept4 288 +#define __NR_signalfd4 289 +#define __NR_eventfd2 290 +#define __NR_epoll_create1 291 +#define __NR_dup3 292 +#define __NR_pipe2 293 +#define __NR_inotify_init1 294 +#define __NR_preadv 295 +#define __NR_pwritev 296 +#define __NR_rt_tgsigqueueinfo 297 +#define __NR_perf_event_open 298 +#define __NR_recvmmsg 299 +#define __NR_fanotify_init 300 +#define __NR_fanotify_mark 301 +#define __NR_prlimit64 302 +#define __NR_name_to_handle_at 303 +#define __NR_open_by_handle_at 304 +#define __NR_clock_adjtime 305 +#define __NR_syncfs 306 +#define __NR_sendmmsg 307 +#define __NR_setns 308 +#define __NR_getcpu 309 +#define __NR_process_vm_readv 310 +#define __NR_process_vm_writev 311 +#define __NR_kcmp 312 +#define __NR_finit_module 313 +#define __NR_sched_setattr 314 +#define __NR_sched_getattr 315 +#define __NR_renameat2 316 +#define __NR_seccomp 317 +#define __NR_getrandom 318 +#define __NR_memfd_create 319 +#define __NR_kexec_file_load 320 +#define __NR_bpf 321 +#define __NR_execveat 322 +#define __NR_userfaultfd 323 +#define __NR_membarrier 324 +#define __NR_mlock2 325 +#define __NR_copy_file_range 326 +#define __NR_preadv2 327 +#define __NR_pwritev2 328 +#define __NR_pkey_mprotect 329 +#define __NR_pkey_alloc 330 +#define __NR_pkey_free 331 +#define __NR_statx 332 +#define __NR_io_pgetevents 333 +#define __NR_rseq 334 +#define __NR_pidfd_send_signal 424 +#define __NR_io_uring_setup 425 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_open_tree 428 +#define __NR_move_mount 429 +#define __NR_fsopen 430 +#define __NR_fsconfig 431 +#define __NR_fsmount 432 +#define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 +#define __NR_close_range 436 +#define __NR_openat2 437 +#define __NR_pidfd_getfd 438 +#define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 +#define __NR_memfd_secret 447 +#define __NR_process_mrelease 448 +#define __NR_futex_waitv 449 +#define __NR_set_mempolicy_home_node 450 +#define __NR_cachestat 451 +#define __NR_fchmodat2 452 + +#define SYS_read 0 +#define SYS_write 1 +#define SYS_open 2 +#define SYS_close 3 +#define SYS_stat 4 +#define SYS_fstat 5 +#define SYS_lstat 6 +#define SYS_poll 7 +#define SYS_lseek 8 +#define SYS_mmap 9 +#define SYS_mprotect 10 +#define SYS_munmap 11 +#define SYS_brk 12 +#define SYS_rt_sigaction 13 +#define SYS_rt_sigprocmask 14 +#define SYS_rt_sigreturn 15 +#define SYS_ioctl 16 +#define SYS_pread64 17 +#define SYS_pwrite64 18 +#define SYS_readv 19 +#define SYS_writev 20 +#define SYS_access 21 +#define SYS_pipe 22 +#define SYS_select 23 +#define SYS_sched_yield 24 +#define SYS_mremap 25 +#define SYS_msync 26 +#define SYS_mincore 27 +#define SYS_madvise 28 +#define SYS_shmget 29 +#define SYS_shmat 30 +#define SYS_shmctl 31 +#define SYS_dup 32 +#define SYS_dup2 33 +#define SYS_pause 34 +#define SYS_nanosleep 35 +#define SYS_getitimer 36 +#define SYS_alarm 37 +#define SYS_setitimer 38 +#define SYS_getpid 39 +#define SYS_sendfile 40 +#define SYS_socket 41 +#define SYS_connect 42 +#define SYS_accept 43 +#define SYS_sendto 44 +#define SYS_recvfrom 45 +#define SYS_sendmsg 46 +#define SYS_recvmsg 47 +#define SYS_shutdown 48 +#define SYS_bind 49 +#define SYS_listen 50 +#define SYS_getsockname 51 +#define SYS_getpeername 52 +#define SYS_socketpair 53 +#define SYS_setsockopt 54 +#define SYS_getsockopt 55 +#define SYS_clone 56 +#define SYS_fork 57 +#define SYS_vfork 58 +#define SYS_execve 59 +#define SYS_exit 60 +#define SYS_wait4 61 +#define SYS_kill 62 +#define SYS_uname 63 +#define SYS_semget 64 +#define SYS_semop 65 +#define SYS_semctl 66 +#define SYS_shmdt 67 +#define SYS_msgget 68 +#define SYS_msgsnd 69 +#define SYS_msgrcv 70 +#define SYS_msgctl 71 +#define SYS_fcntl 72 +#define SYS_flock 73 +#define SYS_fsync 74 +#define SYS_fdatasync 75 +#define SYS_truncate 76 +#define SYS_ftruncate 77 +#define SYS_getdents 78 +#define SYS_getcwd 79 +#define SYS_chdir 80 +#define SYS_fchdir 81 +#define SYS_rename 82 +#define SYS_mkdir 83 +#define SYS_rmdir 84 +#define SYS_creat 85 +#define SYS_link 86 +#define SYS_unlink 87 +#define SYS_symlink 88 +#define SYS_readlink 89 +#define SYS_chmod 90 +#define SYS_fchmod 91 +#define SYS_chown 92 +#define SYS_fchown 93 +#define SYS_lchown 94 +#define SYS_umask 95 +#define SYS_gettimeofday 96 +#define SYS_getrlimit 97 +#define SYS_getrusage 98 +#define SYS_sysinfo 99 +#define SYS_times 100 +#define SYS_ptrace 101 +#define SYS_getuid 102 +#define SYS_syslog 103 +#define SYS_getgid 104 +#define SYS_setuid 105 +#define SYS_setgid 106 +#define SYS_geteuid 107 +#define SYS_getegid 108 +#define SYS_setpgid 109 +#define SYS_getppid 110 +#define SYS_getpgrp 111 +#define SYS_setsid 112 +#define SYS_setreuid 113 +#define SYS_setregid 114 +#define SYS_getgroups 115 +#define SYS_setgroups 116 +#define SYS_setresuid 117 +#define SYS_getresuid 118 +#define SYS_setresgid 119 +#define SYS_getresgid 120 +#define SYS_getpgid 121 +#define SYS_setfsuid 122 +#define SYS_setfsgid 123 +#define SYS_getsid 124 +#define SYS_capget 125 +#define SYS_capset 126 +#define SYS_rt_sigpending 127 +#define SYS_rt_sigtimedwait 128 +#define SYS_rt_sigqueueinfo 129 +#define SYS_rt_sigsuspend 130 +#define SYS_sigaltstack 131 +#define SYS_utime 132 +#define SYS_mknod 133 +#define SYS_uselib 134 +#define SYS_personality 135 +#define SYS_ustat 136 +#define SYS_statfs 137 +#define SYS_fstatfs 138 +#define SYS_sysfs 139 +#define SYS_getpriority 140 +#define SYS_setpriority 141 +#define SYS_sched_setparam 142 +#define SYS_sched_getparam 143 +#define SYS_sched_setscheduler 144 +#define SYS_sched_getscheduler 145 +#define SYS_sched_get_priority_max 146 +#define SYS_sched_get_priority_min 147 +#define SYS_sched_rr_get_interval 148 +#define SYS_mlock 149 +#define SYS_munlock 150 +#define SYS_mlockall 151 +#define SYS_munlockall 152 +#define SYS_vhangup 153 +#define SYS_modify_ldt 154 +#define SYS_pivot_root 155 +#define SYS__sysctl 156 +#define SYS_prctl 157 +#define SYS_arch_prctl 158 +#define SYS_adjtimex 159 +#define SYS_setrlimit 160 +#define SYS_chroot 161 +#define SYS_sync 162 +#define SYS_acct 163 +#define SYS_settimeofday 164 +#define SYS_mount 165 +#define SYS_umount2 166 +#define SYS_swapon 167 +#define SYS_swapoff 168 +#define SYS_reboot 169 +#define SYS_sethostname 170 +#define SYS_setdomainname 171 +#define SYS_iopl 172 +#define SYS_ioperm 173 +#define SYS_create_module 174 +#define SYS_init_module 175 +#define SYS_delete_module 176 +#define SYS_get_kernel_syms 177 +#define SYS_query_module 178 +#define SYS_quotactl 179 +#define SYS_nfsservctl 180 +#define SYS_getpmsg 181 +#define SYS_putpmsg 182 +#define SYS_afs_syscall 183 +#define SYS_tuxcall 184 +#define SYS_security 185 +#define SYS_gettid 186 +#define SYS_readahead 187 +#define SYS_setxattr 188 +#define SYS_lsetxattr 189 +#define SYS_fsetxattr 190 +#define SYS_getxattr 191 +#define SYS_lgetxattr 192 +#define SYS_fgetxattr 193 +#define SYS_listxattr 194 +#define SYS_llistxattr 195 +#define SYS_flistxattr 196 +#define SYS_removexattr 197 +#define SYS_lremovexattr 198 +#define SYS_fremovexattr 199 +#define SYS_tkill 200 +#define SYS_time 201 +#define SYS_futex 202 +#define SYS_sched_setaffinity 203 +#define SYS_sched_getaffinity 204 +#define SYS_set_thread_area 205 +#define SYS_io_setup 206 +#define SYS_io_destroy 207 +#define SYS_io_getevents 208 +#define SYS_io_submit 209 +#define SYS_io_cancel 210 +#define SYS_get_thread_area 211 +#define SYS_lookup_dcookie 212 +#define SYS_epoll_create 213 +#define SYS_epoll_ctl_old 214 +#define SYS_epoll_wait_old 215 +#define SYS_remap_file_pages 216 +#define SYS_getdents64 217 +#define SYS_set_tid_address 218 +#define SYS_restart_syscall 219 +#define SYS_semtimedop 220 +#define SYS_fadvise64 221 +#define SYS_timer_create 222 +#define SYS_timer_settime 223 +#define SYS_timer_gettime 224 +#define SYS_timer_getoverrun 225 +#define SYS_timer_delete 226 +#define SYS_clock_settime 227 +#define SYS_clock_gettime 228 +#define SYS_clock_getres 229 +#define SYS_clock_nanosleep 230 +#define SYS_exit_group 231 +#define SYS_epoll_wait 232 +#define SYS_epoll_ctl 233 +#define SYS_tgkill 234 +#define SYS_utimes 235 +#define SYS_vserver 236 +#define SYS_mbind 237 +#define SYS_set_mempolicy 238 +#define SYS_get_mempolicy 239 +#define SYS_mq_open 240 +#define SYS_mq_unlink 241 +#define SYS_mq_timedsend 242 +#define SYS_mq_timedreceive 243 +#define SYS_mq_notify 244 +#define SYS_mq_getsetattr 245 +#define SYS_kexec_load 246 +#define SYS_waitid 247 +#define SYS_add_key 248 +#define SYS_request_key 249 +#define SYS_keyctl 250 +#define SYS_ioprio_set 251 +#define SYS_ioprio_get 252 +#define SYS_inotify_init 253 +#define SYS_inotify_add_watch 254 +#define SYS_inotify_rm_watch 255 +#define SYS_migrate_pages 256 +#define SYS_openat 257 +#define SYS_mkdirat 258 +#define SYS_mknodat 259 +#define SYS_fchownat 260 +#define SYS_futimesat 261 +#define SYS_newfstatat 262 +#define SYS_unlinkat 263 +#define SYS_renameat 264 +#define SYS_linkat 265 +#define SYS_symlinkat 266 +#define SYS_readlinkat 267 +#define SYS_fchmodat 268 +#define SYS_faccessat 269 +#define SYS_pselect6 270 +#define SYS_ppoll 271 +#define SYS_unshare 272 +#define SYS_set_robust_list 273 +#define SYS_get_robust_list 274 +#define SYS_splice 275 +#define SYS_tee 276 +#define SYS_sync_file_range 277 +#define SYS_vmsplice 278 +#define SYS_move_pages 279 +#define SYS_utimensat 280 +#define SYS_epoll_pwait 281 +#define SYS_signalfd 282 +#define SYS_timerfd_create 283 +#define SYS_eventfd 284 +#define SYS_fallocate 285 +#define SYS_timerfd_settime 286 +#define SYS_timerfd_gettime 287 +#define SYS_accept4 288 +#define SYS_signalfd4 289 +#define SYS_eventfd2 290 +#define SYS_epoll_create1 291 +#define SYS_dup3 292 +#define SYS_pipe2 293 +#define SYS_inotify_init1 294 +#define SYS_preadv 295 +#define SYS_pwritev 296 +#define SYS_rt_tgsigqueueinfo 297 +#define SYS_perf_event_open 298 +#define SYS_recvmmsg 299 +#define SYS_fanotify_init 300 +#define SYS_fanotify_mark 301 +#define SYS_prlimit64 302 +#define SYS_name_to_handle_at 303 +#define SYS_open_by_handle_at 304 +#define SYS_clock_adjtime 305 +#define SYS_syncfs 306 +#define SYS_sendmmsg 307 +#define SYS_setns 308 +#define SYS_getcpu 309 +#define SYS_process_vm_readv 310 +#define SYS_process_vm_writev 311 +#define SYS_kcmp 312 +#define SYS_finit_module 313 +#define SYS_sched_setattr 314 +#define SYS_sched_getattr 315 +#define SYS_renameat2 316 +#define SYS_seccomp 317 +#define SYS_getrandom 318 +#define SYS_memfd_create 319 +#define SYS_kexec_file_load 320 +#define SYS_bpf 321 +#define SYS_execveat 322 +#define SYS_userfaultfd 323 +#define SYS_membarrier 324 +#define SYS_mlock2 325 +#define SYS_copy_file_range 326 +#define SYS_preadv2 327 +#define SYS_pwritev2 328 +#define SYS_pkey_mprotect 329 +#define SYS_pkey_alloc 330 +#define SYS_pkey_free 331 +#define SYS_statx 332 +#define SYS_io_pgetevents 333 +#define SYS_rseq 334 +#define SYS_pidfd_send_signal 424 +#define SYS_io_uring_setup 425 +#define SYS_io_uring_enter 426 +#define SYS_io_uring_register 427 +#define SYS_open_tree 428 +#define SYS_move_mount 429 +#define SYS_fsopen 430 +#define SYS_fsconfig 431 +#define SYS_fsmount 432 +#define SYS_fspick 433 +#define SYS_pidfd_open 434 +#define SYS_clone3 435 +#define SYS_close_range 436 +#define SYS_openat2 437 +#define SYS_pidfd_getfd 438 +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 +#define SYS_memfd_secret 447 +#define SYS_process_mrelease 448 +#define SYS_futex_waitv 449 +#define SYS_set_mempolicy_home_node 450 +#define SYS_cachestat 451 +#define SYS_fchmodat2 452 diff --git a/vendor/upstream/musl-1.2.5-skip-aarch64.txt b/vendor/upstream/musl-1.2.5-skip-aarch64.txt @@ -0,0 +1,8 @@ +src/math/__cosl.c +src/math/__sinl.c +src/math/__tanl.c +src/math/exp2l.c +src/math/fmaf.c +src/math/j1f.c +src/math/pow_data.c +src/thread/__unmapself.c