This means that the binaries will only run on a musl-based system, like Alpine. Maybe most importantly, it's based on the musl C standard library. Also, it can target Linux running on a number of different architectures. Musl-cross-make builds beautifully self-contained cross-compilers, so you don't have to worry about pointing to the right libraries path or about where you keep the toolchain. It took a few patches, but it runs well on macOS. Thankfully, Rich Felker built a Makefile set to build musl-based cross-compilers, musl-cross-make. While in Go you just need to set an environment variable, for C you need a whole separate toolchain, that might require an intermediate toolchain to build, and you need to know what you are targeting very well. brew install FiloSottile/musl-cross/musl-cross Tl dr: you can install cross-compiler toolchains to compile C/C++ for Windows or Linux from macOS with these two Homebrew Formulas. Easy Windows and Linux cross-compilers for macOS
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |