11#! /usr/bin/env bash
22set +e
33
4- # Specify an installation directory for musl:
5- export MUSL_HOME= $PWD /musl-toolchain
4+ # Download the `musl` toolchain that includes the `zlib` library.
5+ # Extract it, and add to the system path:
66
7- # Download musl sources:
8- curl -O https://musl.libc.org/releases/musl-1.2.5.tar.gz
9-
10- # Build musl from source
11- tar -xzvf musl-1.2.5.tar.gz
12- rm -rf musl-1.2.5.tar.gz
13- pushd musl-1.2.5
14- ./configure --prefix=$MUSL_HOME --static
15- # The next operation may require privileged access to system resources, so use sudo
16- sudo make
17- sudo make install
18- popd
19-
20- # Install a symlink for use by native-image
21- ln -s $MUSL_HOME /bin/musl-gcc $MUSL_HOME /bin/x86_64-linux-musl-gcc
22-
23- # Extend the system path and confirm that musl is available by printing its version
24- export PATH=" $MUSL_HOME /bin:$PATH "
25- x86_64-linux-musl-gcc --version
26-
27- # Download zlib sources:
28- curl -O https://zlib.net/fossils/zlib-1.2.13.tar.gz
29-
30- # Build zlib with musl from source and install into the MUSL_HOME directory
31- tar -xzvf zlib-1.2.13.tar.gz
32- rm -rf zlib-1.2.13.tar.gz
33- pushd zlib-1.2.13
34- CC=musl-gcc ./configure --prefix=$MUSL_HOME --static
35- make && make install
36- popd
7+ curl -SLO https://gds.oracle.com/download/bfs/archive/musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
8+ tar xzf musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
9+ export PATH=" $( pwd) /musl-toolchain/bin:$PATH "
10+ rm -rf musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
0 commit comments