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

rustup requires newer GLIBC than rustc on some arches #1681

Closed
cuviper opened this issue Mar 4, 2019 · 6 comments
Closed

rustup requires newer GLIBC than rustc on some arches #1681

cuviper opened this issue Mar 4, 2019 · 6 comments
Labels

Comments

@cuviper
Copy link
Member

cuviper commented Mar 4, 2019

Problem
The distributed builds of rustup on some arches require relatively recent GLIBC symbols, newer than the baseline used by rustc itself. Especially, those that build rustup with ubuntu:18.04 cross-gcc will be tied to a similar OS ABI, while rustc supports older systems than that.

This bug is a continuation of #1339.

Steps
For example, on RHEL 7.6 ppc64:

$ rpm -q glibc
glibc-2.17-260.el7.ppc64
$ curl https://sh.rustup.rs -sSf | sh
info: downloading installer
/tmp/tmp.VElBcOx0vj/rustup-init: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /tmp/tmp.VElBcOx0vj/rustup-init)
/tmp/tmp.VElBcOx0vj/rustup-init: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /tmp/tmp.VElBcOx0vj/rustup-init)

Possible Solution(s)
Rust's own docker images use careful cross toolchains to maintain ABI, and I think rustup could just reuse those same docker images.

Notes
For the currently available linux-gnu binaries, I see:

$ for f in */rustup-init; do echo $f; eu-readelf -V $f | grep -o 'Name: GLIBC\S*' | sort -V | tail -n1; done
aarch64-unknown-linux-gnu/rustup-init
Name: GLIBC_2.17
arm-unknown-linux-gnueabihf/rustup-init
Name: GLIBC_2.16
arm-unknown-linux-gnueabi/rustup-init
Name: GLIBC_2.16
armv7-unknown-linux-gnueabihf/rustup-init
Name: GLIBC_2.16
i686-unknown-linux-gnu/rustup-init
Name: GLIBC_2.3.4
mips64el-unknown-linux-gnuabi64/rustup-init
Name: GLIBC_2.25
mips64-unknown-linux-gnuabi64/rustup-init
Name: GLIBC_2.25
mipsel-unknown-linux-gnu/rustup-init
Name: GLIBC_2.25
mips-unknown-linux-gnu/rustup-init
Name: GLIBC_2.25
powerpc64le-unknown-linux-gnu/rustup-init
Name: GLIBC_2.25
powerpc64-unknown-linux-gnu/rustup-init
Name: GLIBC_2.25
powerpc-unknown-linux-gnu/rustup-init
Name: GLIBC_2.25
s390x-unknown-linux-gnu/rustup-init
Name: GLIBC_2.25
x86_64-unknown-linux-gnu/rustup-init
Name: GLIBC_2.3.4

All of those requiring GLIBC_2.25 are problematic: mips*, powerpc*, and s390x.

Rust currently uses ubuntu:16.04 toolchains for all mips* targets, RHEL6-ish toolchains for powerpc, powerpc64, and s390x, and RHEL7-ish toolchains for powerpc64le.

@kinnison
Copy link
Contributor

kinnison commented Mar 5, 2019

Thanks for your report @cuviper - I guess that what we need to do is to consider the base docker images we use for our builds. Currently we simply use trusty but perhaps there's a still-supported Ubuntu option we might use instead? Otherwise I guess we need to customise the dist for each architecture.

If you could take a look at .travis.yml and make a suggestion (or even better, a PR) then I'd appreciate your input.

Thanks,

D.

@mati865
Copy link
Contributor

mati865 commented Mar 5, 2019

Trusty (Ubuntu 16.04) will reach EOL on 17.04.2019 so this workaround will be temporary. Also it ships with glibc 2.19 so binaries still would not work on RHEL or CentOS.

@nrc
Copy link
Member

nrc commented Mar 5, 2019

I think that for non-tier 1 platforms, you're best course of action is to build from source. We would happily accept a PR if needed to help with that, but I don't think we have the bandwidth to improve things for our own distributions, sorry.

@nrc nrc closed this as completed Mar 5, 2019
@cuviper
Copy link
Member Author

cuviper commented Mar 5, 2019

I'm intending to work on this, if you could leave it open...

cuviper added a commit to cuviper/rustup.rs that referenced this issue Mar 23, 2019
When building for `linux-gnu` targets, we need to be careful about which
versioned GLIBC symbols we'll link, as this sets the minimum supportable
system version in ABI. The images in rust-lang/rust/src/ci/docker/ have
already taken this into account, and since they're uploaded to S3, we
can just use those exact images to get the same ABI compatibility.

The builds for mips*, powerpc*, and s390x were identified in rust-lang#1681 as
having newer glibc symbols than rustc, so those are now changed to use
rust's docker images. In the future, we might want to do this for other
architectures too, so all toolchains are in sync.
@cuviper
Copy link
Member Author

cuviper commented Apr 23, 2019

The symbol versions for those arches look much better in the rustup 1.18 release:

$ for f in */rustup-init; do echo $f; eu-readelf -V $f | grep -o 'Name: GLIBC\S*' | sort -V | tail -n1; done
mips64el-unknown-linux-gnuabi64/rustup-init
Name: GLIBC_2.18
mips64-unknown-linux-gnuabi64/rustup-init
Name: GLIBC_2.18
mipsel-unknown-linux-gnu/rustup-init
Name: GLIBC_2.18
mips-unknown-linux-gnu/rustup-init
Name: GLIBC_2.18
powerpc64le-unknown-linux-gnu/rustup-init
Name: GLIBC_2.17
powerpc64-unknown-linux-gnu/rustup-init
Name: GLIBC_2.7
powerpc-unknown-linux-gnu/rustup-init
Name: GLIBC_2.7
s390x-unknown-linux-gnu/rustup-init
Name: GLIBC_2.7

@matthiasdiener
Copy link

Thanks @cuviper! I can confirm that installation on CentOS 7 ppc64le works out of the box now, without requiring the script I had mentioned in #1339.

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

No branches or pull requests

5 participants