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

Rust stable #496

Merged
merged 5 commits into from
Jun 6, 2020
Merged

Rust stable #496

merged 5 commits into from
Jun 6, 2020

Conversation

benma
Copy link
Collaborator

@benma benma commented Jun 5, 2020

No description provided.

benma added 2 commits June 5, 2020 13:28
With the previous 1.11 version, this line failed:

RUN go get -v -u
github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc

(possibly that cmd became incompatible somehow?).
We went to nightly to be able to use async on no_std. With tomorrow's release of stable 1.44.0, this is available in stable, so no reason for us to be reckless 😇

https://www.reddit.com/r/rust/comments/fn6zzq/async_functions_for_no_std_now_available_on/

https://github.com/rust-lang/rust/blob/master/RELEASES.md
@benma benma mentioned this pull request Jun 5, 2020
@benma
Copy link
Collaborator Author

benma commented Jun 5, 2020

image

Uuh...

@benma benma requested a review from x1ddos June 5, 2020 19:05
@x1ddos
Copy link
Contributor

x1ddos commented Jun 5, 2020

Ha! Abuse!? What abuse? 🙈

Maybe we should really switch from travis to github workflows: https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow. I'll try to play with it and see if it can work for us.

Copy link
Contributor

@x1ddos x1ddos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I don't have a device to flash and boot it at the moment but it all seems to build fine:

dockeruser@ce18181884d8$ rustc --version
rustc 1.44.0 (49cae5576 2020-06-01)
dockeruser@ce18181884d8$ go version
go version go1.14.4 linux/amd64

$ make -j firmware
...
Generating binary firmware.bin
   text    data     bss     dec     hex filename
 414652   18808  208720  642180   9cc84 firmware.elf

$ make -j bootloader
...
Generating binary bootloader.bin
   text    data     bss     dec     hex filename
  42672    4368  190112  237152   39e60 bootloader.elf

@benma
Copy link
Collaborator Author

benma commented Jun 6, 2020

Ran CI locally, got this in make device-tests:

[ 58%] Building C object test/device-test/CMakeFiles/fw_test_ssp.elf.dir/src/test_ssp.c.obj
[ 61%] Linking C executable ../../bin/fw_test_ssp.elf
/usr/local/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld: /usr/local/bin/../lib/gcc/arm-none-eabi/8.2.1/thumb/v7e-m+fp/softfp/libgcc.a(_arm_addsubdf3.o): in function `__aeabi_dsub':
(.text+0x8): multiple definition of `__aeabi_dsub'; ../../lib/libfirmware_rust_c.a(compiler_builtins-5829be534503bd8e.compiler_builtins.cthmhl66-cgu.175.rcgu.o):/cargo/registry/src/github.ghproxy.top-1ecc6299db9ec823/compiler_builtins-0.1.27/src/macros.rs:226: first defined here

@NickeZ any idea how to debug? 😇

Edit: added the offending symbols in the same place in the fix compilation error commit, which solves it. Could not track down exactly why it only happens in device tests, and why the symbols list changes or where to find the list..

@x1ddos pls re-check-

benma added 2 commits June 6, 2020 11:15
With the symbols present, this happened:

```
/usr/local/bin/arm-none-eabi-objcopy: not stripping symbol `memcpy' because it is named in a relocation
/usr/local/bin/arm-none-eabi-objcopy: not stripping symbol `memmove' because it is named in a relocation
/usr/local/bin/arm-none-eabi-objcopy: not stripping symbol `memset' because it is named in a relocation
```

Seems like in the updated Rust toolchain, the symbols are correctly
referenced and no workaround is needed.

In return, some other symbols now seem to clash, but only in
device-tests.
After updating Go and going to Rust toolchain 1.44.0.
in bitbox02-rust-c, we use

Enabling lang-items is unstable.

The workaround is to use RUSTC_BOOTSTRAP=1 to enable this (while still
being on a stable toolchain), which was applied to the unit tests and
firmware, but not the docs.

I assume the docs target was added after we temporarily went to the
nightly toolchain.
@x1ddos
Copy link
Contributor

x1ddos commented Jun 6, 2020

Oh, I forgot to run the tests! Sorry.

__aeabi_dsub is coming from rust-lang/compiler-builtins#349, I believe. Haven't tracked why device-tests are different yet either.

@benma benma merged commit 5be1ffe into BitBoxSwiss:master Jun 6, 2020
@benma benma deleted the rust-stable branch June 6, 2020 10:54
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 this pull request may close these issues.

2 participants