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

cxvm: per-project GCC and Clang versions on Linux

说明与用途

cxvm 允许在 Linux 上为每个项目固定 GCC/Clang 版本,避免全局更改和需要 root 权限。

问题

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