Building libc6 compat - linux-on-ibm-z/docs GitHub Wiki

Building libc6-compat

Below version of libc6-compat (musl-libc) is available in respective distributions at the time of creation of these build instructions:

  • Ubuntu 22.04 has 1.2.2
  • Ubuntu 24.04 has 1.2.4

The instructions provided below specify the steps to build libc6-compat version 1.2.6 on Linux on IBM Z for the following distributions:

  • RHEL (8.10, 9.6, 9.7, 9.8, 10.0, 10.1, 10.2)
  • SLES (15 SP7, 16)
  • Ubuntu (22.04, 24.04)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it

1. Build using script

If you want to build libc6-compat using manual steps, go to Step 2.

Use the following commands to build libc6-compat using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/libc6-compat/1.2.6/build_libc6compat.sh
# Build libc6-compat
bash build_libc6compat.sh

In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

2. Install the Dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (8.10, 9.6, 9.7, 9.8, 10.0, 10.1, 10.2)
sudo yum install -y gcc gcc-c++ make wget tar
  • SLES (15 SP7, 16)
sudo zypper install -y gcc gcc-c++ make wget tar bzip2 zlib-devel gzip
  • Ubuntu (22.04, 24.04)
sudo apt-get update
sudo apt-get install -y gcc g++ tar wget make cmake bzip2 zlib1g-dev g++-multilib

3. Build and Install libc6-compat

  • Download source code

    cd $SOURCE_ROOT
    wget http://git.musl-libc.org/cgit/musl/snapshot/musl-1.2.6.tar.gz
    tar -xzf musl-1.2.6.tar.gz
    
  • Build and Install libc6-compat

    cd $SOURCE_ROOT/musl-1.2.6
    ./configure
    make
    sudo make install
    

References: