-
Notifications
You must be signed in to change notification settings - Fork 14
Update version of Rust #78
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
Conversation
b4c9de8
to
0be7dc4
Compare
I now need to update LLVM. This will be quite straightforward as it looks like the current Rust LLVM version is based on LLVM in Janurary. Looking at the diff between the our current avr-rust/llvm fork, there are a number of changes that we cherry-picked that aren't in the upstream Rust LLVM fork. This is because the backend is completely in tree now and so the upgrading process is very easy. Here are a list of all commits that need to be cherry-picked into upstream Rust LLVM
Of course, when Rust upgrades to LLVM 5.0, we can do this process again and ~85% of these commits will already be in upstream Rust |
I have pushed a new LLVM branch named |
0be7dc4
to
264ff78
Compare
I skimmed through the set of patches that are applied on top of Rust master and they look reasonable. I can try compiling it now. |
It does not appear that you have switched to the diff --git a/.gitmodules b/.gitmodules
index 2802c8d639..791c2436cb 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,7 +1,7 @@
[submodule "src/llvm"]
path = src/llvm
- url = https://github.com/rust-lang/llvm.git
- branch = master
+ url = https://github.com/avr-rust/llvm.git
+ branch = avr-rust-experimental
[submodule "src/rt/hoedown"]
path = src/rt/hoedown
url = https://github.com/rust-lang/hoedown.git
diff --git a/src/llvm b/src/llvm
index a6b738c907..ce8e2085be 160000
--- a/src/llvm
+++ b/src/llvm
@@ -1 +1 @@
-Subproject commit a6b738c907ee60e2153f42d8180218bd80b947cc
+Subproject commit ce8e2085bee042b1612dcd99251d46eaeaac831b |
I updated libcore mini to this version of Rust and was able to compile and flash my board. I think it's good to go, once you switch to the newest LLVM commit in your branch. |
Might be worth updating the layout to |
264ff78
to
99fce14
Compare
Fixed
Fixed |
This shouldn't need to be in tree, but I'm committing it anyway because it's a headache when compiling with a separate LLVM root.
I can't seem to get it to work on my machine When compiling the avr-rust/blink example, I get this xargo build --target avr-atmega328p
I've tried rebuilding LLVM and Rust from scratch to no avail. |
99fce14
to
55a75c2
Compare
I use my own target spec, maybe something is different? {
"llvm-target": "avr-unknown-unknown",
"cpu": "atmega328p",
"target-endian": "little",
"target-pointer-width": "16",
"os": "none",
"target-env": "gnu",
"target-vendor": "unknown",
"arch": "avr",
"data-layout": "e-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
"executables": true,
"linker": "avr-gcc",
"linker-flavor": "gcc",
"pre-link-args": {
"gcc": [
"-mmcu=atmega328p",
"-nostartfiles",
"../interrupt_vector.S",
"../initialize_memory.S"
]
},
"exe-suffix": ".elf",
"post-link-args": {
"gcc": [
"-Wl,--entry=main",
"-Wl,--entry=_ivr_irq0",
"-Wl,--entry=_ivr_irq1",
"-Wl,--entry=_ivr_pin_change_0",
"-Wl,--entry=_ivr_pin_change_1",
"-Wl,--entry=_ivr_pin_change_2",
"-Wl,--entry=_ivr_watchdog_timer",
"-Wl,--entry=_ivr_timer2_compare_a",
"-Wl,--entry=_ivr_timer2_compare_b",
"-Wl,--entry=_ivr_timer2_overflow",
"-Wl,--entry=_ivr_timer1_capture",
"-Wl,--entry=_ivr_timer1_compare_a",
"-Wl,--entry=_ivr_timer1_compare_b",
"-Wl,--entry=_ivr_timer1_overflow",
"-Wl,--entry=_ivr_timer0_compare_a",
"-Wl,--entry=_ivr_timer0_compare_b",
"-Wl,--entry=_ivr_timer0_overflow",
"-Wl,--entry=_ivr_spi_transfer_complete",
"-Wl,--entry=_ivr_usart_rx_complete",
"-Wl,--entry=_ivr_usart_udr_empty",
"-Wl,--entry=_ivr_usart_tx_complete",
"-Wl,--entry=_ivr_adc_conversion_complete",
"-Wl,--entry=_ivr_eeprom_ready",
"-Wl,--entry=_ivr_analog_comparator",
"-Wl,--entry=_ivr_two_wire_serial_interface",
"-Wl,--entry=_ivr_store_program_memory_ready"
]
},
"no-compiler-rt": true
} |
Hmm. I pulled down avr-rust/blink. After switching to my fork of libcore-mini, I got a different error:
|
I swapped from building an out-of-tree LLVM (using When compiling blink with your new libcore-mini, the compiler itself segfaults |
Maybe you don't have the LLVM assertions enabled, it's likely to be the error message I pasted earlier? |
I get the same error too after I enable assertions Sounds a lot like #57 eh |
Indeed; I wonder what's so different about my blink and the official blink... |
Oh, it's probably how we are building, not what:
When we are not in release, there's probably a lot more pressure on the registers. |
Yup, if I build my code in debug mode, then it has the same assertion. My guess is that we haven't actually regressed in any interesting way. |
Nice spotting, I think if we edit the usage section in the README to include |
Will probably do it in a week or two, have got a lot going on at uni at the moment If you want to edit the README and land it in the meantime, I've got no problem with that, otherwise it can wait for a bit |
To be clear, I mean that when compiling your AVR code, not the compiler, you need to use
Would you like me to go ahead and perform all the pushes? I can do that 😸 |
Pushed...! |
This PR takes all of the AVR-specific commits from the current
avr-support
branch and applies them directly to the upstream Rust master.I've removed all of the "Cherry pick fix for " commits, as they complicate the history and cause merge conflicts easily. I've also cleaned up the history a bit so that there are only a handful of avr-rust specific commits.
I've also ensured that all of our commits are prefixed with "[AVR]", and also added "[No Upstream]" to the relevant commits.
When this is good to go, rather than merging this, we should simply force push
avr-support-update
toavr-support
so that the history is clean.N.B. The AVR-specific commits are at the top of the branch, but GitHub seems to be showing commits in chronological order rather than showing the commit graph directly.