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

bump toolchain to last night's nightly #438

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions app/demo-stm32f4-discovery/app-f3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ stacksize = 1536
name = "drv-stm32fx-rcc"
features = ["f3"]
priority = 1
max-sizes = {flash = 4096, ram = 1024}
max-sizes = {flash = 8192, ram = 1024}
uses = ["rcc"]
start = true

Expand Down Expand Up @@ -96,4 +96,3 @@ priority = 5
max-sizes = {flash = 128, ram = 256}
stacksize = 256
start = true

2 changes: 1 addition & 1 deletion app/demo-stm32f4-discovery/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ stacksize = 1536
name = "drv-stm32fx-rcc"
features = ["f4"]
priority = 1
max-sizes = {flash = 4096, ram = 1024}
max-sizes = {flash = 8192, ram = 1024}
uses = ["rcc"]
start = true

Expand Down
2 changes: 1 addition & 1 deletion app/demo-stm32h7-nucleo/app-h753.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ task-slots = ["sys", "hash_driver"]
name = "drv-stm32h7-hash-server"
features = ["h753"]
priority = 3
max-sizes = {flash = 8192, ram=4096 }
max-sizes = {flash = 16384, ram=4096 }
stacksize = 2048
start = true
uses = ["hash"]
Expand Down
2 changes: 1 addition & 1 deletion app/gemini-bu/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ task-slots = ["sys", "hash_driver"]
name = "drv-stm32h7-hash-server"
features = ["h753"]
priority = 3
max-sizes = {flash = 8192, ram=4096 }
max-sizes = {flash = 16384, ram=4096 }
stacksize = 2048
start = true
uses = ["hash"]
Expand Down
4 changes: 2 additions & 2 deletions app/gimlet/rev-b.toml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ register_defs = "gimlet-regs-b.json"
name = "drv-stm32h7-hash-server"
features = ["h753"]
priority = 2
max-sizes = {flash = 8192, ram=4096 }
max-sizes = {flash = 16384, ram=4096 }
stacksize = 2048
start = true
uses = ["hash"]
Expand Down Expand Up @@ -224,7 +224,7 @@ features = ["vlan"]
[tasks.validate]
name = "task-validate"
priority = 5
max-sizes = {flash = 8192, ram = 4096 }
max-sizes = {flash = 16384, ram = 4096 }
stacksize = 1000
start = true
task-slots = ["i2c_driver"]
Expand Down
4 changes: 2 additions & 2 deletions app/gimletlet/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ features = ["stm32h753", "usart2"]
uses = ["usart2"]
interrupts = {"usart2.irq" = 0b01}
priority = 3
max-sizes = {flash = 8192, ram = 4096}
max-sizes = {flash = 16384, ram = 4096}
stacksize = 2048
start = true
task-slots = ["sys"]
Expand Down Expand Up @@ -199,7 +199,7 @@ task-slots = ["sys", "user_leds"]
[tasks.update_server]
name = "stm32h7-update-server"
priority = 3
max-sizes = {flash = 8192, ram = 4096}
max-sizes = {flash = 16384, ram = 4096}
stacksize = 2048
start = true
uses = ["flash_controller", "bank2"]
Expand Down
2 changes: 1 addition & 1 deletion app/sidecar/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ task-slots = ["i2c_driver", "sensor", "sequencer"]
[tasks.validate]
name = "task-validate"
priority = 5
max-sizes = {flash = 8192, ram = 4096 }
max-sizes = {flash = 16384, ram = 4096 }
stacksize = 1000
start = true
task-slots = ["i2c_driver"]
Expand Down
13 changes: 6 additions & 7 deletions build/xtask/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,14 @@ impl BuildConfig<'_> {
None => PathBuf::from("cargo"),
});

// nightly features that we use: asm_sym,named-profiles,naked_functions
// cmse_nonsecure_entry,array_methods,destructuring_assignment
// nightly features that our dependencies use: proc_macro_span,backtrace
// asm,llvm_asm
// nightly features that we use: asm_sym,asm_const,
// named-profiles,naked_functions,cmse_nonsecure_entry,array_methods
//
// nightly features that our dependencies use: backtrace,proc_macro_span

cmd.arg(
"-Zallow-features=asm,asm_sym,named-profiles,naked_functions,\
cmse_nonsecure_entry,array_methods,destructuring_assignment,proc_macro_span,\
backtrace,llvm_asm",
"-Zallow-features=asm_sym,asm_const,named-profiles,naked_functions,\
cmse_nonsecure_entry,array_methods,backtrace,proc_macro_span",
);

cmd.arg(subcommand);
Expand Down
1 change: 1 addition & 0 deletions build/xtask/src/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,7 @@ fn link(
cmd.arg("-m").arg(m);
cmd.arg("-z").arg("common-page-size=0x20");
cmd.arg("-z").arg("max-page-size=0x20");
cmd.arg("-rustc-lld-flavor=ld");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW: I don't know why I need to make this change. In theory this is supposed to be detected, but isn't now? The docs on this are effectively non-existent...

Copy link
Contributor

Choose a reason for hiding this comment

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

A brief recap about what led to needing to provide -rustc-lld-flavor:

Calling ld directly to link is a bit of a pain as you need to deal with all the platform specific logic (e.g. like where to find crt1.o) which you can avoid by invoking it via cc/gcc/clang. Up until recently, you couldn't pass the linker via an absolute path to gcc but instead had to add a search path that would have the ld binary. Hence why $SYSROOT/lib/rustlib/$HOST_TARGET/bin/gcc-ld exists. This is what happens when you pass -Zgcc-ld=lld (soon to be stabilized as -Clink-self-contained=linker -Clinker-flavor=gcc-lld) to rustc to use the bundled rust-lld.

Now, lld decides what flavour to use based on either the name of the binary invoked or via the first argument (i.e., arg[0] or arg[1]). Unfortunately, rust couldn't just ship ld and ld64 as symlinks to rust-lld so the gcc-ld folder just had multiple copies which meant some bloat.

All's fine for Hubris at this point because we just directly invoked $SYSROOT/lib/rustlib/$HOST_TARGET/bin/gcc-ld/ld and so lld operated with the ld flavour.

Around Oct last year to reduce the bloat (3 copies of rust-lld), the binaries under gcc-ld were replaced with a small tool lld-wrapper that would call ../rust-lld with the right flavor. So now the ld and ld64 under bin/gcc-ld/ were lld-wrapper compiled with different cfg flags choosing the flavour to pass to ../rust-lld. Up until this point, I'd expect hubris to still work when invoking this ld.

But this was still a pain, with the duplication and lacked some other support. So in May-ish, it was simplified to a single copy that would correctly place the flavour argument as the first one passed to rust-lld via -rustc-lld-flavor. Although, looks like this did come with some downsides that might mean further changes coming.

Looking at hubris, looks like we're manually invoking the linker here and not through cc/gcc/clang. I would say we should just call rust-lld directly instead of using whatever is in under bin/gcc-ld (really all that is an implementation detail for rustc hence the name of the flag).


cmd.current_dir(working_dir);

Expand Down
1 change: 0 additions & 1 deletion drv/lpc55-romapi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#![feature(asm)]
#![feature(naked_functions)]
#![no_std]

Expand Down
1 change: 0 additions & 1 deletion drv/sidecar-seq-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#![no_std]
#![no_main]
#![feature(destructuring_assignment)]

use crate::clock_generator::ClockGenerator;
use crate::front_io::FrontIOBoard;
Expand Down
2 changes: 1 addition & 1 deletion drv/stm32g0-usart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ num-traits = { version = "0.2.12", default-features = false }
drv-stm32xx-sys-api = {path = "../stm32xx-sys-api", default-features = false}
stm32g0 = { git = "https://github.com/oxidecomputer/stm32-rs-nightlies", branch = "stm32g0b1-initial-support", default-features = false }
cortex-m = { version = "0.7", features = ["inline-asm"] }
cortex-m-semihosting = { version = "0.3.7", features = ["inline-asm"] }
cortex-m-semihosting = { version = "0.5.0" }

[features]
g031 = ["stm32g0/stm32g031", "drv-stm32xx-sys-api/g031"]
Expand Down
1 change: 1 addition & 0 deletions drv/stm32xx-sys/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#![no_std]
#![no_main]
#![deny(unsafe_op_in_unsafe_fn)]

cfg_if::cfg_if! {
if #[cfg(feature = "family-stm32g0")] {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2021-09-22"
channel = "nightly-2022-07-27"
targets = [ "thumbv6m-none-eabi", "thumbv7em-none-eabihf", "thumbv8m.main-none-eabihf" ]
profile = "minimal"
components = [ "rustfmt" ]
7 changes: 4 additions & 3 deletions stage0/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#![feature(cmse_nonsecure_entry)]
#![feature(asm)]
#![feature(naked_functions)]
#![feature(array_methods)]
#![no_main]
#![no_std]

use core::arch;

extern crate lpc55_pac;
extern crate panic_halt;
use cortex_m::peripheral::Peripherals;
Expand Down Expand Up @@ -98,7 +99,7 @@ unsafe fn branch_to_image(image: Image) -> ! {
let stack = image.get_sp();

// and branch
asm!("
arch::asm!("
msr MSP_NS, {stack}
bxns {entry}",
stack = in(reg) stack,
Expand All @@ -125,7 +126,7 @@ unsafe fn branch_to_image(image: Image) -> ! {
let stack = image.get_sp();

// and branch
asm!("
arch::asm!("
msr MSP, {stack}
bx {entry}",
stack = in(reg) stack,
Expand Down
Loading