1

My linux machine is x86_64-redhat-linux.

However I am using another arm tool chain aarch64-linux-gnu-gcc on this machine to build(I don't need to run what I build on this machine, just build, so it should be good to use arm toolchain to build)

I receive the following error:

aarch64-linux-gnu-gcc: /lib64/libc.so.6: 
version `GLIBC_2.14' not found (required by aarch64-linux-gnu-gcc)

So the current default shared library path points to /lib64/libc.so.6, I don't want to update it since I am not the only user of this machine, how can I use my own libc.so.6, can I redirect the search path to another directory?

  • What is the version of GLIBC that is on the host machine(Redhat)? – eyoung100 Nov 6 '15 at 20:07
  • it is The C stubs add-on version 2.1.2. crypt add-on version 2.1 by Michael Glad and others – hellocoding Nov 7 '15 at 0:56
  • Wrong item... what is the output of ldd --version on the redhat machine?? – eyoung100 Nov 7 '15 at 2:12
  • ldd (GNU libc) 2.12 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper – hellocoding Nov 9 '15 at 18:59
  • There is your issue 2.12 < 2.14, therefore you have 2 options: 1. Upgrade your version of Redhat to GLIBC 2.14, or 2. Build a chroot that will include GLIBC 2.14. Since you do not want to update the host system, I'll show you how to install a changeroot in your home directory. – eyoung100 Nov 9 '15 at 19:29
1

Problem

GLIBC 2.12 is installed and as the OP's title states, the cross compile toolchain he is trying to use requires GLIBC >2.14. The OP states that he is also constrained because he cannot update the system.

Caveats

The list below in step 3 is used to build the changeroot. When possible use the packages included from your distributions repositories. If the most recent version in your repository is equal to the version installed outside the changeroot, stop Step 3, and use an online package search, like RPMFind to find a newer version, and continue. Do not install the newer or online version outside of the changroot. This will cause system breakage, which I am NOT responsible for!

Solution

The OP must now build a changeroot jail to install the ARM cross compiler in as versions of GLIBC cannot be installed Side By Side. See also Wikipedia - Chroot. To do so, please follow these steps:

  1. Create the directory for the changeroot: mkdir -pv $HOME/newroot
  2. Create an override to redirect the RPM packages to install into the chroot: export ROOT=$HOME/newroot && echo $ROOT. See Step 4 if you're curious.
    • Please echo the new variable as this will become very important shortly.
  3. Download the recommended rpm packages for the changeroot(These are the package names): cd $ROOT && mkdir -v download && cd download
    • setup
    • filesystem
    • basesystem
    • ldconfig
    • glibc <-- Take note of the caveat above here, or you will have done this work for nothing.
    • mktemp
    • termcap
    • ncurses
    • info
    • fileutils
    • bash && libtermcap
    • gdbm
    • tcsh
    • perl
    • chkconfig
    • textutils
    • cracklib
    • cracklib-dicts
    • pwdb
    • glib
    • gawk
    • pam --nodeps
    • shadow-utils
    • slang
    • util-linux --nodeps
    • sh-utils
    • zsh
    • sed
    • bzip2
    • popt
    • zlib
    • rpm
    • Your crosscompile toolchain and it's dependencies
  4. Use the following command to install the above list rpm -i --root=$ROOT packagename Notice the --root argument. This overrides the RPM's default install behavior. Note those packages in the list with extras, for example bash && libtermcap. Please run the rpm -i command as written on the list, including the --root argument. In the example above libtermcap installs in the same directory as bash.
  5. Lastly, one may chroot $ROOT && export PS1="(chroot) $PS1".

Reference

Steps above adapted from How to set up a chroot environment with RedHat Linux 6.2 - For FTP and Web Service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.