Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

Commit 0d67094

Browse files
committed
Merge pull request #43 from farcaller/fix-missing-lang-items
A hack to make the code compile again
2 parents a11f1c1 + acf550e commit 0d67094

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

src/hal/isr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ extern crate core;
2727

2828
#[cfg(mcu_lpc17xx)]
2929
#[path="lpc17xx/isr.rs"] pub mod isr_lpc17xx;
30+
31+
#[path="../lib/lang_items.rs"] mod lang_items;

src/lib/lang_items.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Zinc, the bare metal stack for rust.
2+
// Copyright 2014 Vladimir "farcaller" Pouzanov <farcaller@gmail.com>
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
#[lang="stack_exhausted"]
17+
#[no_split_stack]
18+
extern fn stack_exhausted() {}
19+
#[lang="eh_personality"]
20+
#[no_split_stack]
21+
extern fn eh_personality() {}
22+
#[lang="begin_unwind"]
23+
#[no_split_stack]
24+
extern fn begin_unwind() {}

src/lib/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ pub mod strconv;
1919
pub mod volatile_cell;
2020
pub mod shared;
2121
pub mod queue;
22+
23+
mod lang_items;

support/rake.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ def compile_rust(n, h)
8181
"#{do_lto ? '-Z lto' : ''} #{crate_type} #{emit} " +
8282
"#{search_paths} #{codegen} " +
8383
"#{outflags} #{ignore_warnings} #{rust_src}"
84+
if File.extname(t.name) == '.o'
85+
sh "#{:strip.in_toolchain} -N rust_stack_exhausted -N rust_begin_unwind " +
86+
"-N rust_eh_personality #{t.name}"
87+
end
8488
end
8589
end
8690

0 commit comments

Comments
 (0)