-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Set target-abi module flag for RISC-V targets #123612
Conversation
Relevant LLVM patch: llvm/llvm-project@227496d Some remarks (I'm not very familiar with LLVM + RISC-V + LTO):
|
Would a current workaround for the reproducer makefile be to specify |
Hi @jieyouxu, Thanks for your quick review.
Yes, that will work, but I still think this should be fixed in rustc.
I am not familiar with rustc or llvm. But from the code it does look like clang is emitting this metadata unconditionally: https://github.com/llvm/llvm-project/blob/llvmorg-19-init/clang/lib/CodeGen/CodeGenModule.cpp#L1057-L1062
I will do it.
I will try to add tests. |
I personally think that emitting target-abi does make sense. But I'm far from familiar with the LLVM side of things to judge if this approach is what makes the most sense given the context, so I'll leave this to reviewers more well-versed in the LLVM side of things to give the final reviews. I'll tag this PR with A-LLVM for more visibility. |
Some changes occurred in run-make tests. cc @jieyouxu |
I have added a run-make test and a codegen test and fixed a bug that empty target-abi got emitted for targets that have llvm_abiname defined as an empty string. |
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.
Thanks for adding the tests. I left some reviews for the tests themselves. For the LLVM wrapper and LLVM codegen changes, another reviewer will look at them.
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 LLVM changes look reasonable to me.
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 we can drop cffc0f5 now.
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 can reproduce the issue when dropping -march
. I'm not sure if we also need this parameter. It might not matter.
For me, using drop
instead of revert
is better. This commit does not contribute to the history.
I don't think we should drop
Should I keep all the micro commits or squash them? |
As far as I know, the current rust repository has very liberal requirements for commits. I think it's fine to keep them as long as they are helpful for reviewing the commit history. :) |
Fixes cross-language LTO on RISC-V targets (Fixes rust-lang#121924)
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
wtf is this parsing bors |
@bors r=jieyouxu,nikic,DianQK rollup |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#121884 (Port exit-code run-make test to use rust) - rust-lang#122200 (Unconditionally show update nightly hint on ICE) - rust-lang#123568 (Clean up tests/ui by removing `does-nothing.rs`) - rust-lang#123609 (Don't use bytepos offsets when computing semicolon span for removal) - rust-lang#123612 (Set target-abi module flag for RISC-V targets) - rust-lang#123633 (Store all args in the unsupported Command implementation) - rust-lang#123668 (async closure coroutine by move body MirPass refactoring) Failed merges: - rust-lang#123701 (Only assert for child/parent projection compatibility AFTER checking that theyre coming from the same place) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#123612 - kxxt:riscv-target-abi, r=jieyouxu,nikic,DianQK Set target-abi module flag for RISC-V targets Fixes cross-language LTO on RISC-V targets (Fixes rust-lang#121924)
Backport rust-lang/rust#123612 to fix cross-language LTO issues in advance.
Backport rust-lang/rust#123612 to fix cross-language LTO issues in advance.
run-make: refactor out command wrappers for `clang` and `llvm-readobj` This PR is rebased on top of rust-lang#123699. This PR is a follow up to rust-lang#123612 to refactor out command wrappers into the support library for `llvm-readobj` and `clang`. r? ghost
run-make: refactor out command wrappers for `clang` and `llvm-readobj` This PR is rebased on top of rust-lang#123699. This PR is a follow up to rust-lang#123612 to refactor out command wrappers into the support library for `llvm-readobj` and `clang`. r? ghost
Rollup merge of rust-lang#123729 - jieyouxu:rmake-refactor-2, r=oli-obk run-make: refactor out command wrappers for `clang` and `llvm-readobj` This PR is rebased on top of rust-lang#123699. This PR is a follow up to rust-lang#123612 to refactor out command wrappers into the support library for `llvm-readobj` and `clang`. r? ghost
rust-lang/rust#123612 has landed in 1.79.0
rust-lang/rust#123612 has landed in 1.79.0
Fixes cross-language LTO on RISC-V targets (Fixes #121924)