Skip to content

aarch64-unknown-linux-gnu: glibc out of date #1237

@mcandre

Description

@mcandre

Checklist

Describe your issue

When I try to build the target aarch64-unknown-linux-gnu, then I get an error about incompatible (g)libc versions.

What target(s) are you cross-compiling for?

aarch64-unknown-linux-gnu

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5

Example

cross build --target aarch64-unknown-linux-gnu
info: downloading component 'rust-std' for 'aarch64-unknown-linux-gnu'
info: installing component 'rust-std' for 'aarch64-unknown-linux-gnu'
 37.5 MiB /  37.5 MiB (100 %)  18.7 MiB/s in  1s ETA:  0s
Unable to find image 'ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5' locally
0.2.5: Pulling from cross-rs/aarch64-unknown-linux-gnu
58690f9b18fc: Pull complete 
b51569e7c507: Pull complete 
da8ef40b9eca: Pull complete 
fb15d46c38dc: Pull complete 
9d5962c83f5f: Pull complete 
9cccf86b8f43: Pull complete 
4c6d73517e75: Pull complete 
4afe128e6862: Pull complete 
2765f54cfdee: Pull complete 
40c841a9d0e8: Pull complete 
70c492706cd4: Pull complete 
b376264cc3c9: Pull complete 
f94a42110e99: Pull complete 
29835156cc05: Pull complete 
d48b139772fe: Pull complete 
55ba4d0a0c25: Pull complete 
5f4fa2c62d4d: Pull complete 
6bc43a1e4611: Pull complete 
Digest: sha256:7f8308a8734d9fcd2ebbe9a3e4bdea74af293f0799d80c3cc341e340cda49a4c
Status: Downloaded newer image for ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
   Compiling static_assertions v1.1.0
   Compiling bitflags v1.3.2
   Compiling cfg-if v1.0.0
   Compiling regex-syntax v0.6.29
   Compiling unicode-width v0.1.10
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
   Compiling lazy_static v1.4.0
   Compiling libc v0.2.140
   Compiling memchr v2.5.0
error: failed to run custom build command for `memchr v2.5.0`

Caused by:
  process didn't exit successfully: `/target/debug/build/memchr-0c2d17e75a62c41d/build-script-build` (exit status: 1)
  --- stderr
  /target/debug/build/memchr-0c2d17e75a62c41d/build-script-build: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /target/debug/build/memchr-0c2d17e75a62c41d/build-script-build)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `libc v0.2.140`

Caused by:
  process didn't exit successfully: `/target/debug/build/libc-0ed06e28ed6f4dff/build-script-build` (exit status: 1)
  --- stderr
  /target/debug/build/libc-0ed06e28ed6f4dff/build-script-build: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.29' not found (required by /target/debug/build/libc-0ed06e28ed6f4dff/build-script-build)
  /target/debug/build/libc-0ed06e28ed6f4dff/build-script-build: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /target/debug/build/libc-0ed06e28ed6f4dff/build-script-build)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
thread 'main' panicked at 'assertion failed: process::Command::new(\"cross\").args(&[\"build\", \"--target\",\n                                target]).args(rest.clone()).status().unwrap().success()', src/rocky.rs:127:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I don't know why glibc 2.28 is needed. But for what it's worth, the image base layer is a really old version of Ubuntu, 16.04 Xenial Xerus.

Ubuntu never got glibc 2.28 exactly. It has glibc 2.27 in 18.04 Bionic Beaver, it has glibc 2.31 in 20.04 Focal Fossa.

The current Ubuntu LTS release is Ubuntu 22.04 Jammy Jellyfish, which has glibc 2.35.

Worth rechecking this image, and the others, for similar issues.

Notably, the cross-toolchains images say that they default to glibc 2.17.

Additional information / notes

The cross-rs source tree appears to show Ubuntu 20.04 in cross git HEAD:

https://github.com/cross-rs/cross/blob/main/docker/Dockerfile.aarch64-unknown-linux-gnu

Though the toolkit installed references libc6 (?)

Maybe it's time to cut a fresh release of cross, now that many improvements have been added since cross 0.2.5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions