Skip to content

Commit a651f4b

Browse files
committed
Add build-musl-toolchain.sh
1 parent 0c6e93c commit a651f4b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

build-musl-toolchain.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
# Script to build musl toolchain
4+
# Usage: ./build-musl-toolchain.sh <tuple> <pkg>
5+
# Example: ./build-musl-toolchain.sh aarch64-linux-musl aarch64-linux-musl-gcc-10.3.0
6+
7+
set -e
8+
9+
# Check if required parameters are provided
10+
if [ $# -ne 2 ]; then
11+
echo "Usage: $0 <tuple> <pkg>"
12+
echo "Example: $0 aarch64-linux-musl aarch64-linux-musl-gcc-10.3.0"
13+
exit 1
14+
fi
15+
16+
TUPLE="$1"
17+
PKG="$2"
18+
19+
echo "Building musl toolchain for $TUPLE (package: $PKG)"
20+
21+
# Prepare dependencies
22+
echo "Installing dependencies..."
23+
sudo apt-get update
24+
sudo apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \
25+
python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \
26+
patch rsync meson ninja-build git
27+
28+
# Build toolchain
29+
echo "Cloning musl-cross-make..."
30+
git clone https://github.com/richfelker/musl-cross-make/
31+
cd musl-cross-make
32+
33+
echo "Building toolchain for target: $TUPLE"
34+
make TARGET="$TUPLE" GCC_VER=10.3.0 BINUTILS_VER=2.33.1 LINUX_VER=5.8.5 install
35+
36+
# Create pipeline asset
37+
echo "Creating package archive: $PKG.tar.gz"
38+
tar -czf "../$PKG.tar.gz" output
39+
40+
echo "Toolchain build completed successfully!"
41+
echo "Archive created: $PKG.tar.gz"

0 commit comments

Comments
 (0)