-
Notifications
You must be signed in to change notification settings - Fork 215
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
Build failure with LLVM ERROR on sparc-unknown-linux-gnu
#390
Comments
I'm experiencing the same error. Does anybody know what can be causing it? |
I believe I have found the source of the problem. The thing is that the rust compiler/LLVM Sparc backend is unable to lower a function that takes two 128-bit unsigned integers as arguments and returns a tuple with two 128-bit unsigned integers. The following function causes the same error: fn test_128(one: u128, two: u128) -> (u128, u128) {
let division = one / two;
(division + 40000000, division - 100000)
} One possible solution could be to disable the generation of the 128-bit division altogether by using a feature. Another solution could be to implement a new macro that only returns one single 128-bit integer: either the quotient or the reminder. cc: @AaronKutch |
I'm guessing that some algorithm in the Sparc backend responsible for putting large arguments on the stack is failing? I'm looking for any fixes for the root problem so I don't have to put hacks in my beautiful function setup. |
If the problem is deep in LLVM, then I think the best decision is for me to add one more feature flag that turns on a simple no-subalgorithm binary division algorithm path that would fix it. |
I think that's the best solution for now. I don't know how hard it would be to fix the problem in the implementation of LLVM for Sparc. I believe it has something to do with the definition of the Calling Convention, but my experience with LLVM at that level is basically non-existent. Thanks a lot! |
I realized that both 32-bit and 64-bit SPARC do not have widening multiplications (and in fact I think it is the only 64-bit target without widening multiplication), which makes the default division chain I am using inefficient for all SPARCs. I have decided upon using configuration and not feature flags to enable a specialized path for SPARC that also doesn't use
|
I can help you with testing a 32-bit SPARC target since that's precisely what I am using. I can confirm you that This is the output for the command you requested:
Thanks!! |
Thanks. I have a PR up that should fix the issue. Can you try out the branch locally to see if it is fixed, because the CI will not catch your problem? |
wait the CI is catching some problem, let me fix it |
It looks like the CI is broken for some other reason, can you try out the fixes anyway? |
I have checked out the PR and it compiles. I haven't tried it though because basically, I don't know how to do it. I cannot use it in my current projects because the What can I do to try it? |
I just adjusted the PR. I'm not sure how to fix your problem, because I don't know what specific build process you are using to inject |
The package is included automatically into the compilation process. I am using a feature called build-std, which is an unstable feature that makes cargo compile parts of the std (such as core or alloc) together with your project for targets that are not fully supported. Apparently, it uses the latest version of |
You probably want to open an issue on the tracking repo https://github.com/rust-lang/wg-cargo-std-aware |
Done. |
Update `compiler_builtins` to 0.1.38 This version contains the fixes of rust-lang/compiler-builtins#390 and rust-lang/compiler-builtins#391. Also, rename features following rust-lang/compiler-builtins#386.
Update `compiler_builtins` to 0.1.39 This version contains the fixes of rust-lang/compiler-builtins#390 and rust-lang/compiler-builtins#391. Also, rename features following rust-lang/compiler-builtins#386.
The libc build with cargo's
build-std
fails due to:(Here's the log: https://github.com/rust-lang/libc/runs/1314551399)
I recently updated
compiler_builtins
to 0.1.36 (rust-lang/rust#78209) on rust-lang/rust and turned out that's the cause.We can reproduce the failure with
cargo build -Z build-std=core,alloc -vv --target sparc-unknown-linux-gnu
on this repo as well.The text was updated successfully, but these errors were encountered: