-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
bootstrap: Disable initial-exec TLS model on powerpc #85807
bootstrap: Disable initial-exec TLS model on powerpc #85807
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Please note: I have not fully tested this change yet. So please don't merge it yet although I'm sure it's correct. |
src/bootstrap/builder.rs
Outdated
@@ -1237,6 +1237,7 @@ impl<'a> Builder<'a> { | |||
// efficient initial-exec TLS model. This doesn't work with `dlopen`, | |||
// so we can't use it by default in general, but we can use it for tools | |||
// and our own internal libraries. | |||
#[cfg(not(target_arch = "powerpc"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think cfg!
macro would be nicer here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'm surprised to see cfg here at all; I'd expect this to check target.contains("powerpc") or so...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe cfg
would be wrong when cross-compiling - since "target" here refers to the target of bootstrap
which would be the host (native) platform?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@glaubitz try && !target.triple.startswith("powerpc-")
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I'm testing the change now on a real PowerPC machine to see if it actually works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change as suggested by @infinity0 works fine and fixes the problem on 32-bit PowerPC.
But please feel free to use a different approach if anyone has a better idea. I don't insist on my particular approach.
If this TLS mode is completely unsupported on powerpc, then I think we should emit an error whenver someone tries to specify it on the command line. Otherwise, anyone else using |
c4b54f3
to
674e27e
Compare
This comment has been minimized.
This comment has been minimized.
674e27e
to
283619c
Compare
Is there some sort of feature matrix that Rust is carrying internally for every architecture where this information could be stored as a flag? I would guess this bug could affect the upcoming m68k port as well. Plus, such a feature matrix could be used to determine whether a certain test is run or not. Currently, all tests seem to be checking per architecture rather than per feature. |
This mode is an optimization hint, if an "initial-exec" hint is useless for a given target (like e.g. TLS models not generally mapping on Windows-based target), then it should be demoted to a weaker hint. |
@glaubitz Ping from triage, what's next steps here? |
@glaubitz Are you intending to add anything more to this PR, or shall I tag this for review? |
@bkaestner I don't have any strong preference, the fix works for me. Feel free to merge it as-is or replace it with a better solution. |
@bstrie I believe this message was meant for you. |
Oops, sorry. Two people starting with "@b" in the thread and I just had only one coffee this morning :). |
I don't want to add anything else. Could you tag this for review? Thanks! |
📌 Commit 283619c has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#85807 (bootstrap: Disable initial-exec TLS model on powerpc) - rust-lang#87761 (Fix overflow in rustc happening if the `err_count()` is reduced in a stage.) - rust-lang#87775 (Add hint for unresolved associated trait items if the trait has a single item) - rust-lang#87779 (Remove special case for statement `NodeId` assignment) - rust-lang#87787 (Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort`) - rust-lang#87809 (Fix typo in the ptr documentation) - rust-lang#87816 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #81334.