|
| 1 | +# Cross-Compiler Toolchains |
| 2 | + |
| 3 | +This directory contains pre-built cross-compiler toolchains from [musl.cc](https://musl.cc/). |
| 4 | + |
| 5 | +## Files |
| 6 | + |
| 7 | +These files are stored with Git LFS (Large File Storage) and are downloaded via GitHub Actions CI/CD: |
| 8 | + |
| 9 | +- `arm-linux-musleabihf-cross.tgz` - ARM 32-bit (ARMv7) EABI Hard Float |
| 10 | +- `riscv64-linux-musl-cross.tgz` - RISC-V 64-bit |
| 11 | +- `s390x-linux-musl-cross.tgz` - IBM System z (s390x) |
| 12 | +- `powerpc64le-linux-musl-cross.tgz` - PowerPC 64-bit Little Endian |
| 13 | + |
| 14 | +## Downloading Toolchains Locally |
| 15 | + |
| 16 | +To download these toolchains to your local machine: |
| 17 | + |
| 18 | +1. **Install Git LFS** (if not already installed): |
| 19 | + ```bash |
| 20 | + # macOS |
| 21 | + brew install git-lfs |
| 22 | + |
| 23 | + # Ubuntu/Debian |
| 24 | + sudo apt-get install git-lfs |
| 25 | + |
| 26 | + # Other systems: https://git-lfs.com/ |
| 27 | + ``` |
| 28 | + |
| 29 | +2. **Initialize Git LFS in this repository** (one-time setup): |
| 30 | + ```bash |
| 31 | + git lfs install |
| 32 | + ``` |
| 33 | + |
| 34 | +3. **Run the download script**: |
| 35 | + ```bash |
| 36 | + ./scripts/download-musl-cc.sh |
| 37 | + ``` |
| 38 | + |
| 39 | + This script will: |
| 40 | + - Create this directory if it doesn't exist |
| 41 | + - Download all four cross-compiler toolchains |
| 42 | + - Retry up to 3 times if downloads fail |
| 43 | + - Store them for Git LFS tracking |
| 44 | + |
| 45 | +4. **Commit and push to GitHub**: |
| 46 | + ```bash |
| 47 | + git add cross-compilers/ .gitattributes |
| 48 | + git commit -m "Add musl.cc cross-compiler toolchains" |
| 49 | + git push |
| 50 | + ``` |
| 51 | + |
| 52 | +## Git LFS Tracking |
| 53 | + |
| 54 | +These files are tracked with Git LFS, which means: |
| 55 | + |
| 56 | +- Git stores pointers to the actual files instead of the full archives |
| 57 | +- The repository size remains small |
| 58 | +- When you clone or pull, Git LFS downloads only the files you need |
| 59 | +- Bandwidth usage is optimized for large binary files |
| 60 | + |
| 61 | +To verify Git LFS is working correctly, check the `.gitattributes` file to see which patterns are tracked. |
| 62 | + |
| 63 | +## Why These Toolchains? |
| 64 | + |
| 65 | +The musl.cc project provides pre-built, statically-linked cross-compiler toolchains. They're: |
| 66 | +- Ready to use without system dependencies |
| 67 | +- Statically compiled (portable across Linux distributions) |
| 68 | +- Designed for cross-compilation to various architectures |
| 69 | +- Updated regularly with latest compiler versions |
| 70 | + |
| 71 | +## Updates |
| 72 | + |
| 73 | +To update these toolchains to newer versions in the future: |
| 74 | + |
| 75 | +1. Run the download script again: `./scripts/download-musl-cc.sh` |
| 76 | +2. Git will detect changes if new versions are available |
| 77 | +3. Commit and push the updated files |
| 78 | + |
| 79 | +## References |
| 80 | + |
| 81 | +- [musl.cc](https://musl.cc/) - Pre-built musl libc cross-compiler toolchains |
| 82 | +- [Git LFS Documentation](https://git-lfs.com/) |
0 commit comments