Skip to content

Instantly share code, notes, and snippets.

@cheuerde
Last active April 24, 2024 08:06
Show Gist options
  • Star 23 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save cheuerde/7229f304856e59ce183a to your computer and use it in GitHub Desktop.
Save cheuerde/7229f304856e59ce183a to your computer and use it in GitHub Desktop.
Install GNU libc version parallel to existing system
# Claas Heuer, August 2015
#
# urls:
# http://stackoverflow.com/questions/847179/multiple-glibc-libraries-on-a-single-host
# http://www.gnu.org/software/libc/download.html
cd $HOME
mkdir glibc_update
cd glibc_update
libc_version=2.19
# get the version you want:
wget http://ftp.gnu.org/gnu/glibc/glibc-${libc_version}.tar.gz
tar -xf glibc-${libc_version}.tar.gz
# configure and set the installation path
cd glibc-${libc_version}
mkdir build
cd build
../configure --prefix=/opt/glibc${libc_version}
# compile
make -j6
sudo make install
##############################################
### Run some software that need that glibc ###
##############################################
LD_PRELOAD="/opt/glibc${libc_version}/lib/libc.so.6 /opt/glibc${libc_version}/lib/libpthread.so.0 /opt/glibc${libc_version}/lib/ld-linux-x86-64.so.2" ./my_prog
@nabaco
Copy link

nabaco commented Apr 5, 2021

When building with newer gcc versions (e.g. on Ubuntu 20.04) the build might fail. Should add --disable-werror to the configure stage. cirosantilli/linux-kernel-module-cheat#97

@anitaemulator
Copy link

I want you build it in Debian 11 but I can't even if I use --disable-werror. Is there any other way to build glibc-2.26?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment