Closed Rahix closed 4 years ago
Currently it doesn't build on nightly, since the version is rustc 1.46.0-nightly (346aec9b0 2020-07-11), but the minimum version is rustc 1.47.0-nightly (0820e54a8 2020-07-23).
@audioXD now that rustfmt is available in the latest nightly, we can finally get rid of that!
@Rahix thanks, that's much better!
One thing to think about is using #[lang = "start"]
instead of a macro. I used it in another project, and it allows you to remove #![no_main]
and anything special around the main
function. The reason the ARM stuff doesn't use it is because they're designed to compile on stable, which doesn't support defining that. If you think that we'll sometime compile on stable, sure, keep it, but if not, maybe consider switching to that.
The macro also allows much more customization, like the static mut transformations which is really helpful in embedded applications. Also, when you start writing custom runtime code, this gives more flexibility.
@lights0123 I had that comment because when i build with the current nightly version that's not the actual latest I get get an error.
[audioxd@Tims-PC-001 async-avr]$ rustup override set nightly
info: using existing install for 'nightly-x86_64-unknown-linux-gnu'
info: override toolchain for '/home/audioxd/Documents/Projects/async-avr' set to 'nightly-x86_64-unknown-linux-gnu'
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.46.0-nightly (346aec9b0 2020-07-11)
[audioxd@Tims-PC-001 async-avr]$ cargo build --target=avr-atmega328p.json -Z build-std="core" --examples
***SKIPED LINES***
error: could not compile `async-avr`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: linking with `avr-gcc` failed: exit code: 1
|
= note: "avr-gcc" "-Os" "-mmcu=atmega328p" "-Wl,--eh-frame-hdr" "-L" "/home/audioxd/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/avr-atmega328p/lib" "/home/audioxd/Documents/Projects/async-avr/target/avr-atmega328p/debug/examples/serial-12f51f827fcd8952.serial.dp74pwxw-cgu.2.rcgu.o" "-o" "/home/audioxd/Documents/Projects/async-avr/target/avr-atmega328p/debug/examples/serial-12f51f827fcd8952.elf" "-Wl,--gc-sections" "-L" "/home/audioxd/Documents/Projects/async-avr/target/avr-atmega328p/debug/deps" "-L" "/home/audioxd/Documents/Projects/async-avr/target/debug/deps" "-L" "/home/audioxd/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/avr-atmega328p/lib" "-Wl,--start-group" "-Wl,--end-group" "-Wl,-Bstatic" "/home/audioxd/Documents/Projects/async-avr/target/avr-atmega328p/debug/deps/libcompiler_builtins-49d9ec43f42b08f8.rlib" "-Wl,-Bdynamic" "-Wl,--gc-sections"
= note: /usr/bin/avr-ld: unrecognized option '--eh-frame-hdr'
/usr/bin/avr-ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
I feel like it ignores the target file, more specificaly the"eh-frame-header": false
. So I suggest using rustup override set nightly-2020-07-24
@audioXD you haven't updated your nightly rust since the 11th, run rustup update nightly
@lights0123
NWM I just ran rustup update nightly --force
and got the acctual latest version.
And yes i have tried running it without --force
@audioXD did you have miri
installed? --force
will force installation, even if certain components aren't available. Miri still isn't available for nightly since 2020-07-18, so that could be why
@lights0123 Oh... Yes i did :p. I also notices that it has to be built with the --release
flag
Hey,
I've published
avr-device
to crates.io and this removes all the build-dependency madness. In this PR, I've updated your repo to reflect the changes. You might want to update your blog-post as well :)Disclaimer: I could only compile-test the change. While this shouldn't break anything, I suggest, you quickly test for yourself if everything is still working ...