Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 of 11 tasks
mcandre opened this issue Mar 27, 2023 · 4 comments
Closed
4 of 11 tasks

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

mcandre opened this issue Mar 27, 2023 · 4 comments

Comments

@mcandre
Copy link

mcandre commented Mar 27, 2023

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.

@Emilgardis
Copy link
Member

this is most likely #724, try cargo clean

If that does not solve the issue, we can reopen

@Emilgardis
Copy link
Member

Emilgardis commented Mar 27, 2023

Also, cross 0.2.5 is based on https://github.com/cross-rs/cross/tree/v0.2.5 which does not include #591

the cross-toolchains image is using crosstool-ng so that you can specifically pick a glibc, gcc and linux version, with the default set to 2.17, 8.3.0 gcc and 4.19.21 linux

@Emilgardis
Copy link
Member

I should mention, we do want to cut a release soon, it's just that time is an issue :) If you want to help out feel free to check out https://github.com/cross-rs/cross/milestone/2 for the remaining tasks. Some of those are less important

@mcandre
Copy link
Author

mcandre commented Mar 27, 2023

Indeed, I am wrapping cross in a little CLI tool to loop over the available rustup targets.

I will try the --target-dir flag.

Yes, that works better, thank you!

Would be nice for cross to automatically apply like --target-dir target/.cross/<target> by default for build commands some day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants