Skip to main content

llvm-patch

Add, update or drop a change to LLVM in xclang's patches/ (patches/NNNN-name/NNNN.patch + README.md), validate it, and track its upstream state. Use when a clang/lld/libc++ bug needs fixing in xclang's build.

Datos de origen

Repositorio
clice-io/xclang
Última actividad en el origen
6 de octubre de 2026 a las 22:56
Idioma detectado de SKILL.md
inglés
Estrellas
9
Forks
1

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
name
llvm-patch
description
Add, update or drop a change to LLVM in xclang's patches/ (patches/NNNN-name/NNNN.patch + README.md), validate it, and track its upstream state. Use when a clang/lld/libc++ bug needs fixing in xclang's build.
# A patch to LLVM `toolchain/common.ts` (`patches()`, `llvmSource()`) applies every `patches/NNNN-name/*.patch` in directory order right after unpacking `llvm-project-<LLVM_VERSION>.src.tar.xz`, with `patch -p1 -F0 --forward`: no fuzz, a patch applies where it was made or the build fails. The series is recorded in libclang's `XCLANG_PATCHES`. Numbers are never reused (0005 stays gone). 1. **Directory** `patches/NNNN-short-name/`, next free number, holding exactly one `NNNN.patch` and a `README.md`. 2. **The patch**: against the release source (a git checkout of `llvmorg-<LLVM_VERSION>` is the same tree), paths `a/…`, `b/…`, as `git diff` writes them. Upstream's fix when there is one, without its test. `*.patch` is `-text` in .gitattributes: never let an editor touch its line endings. 3. **README.md**, in the voice of the others (`patches/0007-*/README.md`): - `# <what it fixes>`, then what goes wrong, who hits it (clice, catter, ...), and what the patch does; - `- Upstream:` the issue and the PR, their state (open, merged in <version>), duplicates; - `- From:` where the patch came from, if not written here; - `- Checked:` how it was verified: the file compiled against the release's headers, a run on an exp branch with and without it (run ids), and the smoke-test case. 4. **Validate locally** (cheap): `patch -p1 -F0 --dry-run -d <llvm-project at llvmorg-<version>> -i patches/NNNN-*/NNNN.patch`; compile the patched translation unit against the release's headers. Never build LLVM here. 5. **A check that fails without it**, in tests/toolchain/smoke.ts (runs on every host's toolchain), or tests/bazel / tests/cmake when it is about them. Confirm on CI: push `exp/<name>` and run release.yml (`stages=runtimes,instrumented,train,toolchain,asan,package,test`, or fewer with `reuse-run`); for a quick A/B, a toolchain without PGO is enough (`profile-run` none, `hosts` the one that matters). 6. **Docs**: the table in docs/en/reference/patches.md, an Unreleased entry in CHANGELOG.md ("**NNNN** added, …"). 7. **Upstream**: report or send it only when the user asks; then record the link in the README (`patches: NNNN sent upstream`). Mention xclang upstream only where needed. Dropping one (upstream took it, or something replaces it): delete the directory, say why in the commit, update docs/en/reference/patches.md and CHANGELOG.md. Updating one: keep the number, regenerate the patch, update `Checked:`.
Ver en GitHub