Skip to content

Commit 203842a

Browse files
authored
Merge pull request #43 from graalvm/og/update-musl-libc-installation
Update musl libc installation
2 parents 825eb28 + b3c453f commit 203842a

File tree

4 files changed

+17
-66
lines changed

4 files changed

+17
-66
lines changed

native-image/micronaut-webserver/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In this workshop you will:
5353
./build-jar-eclipse-temurin.sh
5454
```
5555
Once the script finishes, a container image _eclipse-temurin-jar_ should be available.
56-
Check its size. It should be **472MB**.
56+
Check its size. It should be **472MB**.
5757
```bash
5858
docker images
5959
```
@@ -549,7 +549,7 @@ A separate Maven profile exists for this step:
549549
#### For Local Building
550550
551551
If you build a native image locally, it requires the `musl` toolchain with `zlib` installed on your machine.
552-
We provide a script to download and configure the `musl` toolchain, and install `zlib` into the toolchain:
552+
We provide a script to download and configure the `musl` toolchain:
553553
```bash
554554
./setup-musl.sh
555555
```
Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,10 @@
11
#!/usr/bin/env bash
22
set +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

native-image/spring-boot-webserver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ A separate Maven profile exists for this step:
566566
#### For Local Building
567567

568568
If you build a native image locally, it requires the `musl` toolchain with `zlib` installed on your machine.
569-
We provide a script to download and configure the `musl` toolchain, and install `zlib` into the toolchain:
569+
We provide a script to download and configure the `musl` toolchain:
570570
```bash
571571
./setup-musl.sh
572572
```
Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,13 @@
11
#!/usr/bin/env bash
22
set +e
33

4-
# Specify an installation directory for musl:
5-
export MUSL_HOME=$PWD/musl-toolchain
6-
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
4+
#!/usr/bin/env bash
5+
set +e
266

27-
# Download zlib sources:
28-
curl -O https://zlib.net/fossils/zlib-1.2.13.tar.gz
7+
# Download the `musl` toolchain that includes the `zlib` library.
8+
# Extract it, and add to the system path:
299

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
10+
curl -SLO https://gds.oracle.com/download/bfs/archive/musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
11+
tar xzf musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
12+
export PATH="$(pwd)/musl-toolchain/bin:$PATH"
13+
rm -rf musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz

0 commit comments

Comments
 (0)