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

s390x toolchain generates binaries for GLIBC 2.18 which is incompatible with RHEL 7 #451

Closed
ancwrd1 opened this issue Aug 7, 2020 · 8 comments
Labels
A-glibc Area: glibc targets dynamic-linking

Comments

@ancwrd1
Copy link

ancwrd1 commented Aug 7, 2020

In the zLinux world the Red Hat Interprise Linux 7 is a very common distro. Unfortunately it comes with GLIBC 2.17 so the binaries created with the cross tool cannot be run due to some missing symbols.

@Hoverbear
Copy link

Seems similar to #455

@Alexhuszagh Alexhuszagh added A-glibc Area: glibc targets dynamic-linking labels May 28, 2022
@Alexhuszagh
Copy link
Contributor

This might be an issue for a few reasons:

  1. Need to change package management for s390x-unknown-linux-gnu to CentOS 7.
  2. There are no provided packages for glibc-s390x-linux-gnu in any official repository, and gcc-c++-s390x-linux-gnu only exists (without the shared libraries) in EPEL.

This means compiling glibc from source, which means we'd probably be better off using crosstool-ng entirely, which is quite a lot of work. It's definitely not impossible, and I'll add a section to the wiki about how to use older toolchain versions, but I don't think we can support this out-of-the-box: it's too much new code, a new dependency, and too much maintenance long term.

@Alexhuszagh
Copy link
Contributor

Alexhuszagh commented May 30, 2022

This is relatively more complex than desired, because there's a lot of bugs in crosstool-ng due to a lack of maintenance (such as old isl and expat versions), and would require essentially all the patches I've made for my C++ analog of cross (which patch numerous version dependencies and other bugs) Simply put, unless there's a lot of demand, it's probably not worth documenting since it requires a lot of effort, manual fixes to upstream tools, and debugging.

@Alexhuszagh
Copy link
Contributor

Update: we're going to be using crosstool-ng anyway to fix other issues (see #426), so although we won't support it, I can get some sample files showing how to build this with ct-ng 1.24.0. This will allow you to create a custom docker image with minimal work for this purpose, which will be documented on the wiki.

@ancwrd1
Copy link
Author

ancwrd1 commented May 31, 2022

Thanks for the feedback. With docker and cargo cross it's certainly easier; we are currently using a custom crosstool-ng toolchain for s390x which implies some additional setup with cargo config, environment variables, etc.

@Alexhuszagh
Copy link
Contributor

Alexhuszagh commented May 31, 2022

Sounds perfect, I'll document it in the wiki and create my own repository with config and Dockerfiles for these, so others can plug-and-play to use them. It'd slow down our CI by a lot, and also it's a lot of maintenance for so many builds long term, but I think it's a good idea since most of our infra is already done here.

EDIT: I've gotten approval to make it on cross-rs proper in a separate repo, so this should be a little more official.

@Alexhuszagh
Copy link
Contributor

Sorry for the large number of notifications.

I've tried this build and there's issues compiling for glibc versions <= 2.19, due to missing definitions for dtv_t and others, presumably because __ASSEMBLER__ is erroneously defined, in nptl/sysdeps/s390/tls.h. This file was removed in glibc 2.20, and the builds work starting there.

I really don't have time to patch glibc to do this, or find a way to fix this preprocessor definition, so if you have a working config file or patch, I'd be happy to use it. In the meantime, we'll show how to support newer glibc versions, but older ones like 2.17 can't be easily supported right now.

@ancwrd1
Copy link
Author

ancwrd1 commented Jun 2, 2022

No problem, thanks for your efforts and help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-glibc Area: glibc targets dynamic-linking
Projects
None yet
Development

No branches or pull requests

3 participants