-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add -Zfunction-return={keep,thunk-extern}
option
#116892
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
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Note that LLVM ignores the attribute in non-x86, but I have not replicated Clang's check that this only works in x86 for the CLI flag for the moment (should it be part of the target spec?). Also, I linked the feature request issue as the tracking one in the docs -- we can reuse it changing the OP message, I assume, but please let me know if it is best to create a new one. |
8df5004
to
8b6016a
Compare
// FIXME: In principle, the inherited base LLVM target code model could be large, | ||
// but this only checks whether we were passed one explicitly (like Clang does). |
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.
If there is a way to get the effective code model, it would be nice to use it.
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.
Maybe check sess.target.options.code_model
?
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.
That covers even less, no? i.e. code_model()
covers codegen and target options.
This comment has been minimized.
This comment has been minimized.
I added a folder but that still counts against the tidy limit in |
One more note: GCC and Clang give an error if one tries to use I did it like this because it seemed simpler (no But perhaps consistency with GCC/Clang is better? |
I moved them inside the other folder, and noticed one in |
☔ The latest upstream changes (presumably #117405) made this pull request unmergeable. Please resolve the merge conflicts. |
Resolved trivial formatting conflict. |
@wesleywiser Thanks for the very quick review and have a nice holiday (I saw the other PR by chance when looking for this one :) |
Thanks! |
This is intended to be used for Linux kernel RETHUNK builds.
With this commit (optionally backported to Rust 1.73.0), plus a patched Linux kernel to pass the flag, I get a RETHUNK build with Rust enabled that is
objtool
-warning-free and is able to boot in QEMU and load a sample Rust kernel module.Issue: #116853.