I concur with your hypothesis. After battling similar symptoms for 40 hours straight, I've discovered this confirmation:

  • https://packages.ubuntu.com/impish/gcc-10-aarch64-linux-gnu
  • https://packages.debian.org/bullseye/gcc-aarch64-linux-gnu

Note that Ubuntu 21.10 (Impish) and Debian 11 (Bullseye) have packages for a gcc 10 cross compiler. Be wary of the very confusing fact the Ubuntu's default package is actually gcc 11, but Debian 11's default is gcc 10. The similar version numbers of Debian and gcc are a coincidence. Also ignore for now the fact that Ubuntu's package is gcc 10.3.0 and Debian's is gcc 10.2.1.

Focus instead on the recommendations and dependencies of each package. Ultimately the Ubuntu package calls up libc >= 2.34, while the Debian package calls up libc >= 2.28.

Sure enough, when I cross-compile from Impish on x86 for Bullseye on aarch64 (despite having a complete SYSROOT for the target), I get this at runtime:

/lib/aarch64-linux-gnu/libc.so.6: version 'GLIBC_2.34' not found

But your question remains, is there any tie between the host libc and that used by the cross-compiler? The answer is a definite maybe.

See this excellent answer and links for an overview of a cross-compiler. The take-away:

You don't just cross-compile glibc, you need to cross-compile an entire toolchain. Toolchain components are ALWAYS: ld + gcc + libc + gdb.

So the C library is an integral part of the cross-compiler.

What shenanigans then, are going on when you install gcc-aarch64-linux-gnu? It's just a compiler - only one of the four parts of a toolchain.

Well apparently there's some flexibility. Technically, a cross-compiler can be naked. That's typically only useful when you're compiling an operating system, rather than an executable that runs on an operating system. So you can construct special toolchains for special purposes.

But for the standard purpose (cross compiling for Linux on another architecture) you want a typical toolchain. Which is where the package's dependencies and recommendations come in. A gcc is always in want of an ld which is always in want of a libc, and the ménage à trois is intimate. In fact, gcc is built with libc using ld in a complex do-si-do. See this example from a great guide by Preshing on Programming:

It's possible to force separation and link to other libraries, but it's not easy.

For example, the linker you use has a set of default search directories that are baked in. From the fine manual:

The default set of paths searched (without being specified with -L) depends on which emulation mode ld is using, and in some cases also on how it was configured.

And it gets more intwined. By default, gcc will call on a dynamic linker whose location is hard-coded. For a cross-compiler, it might be something like /lib/ld-linux-aarch64.so.1. Not only that, the executable may also end up with the hardcoded path, as its program interpreter.

Again, if you're careful you can tear apart the toolchain and override things. But not only is it tricky to enforce, particularly if you have a complex build, the multitude of combinations of options and paths means there are also often bugs. So your host environment can easily leak into your cross-compiling toolchain.

So in summary, cross-compiling requires a toolchain. While pulling a cross-compiler from a package manager seems like an easy and legitimate thing to do, it comes with a lot of implicit baggage. You can either carefully follow the package dependencies to check what version you're getting, or use one of the many dedicated toolchain environments, such as crosstool-NG.

Answer from Heath Raftery on Stack Overflow
🌐
Pkgs.org
pkgs.org › download › ld-linux-aarch64.so.1(GLIBC_2.17)(64bit)
Ld-linux-aarch64.so.1(glibc_2.17)(64bit) Download (RPM)
Download ld-linux-aarch64.so.1(GLIBC_2.17)(64bit) linux packages for AlmaLinux, ALT Linux, CentOS, Fedora, Mageia, OpenMandriva, openSUSE, Rocky Linux
🌐
RPMfind
rpmfind.net › linux › rpm2html › search.php
RPM resource ld-linux-aarch64.so.1(GLIBC_2.17)(64bit)
The search service can find package by either name (apache), provides(webserver), absolute file names (/usr/bin/apache), binaries (gprof) or shared libraries (libXm.so.2) in standard path. It does not support multiple arguments yet · The System and Arch are optional added filters, for example ...
🌐
GitHub
github.com › cross-rs › cross › issues › 528
aarch64-linux: lower glibc version requirement to 2.17 (compatible with centos 7) · Issue #528 · cross-rs/cross
March 9, 2021 - linux-vdso.so.1 (0x0000ffffb1de6000) libdl.so.2 => /lib64/libdl.so.2 (0x0000ffffb1d46000) libpthread.so.0 => /lib64/libpthread.so.0 (0x0000ffffb1d11000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000ffffb1ce0000) libc.so.6 => /lib64/libc.so.6 (0x0000ffffb1b5a000) /lib/ld-linux-aarch64.so.1 (0x0000ffffb1da8000) Version information: ./tmp: libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.18) => /lib64/libc.so.6 libgcc_s.so.1 (GCC_3.3) => /lib64/libgcc_s.so.1 libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1 libgcc_s.so.1 (GCC_4.2.0) => /lib64/libgcc_s.so.1 libpthread.so.0 (GLIBC_2.17)
Author   cross-rs
Top answer
1 of 1
9

I concur with your hypothesis. After battling similar symptoms for 40 hours straight, I've discovered this confirmation:

  • https://packages.ubuntu.com/impish/gcc-10-aarch64-linux-gnu
  • https://packages.debian.org/bullseye/gcc-aarch64-linux-gnu

Note that Ubuntu 21.10 (Impish) and Debian 11 (Bullseye) have packages for a gcc 10 cross compiler. Be wary of the very confusing fact the Ubuntu's default package is actually gcc 11, but Debian 11's default is gcc 10. The similar version numbers of Debian and gcc are a coincidence. Also ignore for now the fact that Ubuntu's package is gcc 10.3.0 and Debian's is gcc 10.2.1.

Focus instead on the recommendations and dependencies of each package. Ultimately the Ubuntu package calls up libc >= 2.34, while the Debian package calls up libc >= 2.28.

Sure enough, when I cross-compile from Impish on x86 for Bullseye on aarch64 (despite having a complete SYSROOT for the target), I get this at runtime:

/lib/aarch64-linux-gnu/libc.so.6: version 'GLIBC_2.34' not found

But your question remains, is there any tie between the host libc and that used by the cross-compiler? The answer is a definite maybe.

See this excellent answer and links for an overview of a cross-compiler. The take-away:

You don't just cross-compile glibc, you need to cross-compile an entire toolchain. Toolchain components are ALWAYS: ld + gcc + libc + gdb.

So the C library is an integral part of the cross-compiler.

What shenanigans then, are going on when you install gcc-aarch64-linux-gnu? It's just a compiler - only one of the four parts of a toolchain.

Well apparently there's some flexibility. Technically, a cross-compiler can be naked. That's typically only useful when you're compiling an operating system, rather than an executable that runs on an operating system. So you can construct special toolchains for special purposes.

But for the standard purpose (cross compiling for Linux on another architecture) you want a typical toolchain. Which is where the package's dependencies and recommendations come in. A gcc is always in want of an ld which is always in want of a libc, and the ménage à trois is intimate. In fact, gcc is built with libc using ld in a complex do-si-do. See this example from a great guide by Preshing on Programming:

It's possible to force separation and link to other libraries, but it's not easy.

For example, the linker you use has a set of default search directories that are baked in. From the fine manual:

The default set of paths searched (without being specified with -L) depends on which emulation mode ld is using, and in some cases also on how it was configured.

And it gets more intwined. By default, gcc will call on a dynamic linker whose location is hard-coded. For a cross-compiler, it might be something like /lib/ld-linux-aarch64.so.1. Not only that, the executable may also end up with the hardcoded path, as its program interpreter.

Again, if you're careful you can tear apart the toolchain and override things. But not only is it tricky to enforce, particularly if you have a complex build, the multitude of combinations of options and paths means there are also often bugs. So your host environment can easily leak into your cross-compiling toolchain.

So in summary, cross-compiling requires a toolchain. While pulling a cross-compiler from a package manager seems like an easy and legitimate thing to do, it comes with a lot of implicit baggage. You can either carefully follow the package dependencies to check what version you're getting, or use one of the many dedicated toolchain environments, such as crosstool-NG.

🌐
Debian
lists.debian.org › debian-devel-changes › 2013 › 01 › msg01442.html
Accepted eglibc 2.17-0experimental0 (all amd64 source)
- patches/amd64/local-pthread_cond_wait.diff: Dropped, fixed upstream. - patches/i386/local-pthread_cond_wait.diff: Dropped (closes: #694962) - patches/arm64/cvs-ldconfig-cache-abi.diff: Dropped, merged upstream. - patches/arm64/submitted-aarch64-support.diff: Merged upstream.
🌐
Stack Overflow
stackoverflow.com › questions › 57960213 › why-an-installed-centos-system-uses-ld-2-17-yet-compiling-the-same-version-of-g
linux - Why an installed Centos system uses ld.2.17, yet compiling the same version of glibc-2.17 produces ld.so - Stack Overflow
I've learned that ld.so is the result of "make", and ld-2.17.so is the result of "make install". This seems to have been proven by setting a test directory before configuring and making the new glibc-2.17.
🌐
RPMfind
rpmfind.net › linux › rpm2html › search.php
RPM resource ld-linux-aarch64.so.1(GLIBC_PRIVATE)(64bit)
The search service can find package by either name (apache), provides(webserver), absolute file names (/usr/bin/apache), binaries (gprof) or shared libraries (libXm.so.2) in standard path. It does not support multiple arguments yet · The System and Arch are optional added filters, for example ...
🌐
GitHub
github.com › bioconda › bioconda-recipes › issues › 46186
Different glibc version between aarch64 and x86 builders? · Issue #46186 · bioconda/bioconda-recipes
March 5, 2024 - I've tried to add aarch64 support to the nextclade recipe here #46185 which does binary repackaging. ... 15:17:28 BIOCONDA INFO (OUT) + nextclade --version 15:17:28 BIOCONDA INFO (OUT) nextclade: relocation error: nextclade: symbol __cxa_thread_atexit_impl, version GLIBC_2.18 not defined in file libc.so.6 with link time reference
Author   bioconda
🌐
GitHub
github.com › radcolor › aarch64-linux-gnu › blob › master › aarch64-linux-gnu › bin › ldd
aarch64-linux-gnu/aarch64-linux-gnu/bin/ldd at master · radcolor/aarch64-linux-gnu
Bleeding edge GNU GCC toolchain (CC only) built from sources using latest binutils and glibc - aarch64-linux-gnu/aarch64-linux-gnu/bin/ldd at master · radcolor/aarch64-linux-gnu
Author   radcolor
Find elsewhere
🌐
Arch Linux ARM
archlinuxarm.org › forum › viewtopic.php
Arch Linux ARM • View topic - [SOLVED] AArch64 running x86-64 binaries using qemu-system
April 17, 2023 - 1) Install those two packages using pacman: $this->bbcode_second_pass_code('', 'sudo pacman -S qemu-user qemu-user-binfmt') 2) Download and unzip the x86-64 app that I need to run 3) Launch this app using: ./appname Nothing special, really. I think that I have to install the corresponding x86-64 libs, so qemu can use them, but I can't find the right package tho. ... SOLVED! What I did was manually download glibc-2.37 package from official ArchLinux repo and extract that .so library in /lib64.
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
Could not open '/lib/ld-linux-aarch64.so.1' / Programming & Scripting / Arch Linux Forums
September 29, 2024 - local/qemu-audio-alsa 9.1.0-2 QEMU ... 2.3.3-5 Virtual Distributed Ethernet for emulators like qemu · Also, the dependency list of aarch64-linux-gnu-gcc doesn't include ld-linux-aarch64.so.1 as a dependency: https://archlinux.org/packages/extra/x8 … x-gnu-gcc/ No wonder it's not in my system unless qemu provides this SO. Last edited by MetalInMyVeins (2024-09-30 05:55:32) ... $ pacman -F ld-linux-aarch64.so.1 extra/aarch64-linux-gnu-glibc 2.39-1 ...
🌐
Google Groups
groups.google.com › g › linux.debian.ports.arm › c › G1irkU-_ke0
Issues installing libc6:arm64 on amd64
It was a repository having incompatible versions of packages for a moment due to gcc-10-base rebuild. arm64 had version 10.2.0-18 but amd64 and i386 had version 10.2.0-17. So it was not possible to install them at the same time. They are now in sync, and installing libraries and binaries from ...
🌐
GitHub
github.com › WhitewaterFoundry › Fedora-Remix-for-WSL › issues › 15
arm64 build currently fails · Issue #15 · WhitewaterFoundry/Fedora-Remix-for-WSL
January 18, 2019 - so.6(GLIBC_2.2.5)(64bit), but none of the providers can be installed - conflicting requests - problem with installed package brotli-1.0.5-1.fc29.x86_64 Problem 14: package libmnl-1.0.4-8.fc29.aarch64 requires ld-linux-aarch64.so.1()(64bit), but none of the providers can be installed - package libmnl-1.0.4-8.fc29.aarch64 requires ld-linux-aarch64.so.1(GLIBC_2.17)(64bit), but none of the providers can be installed - cannot install both glibc-2.28-9.fc29.aarch64 and glibc-2.28-26.fc29.x86_64 - cannot install both glibc-2.28-26.fc29.aarch64 and glibc-2.28-26.fc29.x86_64 - package iproute-4.18.0-3.
Author   WhitewaterFoundry
🌐
GitHub
github.com › angr › binaries › blob › master › tests › aarch64 › ld-linux-aarch64.so.1
binaries/tests/aarch64/ld-linux-aarch64.so.1 at master · angr/binaries
A repository with binaries for angr tests and examples. - binaries/tests/aarch64/ld-linux-aarch64.so.1 at master · angr/binaries
Author   angr
🌐
Pkgs.org
pkgs.org › download › ld-linux-aarch64.so.1()(64bit)
Ld-linux-aarch64.so.1()(64bit) Download for Linux (rpm)
Download ld-linux-aarch64.so.1()(64bit) linux packages for AlmaLinux, ALT Linux, CentOS, Fedora, Mageia, OpenMandriva, openSUSE, Rocky Linux
🌐
Arch Linux ARM
archlinuxarm.org › packages › aarch64 › glibc
glibc (aarch64) | Packages | Arch Linux ARM
Copyright ©2009-2026 Arch Linux ARM The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide basis. The Arch Linux™ name and logo are used under permission of the Arch Linux Project Lead