From 4d288ac1fe708634295b272d9a7e5eb12d7b702a Mon Sep 17 00:00:00 2001 From: Rahix Date: Fri, 28 Jan 2022 23:53:26 +0100 Subject: [PATCH] examples: Fix build-std settings for compiler-builtins This is a workaround to ensure intrinsics get linked in from avr-libc instead of Rust's compiler-builtins. The problem is that the versions from compiler-builtins have slightly different calling convention and as such cannot actually be substituted for the versions from avr-libc right now. This should fix a lot of the observed problems with 32-bit arithmetic. Ref: https://github.com/rust-lang/rust/issues/82242#issuecomment-997400373 --- examples/arduino-diecimila/.cargo/config.toml | 1 + examples/arduino-leonardo/.cargo/config.toml | 1 + examples/arduino-mega2560/.cargo/config.toml | 1 + examples/arduino-nano/.cargo/config.toml | 1 + examples/arduino-uno/.cargo/config.toml | 1 + examples/nano168/.cargo/config.toml | 1 + examples/sparkfun-promicro/.cargo/config.toml | 1 + examples/trinket-pro/.cargo/config.toml | 1 + examples/trinket/.cargo/config.toml | 1 + 9 files changed, 9 insertions(+) diff --git a/examples/arduino-diecimila/.cargo/config.toml b/examples/arduino-diecimila/.cargo/config.toml index 1b37bfb826..d9b3b46375 100644 --- a/examples/arduino-diecimila/.cargo/config.toml +++ b/examples/arduino-diecimila/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "ravedude diecimila" [unstable] build-std = ["core"] +build-std-features = ["compiler-builtins-mangled-names"] diff --git a/examples/arduino-leonardo/.cargo/config.toml b/examples/arduino-leonardo/.cargo/config.toml index e11a01e9e3..4f8c12962a 100644 --- a/examples/arduino-leonardo/.cargo/config.toml +++ b/examples/arduino-leonardo/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "ravedude leonardo" [unstable] build-std = ["core"] +build-std-features = ["compiler-builtins-mangled-names"] diff --git a/examples/arduino-mega2560/.cargo/config.toml b/examples/arduino-mega2560/.cargo/config.toml index b5ee8592cf..e147a0a17b 100644 --- a/examples/arduino-mega2560/.cargo/config.toml +++ b/examples/arduino-mega2560/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "ravedude -cb 57600 mega2560" [unstable] build-std = ["core"] +build-std-features = ["compiler-builtins-mangled-names"] diff --git a/examples/arduino-nano/.cargo/config.toml b/examples/arduino-nano/.cargo/config.toml index 244bf7ba63..d675cf5271 100644 --- a/examples/arduino-nano/.cargo/config.toml +++ b/examples/arduino-nano/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "ravedude nano -cb 57600" [unstable] build-std = ["core"] +build-std-features = ["compiler-builtins-mangled-names"] diff --git a/examples/arduino-uno/.cargo/config.toml b/examples/arduino-uno/.cargo/config.toml index e7a5f7c442..b6500e6df6 100644 --- a/examples/arduino-uno/.cargo/config.toml +++ b/examples/arduino-uno/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "ravedude uno -cb 57600" [unstable] build-std = ["core"] +build-std-features = ["compiler-builtins-mangled-names"] diff --git a/examples/nano168/.cargo/config.toml b/examples/nano168/.cargo/config.toml index f7452fb156..78da1e1b7d 100644 --- a/examples/nano168/.cargo/config.toml +++ b/examples/nano168/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "ravedude nano168 -cb 57600" [unstable] build-std = ["core"] +build-std-features = ["compiler-builtins-mangled-names"] diff --git a/examples/sparkfun-promicro/.cargo/config.toml b/examples/sparkfun-promicro/.cargo/config.toml index 4c5d2b5453..fc90c42e62 100644 --- a/examples/sparkfun-promicro/.cargo/config.toml +++ b/examples/sparkfun-promicro/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "ravedude promicro" [unstable] build-std = ["core"] +build-std-features = ["compiler-builtins-mangled-names"] diff --git a/examples/trinket-pro/.cargo/config.toml b/examples/trinket-pro/.cargo/config.toml index 75e8e82883..9660d5e3a0 100644 --- a/examples/trinket-pro/.cargo/config.toml +++ b/examples/trinket-pro/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "ravedude trinket-pro" [unstable] build-std = ["core"] +build-std-features = ["compiler-builtins-mangled-names"] diff --git a/examples/trinket/.cargo/config.toml b/examples/trinket/.cargo/config.toml index 49af361612..36a2a19664 100644 --- a/examples/trinket/.cargo/config.toml +++ b/examples/trinket/.cargo/config.toml @@ -6,3 +6,4 @@ runner = "ravedude trinket" [unstable] build-std = ["core"] +build-std-features = ["compiler-builtins-mangled-names"]