This walks you through cross-compiling with GCC for embedded and multi-architecture targets. You get practical guidance on toolchain setup, triplets (aarch64-linux-gnu, arm-none-eabi, etc.), configuring sysroots, and fixing pkg-config so it stops returning host libraries during cross builds. It covers CMake toolchain files, QEMU-based testing with GDB remote debugging, and common failure modes like wrong ELF class errors. The reference tables for triplets and error messages are genuinely helpful when you're staring at a linker error at 2am. If you're building for ARM, RISC-V, or MIPS from an x86 host, or integrating with Yocto and Buildroot, this gives you the essentials without the usual cross-compilation folklore.

skills.sh installs
742
GitHub stars
279
last updated
Aug 21, 2026

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill cross-gcc --agent claude-code

Installs into .claude/skills of the current project.

Files

Cross-GCC

Purpose

Guide agents through setting up and using cross-compilation GCC toolchains: triplets, sysroots, pkg-config, QEMU-based testing, and common failure modes.

Triggers

  • "How do I compile for ARM on my x86 machine?"
  • "I'm getting 'wrong ELF class' or 'cannot execute binary file'"
  • "How do I set up a sysroot for cross-compilation?"
  • "pkg-config returns host libraries in my cross build"
  • "How do I debug a cross-compiled binary with QEMU + GDB?"

Workflow

1. Understand the triplet

A GNU triplet has the form <arch>-<vendor>-<os>-<abi> (often 3 or 4 parts):

TripletTarget
aarch64-linux-gnu64-bit ARM Linux (glibc)
arm-linux-gnueabihf32-bit ARM Linux hard-float
arm-none-eabiBare-metal ARM (no OS)
riscv64-linux-gnu64-bit RISC-V Linux
x86_64-w64-mingw32Windows (MinGW) from Linux
mipsel-linux-gnuLittle-endian MIPS Linux

2. Install the toolchain

# Debian/Ubuntu
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu

# For bare-metal ARM (Cortex-M)
sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi

Sponsors

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
Categories
Code Review & Quality, Debugging
First seen
Jun 3, 2026

More from mohitmishra786/low-level-dev-skills

All 54
1openclaudia avatarvideo-ad-analysisopenclaudia/openclaudia-skillsDeconstruct and analyze video ad creatives for marketing insights. Use when the user says "analyze this ad", "ad creative analysis", "deconstruct this video ad"742skills.sh installs
2ruvnet avatarrvf-manageruvnet/rufloManage RVF (Ruflo Vector Format) files for portable agent memory and cross-platform transfer741skills.sh installs
3joellewis avatartrade-executionjoellewis/finance_skillsGuide the design, evaluation, and monitoring of trade execution quality and best execution practices. Use when assessing best execution obligations under FINRA 739skills.sh installs
4jezweb avatarreact-native-expojezweb/claude-skillsBuild React Native 0.76+ apps with Expo SDK 52-54. Covers mandatory New Architecture (0.82+/SDK 55+), React 19 changes, SDK 54 breaking changes (expo-av, expo-f738skills.sh installs
5new-silvermoon avatarandroid-gradle-logicnew-silvermoon/awesome-android-agent-skillsExpert guidance on setting up scalable Gradle build logic using Convention Plugins and Version Catalogs.738skills.sh installs
6openai avatargpt-5-4-promptingopenai/codex-plugin-ccInternal guidance for composing Codex and GPT-5.4 prompts for coding, review, diagnosis, and research tasks inside the Codex Claude Code plugin738skills.sh installs