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

Upgrade Rust base (9th June) (fb7cca33f) #144

Closed
wants to merge 5 commits into from

Conversation

dylanmckay
Copy link
Member

I've rebased the #137 branch one more time to bring it two months forward - from April to June.

@dylanmckay
Copy link
Member Author

I can successfully compile blink to ELF in release mode with this branch.

This commit fixes debug printing of function pointers on AVR. AVR does
not support `addrspacecast` instructions, and so this patch modifies
libcore so that a `ptrtoint` IR instruction is used and the address
space cast is avoided.
Add extra steps for macOS, as noted in #131
@shepmaster
Copy link
Member

blink to ELF in release mode

As far as I'm concerned, that's our current "golden master", so I'd be OK "merging" this as our master branch once we've made sure it compiles on at least a second machine (is the current CI enough for that?)

@Rahix
Copy link

Rahix commented Jun 8, 2019

@shepmaster, I can test compile my HAL crates with it tomorrow if you want

@dylanmckay
Copy link
Member Author

@shepmaster the CI run successfully ran make && make install.

Copy link

@Rahix Rahix left a comment

Choose a reason for hiding this comment

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

Everything seems to work as it should! 👍

@dylanmckay
Copy link
Member Author

I have force pushed avr-support to 9a1785d and master to fb7cca3.

@dylanmckay dylanmckay closed this Jun 9, 2019
@shepmaster shepmaster deleted the avr-support-fb7cca33f branch June 9, 2019 12:11
@shepmaster
Copy link
Member

FWIW, I can compile my AVR-GCC-free blink example just fine as well!

@peacememories
Copy link

hmm, i updated my avr-rust installation, and now my projects fail to build core with the following error message:

   Compiling compiler_builtins v0.1.16
     Running `rustc --crate-name build_script_build /Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.16/build.rs --color always --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="compiler-builtins"' --cfg 'feature="default"' --cfg 'feature="mem"' -C metadata=622f0871509f1a77 -C extra-filename=-622f0871509f1a77 --out-dir /var/folders/9b/sq7l7grn1_q_bm74x5x67z8r0000gn/T/xargo.PukdOc8v32h1/target/release/build/compiler_builtins-622f0871509f1a77 -L dependency=/var/folders/9b/sq7l7grn1_q_bm74x5x67z8r0000gn/T/xargo.PukdOc8v32h1/target/release/deps --cap-lints allow`
error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `compiler_builtins`.

Any idea what might have gone wrong?

@shepmaster
Copy link
Member

can't find crate for std

There certainly isn't a std crate for AVR: no filesystem, no threads, etc. I don't know how your code could have been compiling before.

Unless build scripts use the host system's libstd, in which case it seems like your build might not be complete. Did you try deleting the build artifacts and doing a clean build? Are you following the instructions in the README?

@peacememories
Copy link

Of course the project itself isn't using std (it's for avr after all). It seems the cross compilation of libcore is using it somewhere. When I updated I ultimately cloned the whole repository again and built it. Maybe something's stale in ~/.xargo ~/.cargo or ~/.rustup? I don't know.

@Rahix
Copy link

Rahix commented Jun 10, 2019

I suggest deleting .xargo and trying again ... At least I had to do that to get the new version working, but the error message was a different one ...

@peacememories
Copy link

Deleted .xargo and the whole compiler and built it again, the problem seems to persist.

@Rahix
Copy link

Rahix commented Jun 13, 2019

@peacememories: You are probably using rustup, right? Which directory did you link the toolchain to, using rustup toolchain link <...>?

@peacememories
Copy link

lrwxr-xr-x 69 gabriel 13 Jun 16:14 avr-toolchain -> /Users/user/Library/Rust/avr-rust/build/x86_64-apple-darwin/stage1

@Rahix
Copy link

Rahix commented Jun 13, 2019

Try linking against stage2 instead. If that doesn't work, set an install prefix in config.toml, run make install (or x.py install iirc) and then link against the directory you installed to

@peacememories
Copy link

linking against stage2 works. huh. I could've sworn the docs say you should link against stage1?

@peacememories
Copy link

Thanks anyway, now I can continue working :)

@shepmaster
Copy link
Member

huh. I would have sworn that I used stage1 (and I likely wrote the README), but I do have it set to stage2 as well:

/Users/shep/.rustup/toolchains/avr -> /Users/shep/Projects/avr-rust/build/build/x86_64-apple-darwin/stage2

I'll change that in the readme.

shepmaster added a commit that referenced this pull request Jun 13, 2019
Evidently there's some difference, see #144 (comment)
@shepmaster
Copy link
Member

run make install

FWIW, I've never installed Rust using this mechanism in the 4 years I've been using it; I always use my local builds right out of the build directory. I kind of regret that we have it in our README at all.

@Rahix
Copy link

Rahix commented Jun 13, 2019

Darn, I was just about to send you a pull-request with updated instructions :D

dylanmckay pushed a commit to dylanmckay/rust that referenced this pull request Sep 26, 2019
Evidently there's some difference, see avr-rust#144 (comment)
dylanmckay pushed a commit to dylanmckay/rust that referenced this pull request Sep 26, 2019
Evidently there's some difference, see avr-rust#144 (comment)
dylanmckay pushed a commit that referenced this pull request Nov 27, 2019
Evidently there's some difference, see #144 (comment)
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.

4 participants