fuyu12345/terminalgen-skills/cross-compile-arm-toolchain-hard
Claude Code and agent skill by fuyu12345/terminalgen-skills
- community
Checking that the SKILL.md file is still in the repository.
Build a statically linked ARM64 executable from C sources using a cross-toolchain and emit a verifier-friendly result file. Use when deploying x86-developed C tools to aarch64 targets with minimal runtime libraries.
Install
npx vskill@latest install fuyu12345/terminalgen-skills/cross-compile-arm-toolchain-hardSKILL.md
The same SKILL.md was published earlier as fuyu12345/terminalgen-skills/cross-compile-arm-toolchain-hard.
Cross-Compiling Static ARM64 C Binaries
When to Use
- Cross-compiling a C CLI tool on x86_64 for ARM64/aarch64 devices.
- Producing a fully static binary (
-static) for minimal target environments. - Completing tasks that require a
result.txtcontaining absolute binary path metadata.
Minimal Reliable Workflow
- Inspect project build inputs.
- Run:
ls -la /path/to/project && sed -n '1,200p' Makefile - Identify whether the build rule uses
$(CC) $(CFLAGS)only, or also$(LDFLAGS).
- Clean and cross-compile with explicit static flags.
- Prefer build-system override first:
make clean || truemake CC=aarch64-linux-gnu-gcc CFLAGS='-O2 -static'- If Makefile supports target override, set a distinct output name:
make CC=aarch64-linux-gnu-gcc CFLAGS='-O2 -static' TARGET=mytool-arm64- If no usable build system exists, compile directly:
aarch64-linux-gnu-gcc -O2 -static -o mytool-arm64 *.c
- Resolve absolute path and enforce execute bit.
chmod +x "$BIN"ABS_BIN="$(readlink -f "$BIN")"
- Verify architecture.
file "$ABS_BIN"must includeELF 64-bitandARM aarch64/AArch64.
- Verify static linkage with multiple checks.
file "$ABS_BIN"should includestatically linked.readelf -l "$ABS_BIN" | grep INTERPshould return nothing.ldd "$ABS_BIN" 2>&1should mentionnot a dynamic executableorstatically linked.
- Write required output file exactly.
- ```bash
printf 'binary_path=%s\nstatic_linked=yes\n' "$ABS_BIN" > /workspace/result.txt ```
- Re-open and sanity-check format.
cat /workspace/result.txt- Confirm exactly two lines, correct key names, absolute path.
Common Pitfalls
- Relying on `LDFLAGS=-static` when the Makefile never uses `$(LDFLAGS)`.
In observed runs, the Makefile link rule used $(CC) $(CFLAGS) -o ..., so static linking only applied when -static was placed in CFLAGS.
- Using only one static-link verification signal.
file may say “statically linked,” but robust validation should also confirm no INTERP segment via readelf.
- Misreading `ldd` in cross-arch contexts.
For ARM64 binaries checked on x86 hosts, ldd diagnostics can appear on stderr; some test harnesses incorrectly inspect only stdout, causing false failures even when binary is truly static.
- Formatting drift in `result.txt`.
Extra spaces, wrong key names, relative paths, or extra lines can fail strict parsers.
Verification Strategy
Run this exact sequence before finalizing:
Expected outcomes:
file: ARM64 ELF executable, statically linked.readelf -h:Machine: AArch64,Type: EXEC(or valid executable type).readelf -l: no interpreter line.ldd 2>&1: contains static/non-dynamic message.result.txt: exactly:binary_path=/absolute/path/to/binarystatic_linked=yes
If harness still fails only the static-link test while all above pass, treat it as a harness stream-capture issue (stdout vs stderr), not a build issue.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinggenerated_skills/cross_compile_arm_toolchain_hard/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/fuyu12345/terminalgen-skills/cross-compile-arm-toolchain-hard)