Skip to content

drop the msp430.sh shim #1

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

Merged
merged 1 commit into from
Dec 30, 2016
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
11 changes: 3 additions & 8 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
[target.msp430]
rustflags = [
"-C",
"linker=./msp-gcc.sh",
"-C",
"link-arg=-Lldscripts",
"-C",
"link-arg=-Tmsp430g2553.ld",
"-C",
"link-arg=-nostartfiles",
"-C", "link-arg=-Tmsp430g2553.ld",
"-C", "link-arg=-mmcu=msp430g2553",
"-C", "link-arg=-nostartfiles",
]
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
build = "build.rs"
name = "msp"
version = "0.1.0"
authors = ["Vadzim Dambrouski <pftbest@gmail.com>"]
Expand Down
21 changes: 21 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;

fn main() {
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
File::create(out.join("msp430g2553.ld"))
.unwrap()
.write_all(include_bytes!("ldscripts/msp430g2553.ld"))
.unwrap();
File::create(out.join("msp430g2553_symbols.ld"))
.unwrap()
.write_all(include_bytes!("ldscripts/msp430g2553_symbols.ld"))
.unwrap();
println!("cargo:rustc-link-search={}", out.display());

println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=ldscripts/msp430g2553.ld");
println!("cargo:rerun-if-changed=ldscripts/msp430g2553_symbols.ld");
}
2 changes: 0 additions & 2 deletions msp-gcc.sh

This file was deleted.

2 changes: 2 additions & 0 deletions msp430.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"arch": "msp430",
"asm-args": ["-mcpu=msp430"],
"data-layout": "e-m:e-p:16:16-i32:16:32-a:16-n8:16",
"executables": true,
"linker": "msp430-elf-gcc",
"llvm-target": "msp430",
"max-atomic-width": 0,
"no-integrated-as": true,
Expand Down