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

A hack to make the code compile again #43

Merged
merged 2 commits into from
May 31, 2014
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
2 changes: 2 additions & 0 deletions src/hal/isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ extern crate core;

#[cfg(mcu_lpc17xx)]
#[path="lpc17xx/isr.rs"] pub mod isr_lpc17xx;

#[path="../lib/lang_items.rs"] mod lang_items;
24 changes: 24 additions & 0 deletions src/lib/lang_items.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Zinc, the bare metal stack for rust.
// Copyright 2014 Vladimir "farcaller" Pouzanov <farcaller@gmail.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#[lang="stack_exhausted"]
#[no_split_stack]
extern fn stack_exhausted() {}
#[lang="eh_personality"]
#[no_split_stack]
extern fn eh_personality() {}
#[lang="begin_unwind"]
#[no_split_stack]
extern fn begin_unwind() {}
2 changes: 2 additions & 0 deletions src/lib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ pub mod strconv;
pub mod volatile_cell;
pub mod shared;
pub mod queue;

mod lang_items;
4 changes: 4 additions & 0 deletions support/rake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def compile_rust(n, h)
"#{do_lto ? '-Z lto' : ''} #{crate_type} #{emit} " +
"#{search_paths} #{codegen} " +
"#{outflags} #{ignore_warnings} #{rust_src}"
if File.extname(t.name) == '.o'
sh "#{:strip.in_toolchain} -N rust_stack_exhausted -N rust_begin_unwind " +
"-N rust_eh_personality #{t.name}"
end
end
end

Expand Down