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

Auto-detect ld v2.24 and disable USE_BINARYBUILDER_LIBUV. #31573

Closed
wants to merge 2 commits into from

Conversation

staticfloat
Copy link
Member

Potential solution to #31555 (comment). I am trying to avoid having to fully parse the version number as that's complex in Make, and I don't even know what the proper bounds on invalid ld versions are (I just know that 2.24 doesn't work, and 2.26 does work)

@staticfloat staticfloat requested a review from vchuravy April 1, 2019 18:48
Copy link
Member

@vchuravy vchuravy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me, but I also am not sure I am qualified to review.

@staticfloat
Copy link
Member Author

After playing around with this, I really don't like it. For this to work robustly, we need to:

  • Reliably discover ld version, which can be somewhat annoying, as people sometimes patch the version strings to say something like 2.24~ubuntu or whatever, and writing the parsing in make is no fun.
  • Check every single time you invoke make (including sub-makes), which quickly gets annoying if we spam out messages all the time, but is also annoying if it silently changes behavior. (This could be addressed by implementing an environmental data caching system in make, but that seems slightly ridiculous to me)

The fundamental problem here is that apparently ld static output is not forwards-compatible, so ld v2.24 can't use static libraries generated by ld v2.26. That's a bit of a problem for us, and the potential solutions are varied:

  • Change BB to use an older ld. This sounds attractive at first, until we realize that means that we lock ourselves out of fun things like assemblers that understand AVX, and it can get difficult to build newer projects with very old as and ld.
  • Change Julia to link dynamically against everything, just completely forgo static linking at all.
  • Don't use BB on these libraries unless explicitly asked (e.g. these guys must be opt-in)
  • Ship a compatible binutils with Julia when using BB versions of these projects. We're already shipping dependencies, why not start shipping bits of toolchain as well?

@staticfloat staticfloat closed this Apr 3, 2019
@vchuravy
Copy link
Member

vchuravy commented Apr 4, 2019

I think:

Don't use BB on these libraries unless explicitly asked (e.g. these guys must be opt-in)

Is the right conservative option.

@StefanKarpinski
Copy link
Member

  • Ship a compatible binutils with Julia when using BB versions of these projects. We're already shipping dependencies, why not start shipping bits of toolchain as well?

I like this option. If operating systems can't be trusted to not be broken junk (and they can't, unfortunately), then we need to take over that responsibility and ship stuff that isn't so broken.

@staticfloat
Copy link
Member Author

As a side note; it appears that there are other, subtler bugs that can occur even just when combining old GCC versions (like our GCC 4 shard) with new binutils (example). I think I'm going to need to build a binutils per GCC shard, we'll just use a binutils close to that GCC version.

This compiler multiversioning mess is getting out of hand, so I have written up some thoughts about what the problems are, how we're solving them, and I've started rebuilding our system images to try and address these issues.

@owainkenwayucl
Copy link

owainkenwayucl commented Nov 18, 2019

Just a note that this is also an issue on RHEL 7.x.

$ ld --version
GNU ld version 2.25.1-32.base.el7_4.2 
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

@staticfloat staticfloat deleted the sf/olld branch April 16, 2020 19:00
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

Successfully merging this pull request may close these issues.

5 participants