ac-compilers-and-abis
What a compiler and an ABI actually decide: compilation phases and where diagnostics come from, the distinction between language semantics and target behaviour, undefined behaviour and what it licenses the optimizer to do, the ABI as a binding contract for layout and calls, name mangling and symbol resolution, linking static versus dynamic and symbol visibility, and the written toolchain record. It explains how translation and linkage constrain code; it never recommends a compiler and never promises a binary outcome. Use when asking "undefined behavior", "ABI compatibility", "name mangling", "static versus dynamic linking", "symbol visibility", "linker errors", "compilation phases", "calling convention", "why does this work in debug but not release", "why is this struct size different". Not for build-system wiring and caching (ac-monorepo-and-build-systems), not for language runtime and concurrency (ac-async-and-concurrency), not for binary format design on disk (ac-binary-formats).
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- ac-compilers-and-abis
- status
- seedling
- license
- MIT
- metadata
- { "domain": "software-engineering" }
- description
- What a compiler and an ABI actually decide: compilation phases and where diagnostics come from, the distinction between language semantics and target behaviour, undefined behaviour and what it licenses the optimizer to do, the ABI as a binding contract for layout and calls, name mangling and symbol resolution, linking static versus dynamic and symbol visibility, and the written toolchain record. It explains how translation and linkage constrain code; it never recommends a compiler and never promises a binary outcome. Use when asking "undefined behavior", "ABI compatibility", "name mangling", "static versus dynamic linking", "symbol visibility", "linker errors", "compilation phases", "calling convention", "why does this work in debug but not release", "why is this struct size different". Not for build-system wiring and caching (ac-monorepo-and-build-systems), not for language runtime and concurrency (ac-async-and-concurrency), not for binary format design on disk (ac-binary-formats).
02 资源文件 10
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md377 B
- 参考文档subskills/abi-as-contract.md3.4 KB
- 参考文档subskills/compilation-phases.md3.0 KB
- 参考文档subskills/linking-models.md3.3 KB
- 参考文档subskills/name-mangling-and-symbols.md3.0 KB
- 参考文档subskills/semantics-versus-target.md3.4 KB
- 参考文档subskills/toolchain-record.md3.1 KB
- 参考文档subskills/undefined-behaviour.md3.2 KB
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Compilers and ABIs
Overview
Between source and a running program sit two contracts most engineers meet only when they break. The first is the compiler: translation proceeds in phases, and where an error surfaces determines which one fired — a diagnostic at parse time, at semantic analysis, or a misbehaviour at runtime that no diagnostic caught. The second is the ABI: the binary-level agreement on how types are laid out, how functions receive arguments, and how symbols are named, shared across separately compiled code.
The practical consequences surface as puzzles that seem like compiler bugs. A program that works in debug and breaks in release, or a struct whose size differs between modules, is usually meeting an ABI interpretation difference or an undefined behaviour the optimizer exploited. This skill explains the machinery behind those outcomes and how to read them as evidence about the contracts.
Primary sources: https://en.cppreference.com/w/c/language.html and https://llvm.org/docs/.
When to use
- When the same source behaves differently across build modes or modules.
- When linking separately compiled code and symbols or layouts disagree.
- When diagnosing whether an unexpected runtime outcome traces to undefined behaviour.
- When making a shared library's surface stable across versions.
When NOT to use
- For build wiring, caching, and target graphs (use ac-monorepo-and-build-systems).
- For language concurrency and async runtimes (use ac-async-and-concurrency).
- For on-disk or on-wire byte layout (use ac-binary-formats).
Subskill Index
| Leaf | Domain segment | Scope (one line) |
|---|---|---|
subskills/compilation-phases.md |
software-engineering/compilation-phases |
From preprocessing to linking, and which phase produces which diagnostic. |
subskills/semantics-versus-target.md |
software-engineering/semantics-versus-target |
What the language guarantees versus what the target makes fast or slow. |
subskills/undefined-behaviour.md |
software-engineering/undefined-behaviour |
What UB licenses the optimizer to do, and how to detect reliance on it. |
subskills/abi-as-contract.md |
software-engineering/abi-as-contract |
Layout, calling convention, and symbol naming as a binding agreement. |
subskills/name-mangling-and-symbols.md |
software-engineering/name-mangling-and-symbols |
How overloaded names become symbols, and how resolution finds them. |
subskills/linking-models.md |
software-engineering/linking-models |
Static and dynamic linkage, visibility, and what breaks at load time. |
subskills/toolchain-record.md |
software-engineering/toolchain-record |
The written record: toolchain versions, flags, and ABI decisions. |
Status and honest limits
Compiler behaviour and optimization decisions are implementation-specific and change between versions; this skill explains the categories, not any one compiler's current behaviour. The UB space is the largest honest limit — a list of examples cannot bound what optimizers may assume, and the only sound discipline is to treat any UB diagnosis as a licence the code granted, to be removed rather than reasoned around. Nothing here recommends a toolchain, and every toolchain-sensitive claim is only meaningful with the version attached.
04 同仓库更多 Skills
troves
Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.
trade
Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".
staking
Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.
send
Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".
portfolio
View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".
multi-swap
Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.