3 ms·
Tangent: Is there a reason why C and C++ compilers are dev-PC-OS dependent for ARM targets? For example, if using Rust to compile for a Cortex-M etc, the workfl
by the__alchemist 5y ago
Tangent: Is there a reason why C and C++ compilers are dev-PC-OS dependent for ARM targets? For example, if using Rust to compile for a Cortex-M etc, the workflow is the same for Windows and linux: Install the `thumbv7` target using a CLI command, then `cargo build`. I'm trying to build an OSS C lib now for the same platform, and the Windows instructions involve WSL or Cgywin.
- rfoo 5y agoNo. The most likely reason in your case is the build system of the library you want to build uses some mix of POSIX shell script and GNU Make, which is ... hard to get right on Windows. It's not C/C++ specific, through installing a cross C compiler on Windows might involve more work than rustup add target (or not, if someone did the work and packaged the toolchain as .exe installer).
- melissalobos 5y agoRust only uses LLVM currently. WSL or Cygwin is because the compiler situation on Windows is a bit rough(VS doesn't support C fully), so most people use GCC there.
- xvilka 5y ago> compiler situation on Windows is a bit rough(VS doesn't support C fully) clang-cl[1] does. [1] https://clang.llvm.org/docs/MSVCCompatibility.html https://clang.llvm.org/docs/MSVCCompatibility.html
- pjmlp 5y agoVS supports C11 and C17, to the extent required by the standard, minus optional annexes. The only thing missing are some atomic library calls.
- mhh__ 5y agoIt's basically an artifact of how GCC works. LLVM is a library that happens to have Clang in front of it, whereas GCC still isn't really able to have multiple targets in the same binary. Could probably be done but for actually assembling toolchains you generally only need one anyway so it's not that annoying most of the time.
- nicoburns 5y ago> but for actually assembling toolchains you generally only need one Not if you intend to ship on multiple platforms. Having to run builds on the native platform or install a separate cross-compilation toolchain is incredibly annoying (and difficult to get right to the point that it's common to not even try). It would be a big usability win if C toolchains could get cross-compilation to Go or Zig levels of "just works".
- mhh__ 5y agoSure but sometimes you need to get your hands on system libraries, C headers, linkers etc.