Skip to content
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

mulodi4 debug assertion #148

Closed
japaric opened this issue Mar 6, 2017 · 3 comments · Fixed by #149
Closed

mulodi4 debug assertion #148

japaric opened this issue Mar 6, 2017 · 3 comments · Fixed by #149

Comments

@japaric
Copy link
Member

japaric commented Mar 6, 2017

STR

#![feature(compiler_builtins_lib)]

extern crate compiler_builtins;

use compiler_builtins::int::mul::__mulodi4;

fn main() {
    let (a, b) = (72113192, -480093263);
    let mut overflow = 2;
    let c = __mulodi4(a, b, &mut overflow);
}
$ cross run --target armv7-unknown-linux-gnueabihf
     Running `/target/armv7-unknown-linux-gnueabihf/debug/foo`
thread 'main' panicked at 'attempt to subtract with overflow', /cargo/git/checkouts/compiler-builtins-ec094dc45a0179c8/0507842/src/int/sdiv.rs:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.

The command hangs and doesn't return but that could be a Cross bug ... I don't know.

@japaric
Copy link
Member Author

japaric commented Mar 6, 2017

The problem actually originates from:

__divdi3(-9223372036854775808, -480093263)

japaric pushed a commit that referenced this issue Mar 6, 2017
bors added a commit that referenced this issue Mar 7, 2017
@bors bors closed this as completed in #149 Mar 7, 2017
@oli-obk
Copy link
Contributor

oli-obk commented Apr 11, 2017

can you publish a new snapshot that includes this fix?

@japaric
Copy link
Member Author

japaric commented Apr 12, 2017

@oli-obk that snapshot crate was a hack. The compiler-builtins crate truly belongs in the sysroot; it's just that the rust-lang/rust version of that crate has too few intrinsics so I decided to directly depend on this crate (because I didn't want to use the C implementations of the intrinsics).

Xargo has been capable of putting custom crates in the sysroot for a while and this crate is now "thumb friendly" due to recent changes. I suggest that you remove the direct dependency to compiler-builtins from your dependency graph and instead build it as part of the Xargo sysroot. Example

If you want to continue using the snapshot crate, I'd be happy to transfer ownership of it to you so you can update / maintain it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants