-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Use the linker directly on darwin,ios #46255
Conversation
e3d47db
to
a665be5
Compare
This caused several errors on the CI which is running Linux 😕
|
Yep! Luckily I am able to reproduce these locally on macOS, so I'm
investigating now.
…On Sat, Nov 25, 2017 at 9:47 AM, kennytm ***@***.***> wrote:
This caused several errors on the CI which is running Linux 😕
[00:59:08] failures:
[00:59:08] [run-make] run-make/fpic
[00:59:08] [run-make] run-make/print-cfg
[00:59:08] [run-make] run-make/simd-ffi
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#46255 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABdsPLc6Xd2otGu9Fs-FjtVovaHLbEelks5s6CiSgaJpZM4QqauE>
.
|
...outside of target specifications - that'll come next. Updates rust-lang#11937.
Some logic to deal with macOS < 10.8 cribbed from: https://github.com/llvm-mirror/clang/blob/64309d1/lib/Driver/ToolChains/Darwin.cpp#L1910 Updates rust-lang#11937.
a665be5
to
385c844
Compare
I was able to repro |
cc @TimNN |
Thanks for this, it looks pretty cool! My main worry here would be around the area of regressions. For example this would break anyone using For example I think we should enable Switching the iOS targets seems reasonable but we may wish to pursue the same strategy for now and then post on internals about how everyone's using |
Hey @tamird, do you need anything particular from me or was the |
@TimNN nah, just thought you might have some opinions on iOS stuff (as I recall you've done some work in that area in the past). @alexcrichton sounds totally reasonable! one thing that was attractive about making |
@tamird yeah I'm quite surprised this worked to bootstrap! (that's awesome!) We could always tweak our own bootstrap to use this linker by default and avoid I was also thinking that right now the default linker is |
So this is kind of a bummer. In order to make ld "just work" on osx, we need to teach all the targets the correct ld args, which in general are just the cc args with some stuff removed. I say it's a bummer because it makes me think that "linker flavor", as implemented in rustc, is not a particularly good abstraction because generally (always?) there is only one linker on each platform, which we currently always front with cc. However, nearly all the flags we pass to cc have a direct mapping to an ld flag. Here's my proposal: we should remove linker flavor and go back to having a list of linker args per target as before, only this time the linker args will all be the ld variant, rather than the cc variant. Then, we can check at link time if the executable we're calling "looks like" cc or ld (or lld, or whatever) and map the ld flags to cc flags. Unfortunately, this will be a breaking change, as you say, with respect to how link args are pass on the command line today (since they'll need to be in We could also do this in the reverse direction (mapping cc flags to ld flags), I think, but I imagine it'll be somewhat uglier. What do you think? |
Sorry I don't currently have the time to evaluate what appears to be major refactorings of the backends and how we pass arguments around, it would be good to consult other compiler team members with these sorts of questions right now. |
Reassigning to another person randomly on the compiler team as @alexcrichton doesn't have time to evaluate this. r? @pnkfelix |
Review ping for you @pnkfelix ! |
This PR looks fine to me, but I'm not an expert in this domain (in terms of the issues that need to be addressed for #46255 |
Reading the dialogue on this PR more carefully, I now realize I was a little too blasé in my pseudo-review (aka rubberstamp) above. Namely, addressing #46255 is not sufficiently high priority to justify injecting the kinds of breaking changes that @alexcrichton has described. @alexcrichton gave some suggestions for how to revise the PR so that it would not inject a breaking- change to stable code. @tamird responded, but it seemed like their alternative approach is still going to inject breakage onto stable clients? (Did I misread their comment that outlined an alternative strategy to what @alexcrichton had suggested?) So, high-level points + questions:
Update: sigh, everywhere that I wrote |
Because it doesn't always work - if the target platform requires more flags, the user has to specify them all. The (reduced) goal is to be able to pass exactly those flags and have most platforms just work. The other questions aren't for me to answer. |
Should this be raised to the team for discussion? (Due to holiday this will likely need to wait until January) |
Seems that way to me.
…On Wed, Dec 20, 2017 at 10:18 AM, kennytm ***@***.***> wrote:
Should this be raised to the team for discussion? (Due to holiday this
will likely need to wait until January)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#46255 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABdsPOZz8TelY85OagZy1T12Iqofox72ks5tCSUwgaJpZM4QqauE>
.
|
Nominated @rust-lang/compiler. |
Triage ping @rust-lang/compiler! Just to remind you all about this PR 😁. |
We discussed this in the @rust-lang/compiler meeting. Conclusion was:
|
Triage ping for @tamird — looks like there is some feedback the team would like to see before this PR lands; will you have time to implement them? |
Thanks for the contribution, @tamird ! Unfortunately, since we haven't heard from you in a few weeks, I'm going to go ahead and close this to keep the queue tidy. Please fee free to re-open it when you have time to address the most recent feedback! |
@tamird #48125 is doing most of the refactoring that I was thinking about, would you be up for rebasing this once that lands? I think with that we shoudl be able to get all of the following working by default:
where there we're using the system linker, the |
@alexcrichton sure! Thanks for making me aware of that PR; I'll follow along and pick this up when that's merged. |
See individual commits. r? @alexcrichton cc @japaric
(pnkfelix adds: This is taking steps towards addressing #11937)