This article uses 64-bit Ubuntu 16.04.
Download the source code
Download the glibc source code from the official GNU C Library (glibc) website. This example uses glibc 2.23.
Download and extract glibc 2.23:
| |
Configure and build
Enter the glibc 2.23 directory and create a separate build directory:
| |
Enter the build directory and configure the build options:
- CFLAGS
- Enable full debugging information and minimize optimization.
- See the example below.
- prefix
- The destination for the compiled files.
- This example installs them in a
glibcdirectory under the current user’s home directory.
| |
Build and install:
| |
Notes
To build a 32-bit version of glibc:
- CC
- gcc -m32
- CFLAGS
- host=i686-linux-gnu
- build=i686-linux-gnu
| |