Friday, 2 December 2016

Bug in Rust 1.13 for ARM and how to work around it

There's a nasty code generation bug in Rust 1.13 stable. Because ARM isn't considered a 'tier-1' platform for Rust at this time, the team have decided to put the fix into 1.14 beta (and 1.15 nightly) but not up-issue 1.13. Unfortunately this means if you follow my last post, you'll get a compiler that doesn't work properly when using floating point functions.

The best fix is probably switch to 1.14 beta until 1.14 stable comes out (around 22 December). You can do this as follows:

pi@boron:~ $ rustup toolchain install beta
info: syncing channel updates for 'beta-armv7-unknown-linux-gnueabihf'
info: downloading component 'rustc'
 47.0 MiB /  47.0 MiB (100 %)   6.2 MiB/s ETA:   0 s                
info: downloading component 'rust-std'
 60.3 MiB /  60.3 MiB (100 %)   6.2 MiB/s ETA:   0 s                
info: downloading component 'cargo'
  4.2 MiB /   4.2 MiB (100 %) 737.2 KiB/s ETA:   0 s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'

    beta-armv7-unknown-linux-gnueabihf installed - rustc 1.14.0-beta.2 (e627a2e6e 2016-11-16)

pi@boron:~ $ rustup default beta
info: using existing install for 'beta-armv7-unknown-linux-gnueabihf'
info: default toolchain set to 'beta-armv7-unknown-linux-gnueabihf'

    beta-armv7-unknown-linux-gnueabihf unchanged - rustc 1.14.0-beta.2 (e627a2e6e 2016-11-16)

pi@boron:~ $ rustc -Vv
rustc 1.14.0-beta.2 (e627a2e6e 2016-11-16)
binary: rustc
commit-hash: e627a2e6edbc7b7fd205de8ca7c86cff76655f4d
commit-date: 2016-11-16
host: armv7-unknown-linux-gnueabihf
release: 1.14.0-beta.2
LLVM version: 3.9
pi@boron:~ $
You can then switch back to stable once 1.14 has been released, or if they do put out a point release (unlikely at this point).

No comments:

Post a Comment