Browse Source

Produce a compilation error if riscv-rt appears more than once in the dependency graph

Vadim Kaushan 6 years ago
parent
commit
8163823a83
1 changed files with 4 additions and 0 deletions
  1. 4 0
      riscv-rt/src/lib.rs

+ 4 - 0
riscv-rt/src/lib.rs

@@ -210,6 +210,10 @@ pub use macros::{entry, pre_init};
 
 use riscv::register::{mstatus, mtvec};
 
+#[export_name = "error: riscv-rt appears more than once in the dependency graph"]
+#[doc(hidden)]
+pub static __ONCE__: () = ();
+
 extern "C" {
     // Boundaries of the .bss section
     static mut _ebss: u32;