Skip to content
Permalink
Browse files

Switch back to building as a binary.

  • Loading branch information...
cbiffle committed Sep 17, 2016
1 parent 619b2e6 commit a8bd19ce13b7215c95db036b99b5a72d24e88bd3
Showing with 11 additions and 31 deletions.
  1. +0 −1 .gitignore
  2. +0 −3 Cargo.toml
  3. +0 −26 Makefile
  4. +4 −0 notes/20160916-entry.mkdn
  5. +7 −1 src/{emb1.rs → main.rs}
@@ -2,4 +2,3 @@ target
.vagrant/
.swp
.*.swp
build/
@@ -6,9 +6,6 @@ authors = ["cbiffle <code@cliffle.com>"]
[dependencies]
rust-libcore = "*"

[lib]
crate-type = ["staticlib"]

[profile.dev]
panic = "abort"

This file was deleted.

Oops, something went wrong.
@@ -56,6 +56,10 @@ complain.
Disabling the `staticlib` crate type doesn't seem to matter. The crate type
being passed on the commandline is probably winning.

Okay, yes. This project is actually building as a binary, and the apparent
crate type declaration is ignored. The actual trick being used here is the fake
start item.


`#[no_mangle]` appears to affect external symbol visibility in staticlibs. If I
remove it from `ISR_VECTORS` the symbol is no longer visible in the object file
@@ -1,5 +1,5 @@
#![no_std]
#![feature(lang_items)]
#![feature(lang_items,start)]

extern {
/// This symbol is exported by the linker script, and defines the initial
@@ -73,3 +73,9 @@ extern fn panic_fmt() -> ! {loop {}}
#[no_mangle]
pub extern "C" fn abort() -> ! { loop {} }

/// This is included to mollify the compiler, but is not actually used and
/// doesn't wind up getting linked into the output.
#[start]
fn _start(_: isize, _: *const *const u8) -> isize {
unsafe { (ISR_VECTORS.reset)() }
}

0 comments on commit a8bd19c

Please sign in to comment.
You can’t perform that action at this time.