Skip to content

Commit 4727410

Browse files
committed
Update to nightly 2016-10-14, use new compiler builtins
Rust has changed some stuff regarding the core crate and compiler intrinsics (e.g. float to int conversion). Crates do not need to link to libcore anymore, but need to link against compiler_builtins. This changes fixes the appearance of recursive intrinsics that happend with larger arrays https://users.rust-lang.org/t/compiler-generates-recursive-memclr/7575/3 rust-lang/rust#31544
1 parent 4c9f247 commit 4727410

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+92
-277
lines changed

.cargo/config

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
[target.thumbv6m-none-eabi]
22
linker = "arm-none-eabi-gcc"
33
ar = "arm-none-eabi-ar"
4+
rustflags = [
5+
"-C",
6+
"link-arg=-Tlayout.ld",
7+
]
48

59
[target.thumbv7m-none-eabi]
610
linker = "arm-none-eabi-gcc"
711
ar = "arm-none-eabi-ar"
12+
rustflags = [
13+
"-C",
14+
"link-arg=-Tlayout.ld",
15+
]
816

917
[target.thumbv7em-none-eabi]
1018
linker = "arm-none-eabi-gcc"
1119
ar = "arm-none-eabi-ar"
20+
rustflags = [
21+
"-C",
22+
"link-arg=-Tlayout.ld",
23+
]
24+

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
language: rust
2-
rust: nightly-2016-09-17
2+
rust: nightly-2016-10-14
33
before_install:
44
- sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
55
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 6D1D8367A3421AFB
66
- sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/terry_guo-gcc-arm-embedded-precise.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
77
- sudo apt-get install gcc-arm-none-eabi libcurl4-openssl-dev libelf-dev libdw-dev
88
- wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xzf master.tar.gz
99
- (mkdir kcov-master/build && cd kcov-master/build && cmake .. && make && make install DESTDIR=../tmp)
10+
before_script:
11+
- cargo install xargo
1012
script:
1113
- ./support/build-jenkins.sh
1214
env:

Cargo.toml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,23 @@ multitasking = ["cpu_cortex-m4"]
2828

2929
loglib = ["log"]
3030

31-
[target.thumbv6m-none-eabi.dependencies]
32-
rust-libcore = "*"
33-
34-
[target.thumbv7m-none-eabi.dependencies]
35-
rust-libcore = "*"
36-
37-
[target.thumbv7em-none-eabi.dependencies]
38-
rust-libcore = "*"
39-
4031
[dependencies.ioreg]
4132
path = "./ioreg"
4233

4334
[dependencies.volatile_cell]
4435
path = "./volatile_cell"
4536

46-
[dependencies.rlibc]
47-
git = "https://github.com/hackndev/rlibc"
48-
branch = "zinc"
37+
38+
[dependencies]
39+
rlibc = "1.0"
40+
41+
[dependencies.compiler_builtins]
42+
git = "https://github.com/Phaiax/compiler-builtins"
43+
branch = "gccdeptogit"
44+
features = ["c"]
4945

5046
[dependencies.log]
51-
git = "https://github.com/archaelus/log"
52-
branch = "zinc"
47+
version = "*"
5348
default-features = false
5449
optional = true
5550

README.md

Lines changed: 23 additions & 15 deletions

examples/adc_lpc17xx/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_platformtree = { path = "../../macro_platformtree" }
12-
rust-libcore = "*"

examples/adc_lpc17xx/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/blink_k20/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_k20 = ["zinc/mcu_k20"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_zinc = { path = "../../macro_zinc" }
12-
rust-libcore = "*"

examples/blink_k20/thumbv7em-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/blink_k20_isr/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ mcu_k20 = ["zinc/mcu_k20"]
88

99
[dependencies]
1010
zinc = { path = "../.." }
11-
rust-libcore = "*"

examples/blink_k20_isr/thumbv7em-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/blink_lpc17xx/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_zinc = { path = "../../macro_zinc" }
12-
rust-libcore = "*"

examples/blink_lpc17xx/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/blink_pt/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_platformtree = { path = "../../macro_platformtree" }
12-
rust-libcore = "*"

examples/blink_pt/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/blink_stm32f1/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_stm32f1 = ["zinc/mcu_stm32f1"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_zinc = { path = "../../macro_zinc" }
12-
rust-libcore = "*"

examples/blink_stm32f4/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_stm32f4 = ["zinc/mcu_stm32f4"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_zinc = { path = "../../macro_zinc" }
12-
rust-libcore = "*"

examples/blink_stm32f4/thumbv7em-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/blink_stm32f7/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_stm32f7 = ["zinc/mcu_stm32f7"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_zinc = { path = "../../macro_zinc" }
12-
rust-libcore = "*"

examples/blink_stm32f7/thumbv7em-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/blink_stm32l1/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_stm32l1 = ["zinc/mcu_stm32l1"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_zinc = { path = "../../macro_zinc" }
12-
rust-libcore = "*"

examples/blink_stm32l1/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/blink_tiva_c/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_tiva_c = ["zinc/mcu_tiva_c"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_platformtree = { path = "../../macro_platformtree" }
12-
rust-libcore = "*"

examples/blink_tiva_c/thumbv7em-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/bluenrg_stm32l1/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ mcu_stm32l1 = ["zinc/mcu_stm32l1"]
88

99
[dependencies]
1010
zinc = { path = "../.." }
11-
rust-libcore = "*"

examples/bluenrg_stm32l1/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/dht22/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_platformtree = { path = "../../macro_platformtree" }
12-
rust-libcore = "*"

examples/dht22/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/empty/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ version = "0.0.1"
55
[features]
66
mcu_lpc11xx = ["zinc/mcu_lpc11xx"]
77
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
8+
mcu_stm32f1 = ["zinc/mcu_stm32f1"]
89
mcu_stm32f4 = ["zinc/mcu_stm32f4"]
910
mcu_stm32l1 = ["zinc/mcu_stm32l1"]
1011
mcu_k20 = ["zinc/mcu_k20"]
@@ -13,4 +14,3 @@ mcu_tiva_c = ["zinc/mcu_tiva_c"]
1314
[dependencies]
1415
zinc = { path = "../.." }
1516
macro_zinc = { path = "../../macro_zinc" }
16-
rust-libcore = "*"

examples/empty/thumbv6m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/empty/thumbv7em-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/empty/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/lcd_tiva_c/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_tiva_c = ["zinc/mcu_tiva_c"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_platformtree = { path = "../../macro_platformtree" }
12-
rust-libcore = "*"

examples/rgb_pwm_lpc17xx/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
1010
zinc = { path = "../.." }
1111
macro_zinc = { path = "../../macro_zinc" }
1212
macro_platformtree = { path = "../../macro_platformtree" }
13-
rust-libcore = "*"
1413

1514
[[bin]]
1615
name = "rgb_pwm_lpc17xx"

examples/rgb_pwm_lpc17xx/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/uart/.cargo/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
[build]
22
target = "thumbv7m-none-eabi"
3+
linker = "arm-none-eabi-gcc"
4+
ar = "arm-none-eabi-ar"

examples/uart/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_platformtree = { path = "../../macro_platformtree" }
12-
rust-libcore = "*"

examples/uart/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/uart_tiva_c/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_tiva_c = ["zinc/mcu_tiva_c"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_platformtree = { path = "../../macro_platformtree" }
12-
rust-libcore = "*"

examples/uart_tiva_c/thumbv7em-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/usart_stm32f1/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_stm32f1 = ["zinc/mcu_stm32f1"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_zinc = { path = "../../macro_zinc" }
12-
rust-libcore = "*"

examples/usart_stm32l1/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ mcu_stm32l1 = ["zinc/mcu_stm32l1"]
99
[dependencies]
1010
zinc = { path = "../.." }
1111
macro_zinc = { path = "../../macro_zinc" }
12-
rust-libcore = "*"

examples/usart_stm32l1/thumbv7m-none-eabi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

ioreg/src/builder/union.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn reg_struct_type(cx: &ExtCtxt, path: &Vec<String>, reg: &node::Reg)
9898
1 => base_ty,
9999
n =>
100100
cx.ty(reg.count.span,
101-
ast::TyKind::FixedLengthVec(base_ty, expr_usize(cx, respan(reg.count.span, n as u64)))),
101+
ast::TyKind::Array(base_ty, expr_usize(cx, respan(reg.count.span, n as u64)))),
102102
}
103103
}
104104

@@ -146,7 +146,7 @@ impl<'a, 'b> BuildUnionTypes<'a, 'b> {
146146
let ty: P<ast::Ty> =
147147
self.cx.ty(
148148
DUMMY_SP,
149-
ast::TyKind::FixedLengthVec(u8_ty, expr_usize(self.cx, respan(DUMMY_SP, length))));
149+
ast::TyKind::Array(u8_ty, expr_usize(self.cx, respan(DUMMY_SP, length))));
150150
ast::StructField {
151151
span: DUMMY_SP,
152152
ident: Some(self.cx.ident_of(format!("_pad{}", index).as_str())),

macro_platformtree/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ fn macro_zinc_task_item(cx: &mut ExtCtxt, it: P<ast::Item>) -> P<ast::Item> {
8686
cx.typaram(
8787
DUMMY_SP,
8888
cx.ident_of(ty.to_tyhash().as_str()),
89+
vec![],
8990
P::from_vec(vec!(cx.typarambound(
9091
cx.path(DUMMY_SP, ty.as_str().split("::").map(|t| cx.ident_of(t)).collect())))),
9192
None)

platformtree/src/builder/meta_args.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ use syntax::codemap::DUMMY_SP;
1818
use syntax::ext::base::ExtCtxt;
1919
use syntax::ext::build::AstBuilder;
2020
use syntax::parse::token::{InternedString, intern_and_get_ident};
21-
use std::hash::{Hash, Hasher, SipHasher};
21+
use std::hash::{Hash, Hasher};
22+
use std::collections::hash_map::DefaultHasher;
2223

2324
static TAG: &'static str = "__zinc_task_ty_params";
2425

@@ -28,7 +29,7 @@ pub trait ToTyHash {
2829

2930
impl ToTyHash for String {
3031
fn to_tyhash(&self) -> String {
31-
let mut s = SipHasher::new();
32+
let mut s = DefaultHasher::new();
3233
self.hash(&mut s);
3334
let h: u64 = s.finish();
3435
format!("Ty{:X}", h)

platformtree/src/builder/os.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ fn build_args(builder: &mut Builder, cx: &mut ExtCtxt,
157157
let typaram = cx.typaram(
158158
DUMMY_SP,
159159
cx.ident_of(ty.to_tyhash().as_str()),
160+
vec![],
160161
P::from_vec(vec!(
161162
ast::RegionTyParamBound(cx.lifetime(DUMMY_SP, intern("'a")))
162163
)),
@@ -173,7 +174,7 @@ fn build_args(builder: &mut Builder, cx: &mut ExtCtxt,
173174
node: ast::ItemKind::Struct(
174175
ast::VariantData::Struct(fields, ast::DUMMY_NODE_ID),
175176
ast::Generics {
176-
lifetimes: vec!(cx.lifetime_def(DUMMY_SP, intern("'a"), vec!())),
177+
lifetimes: vec!(cx.lifetime_def(DUMMY_SP, intern("'a"), vec![], vec!())),
177178
ty_params: P::from_vec(collected_params),
178179
where_clause: ast::WhereClause {
179180
id: ast::DUMMY_NODE_ID,

0 commit comments

Comments
 (0)