Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

cxvm: per-project GCC and Clang versions on Linux

Описание и применение

cxvm позволяет проектам на Linux использовать конкретные версии GCC и Clang, не затрагивая системный PATH и без прав суперпользователя.

Задача

Embedded Linux developers need per-project GCC/Clang versions that differ from the system compiler, but existing solutions require root or affect all projects.

Результат

cxvm allows developers to pin exact GCC/Clang versions per project, avoiding global changes, root access, and ensuring correct libstdc++ linkage via rpath.

Рабочий процесс

  • Install cxvm via curl or cargo
  • Use cxvm install gcc@13 to download GCC 13.4.0
  • Navigate to project directory and run cxvm use gcc@13 to pin the compiler and generate .cxvm/ and .cxvmrc
  • Run CMake with the generated toolchain file or use cxvm exec -- make for non-CMake projects
  • Use cxvm current to verify active compiler

Доказательства

cxvm keeps any number of GCC and Clang versions side by side under ~/.local/share/cxvm, and each project says which one it uses in a small file you commit

Источник

The CMake toolchain file adds an rpath to the pinned GCC's lib64, so the program finds the right libstdc++.so.6 on its own

Источник

cxvm is written in Rust and ships as one static musl binary

Источник

  • Дата записи: 2026-10-12T14:55:55.558Z