satman: satisfied libunwind's demands, compiles

This commit is contained in:
mwojcik 2021-09-01 15:05:08 +02:00
parent 1ad0e77cae
commit 67f4ec5782
3 changed files with 32 additions and 4 deletions

View File

@ -36,12 +36,14 @@ let
make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ${if variant == "satellite" then "satman" else "runtime"} make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ${if variant == "satellite" then "satman" else "runtime"}
''; '';
# there's probably a better way to go around it
installPhase = '' installPhase = ''
mkdir -p $out $out/nix-support mkdir -p $out $out/nix-support
cp ../build/runtime.bin $out/runtime.bin export FWTYPE=${if variant == "satellite" then "satman" else "runtime"}
cp ../build/firmware/armv7-none-eabihf/release/runtime $out/runtime.elf cp ../build/$FWTYPE.bin $out/$FWTYPE.bin
echo file binary-dist $out/runtime.bin >> $out/nix-support/hydra-build-products cp ../build/firmware/armv7-none-eabihf/release/$FWTYPE $out/$FWTYPE.elf
echo file binary-dist $out/runtime.elf >> $out/nix-support/hydra-build-products echo file binary-dist $out/$FWTYPE.bin >> $out/nix-support/hydra-build-products
echo file binary-dist $out/$FWTYPE.elf >> $out/nix-support/hydra-build-products
''; '';
doCheck = false; doCheck = false;

View File

@ -25,3 +25,4 @@ libconfig = { git = "https://git.m-labs.hk/M-Labs/zynq-rs.git", features = ["ipv
libboard_artiq = { path = "../libboard_artiq" } libboard_artiq = { path = "../libboard_artiq" }
unwind = { path = "../libunwind" } unwind = { path = "../libunwind" }
libc = { path = "../libc" }

View File

@ -626,3 +626,28 @@ pub fn panic_fmt(info: &core::panic::PanicInfo) -> ! {
loop {} loop {}
} }
// linker symbols
extern "C" {
static __text_start: u32;
static __text_end: u32;
static __exidx_start: u32;
static __exidx_end: u32;
}
/// Called by llvm_libunwind
#[no_mangle]
extern fn dl_unwind_find_exidx(pc: *const u32, len_ptr: *mut u32) -> *const u32 {
let length;
let start: *const u32;
unsafe {
// lifted off runtime kernel/core1.rs
// and removed kernel image from there
// hope it works!
length = (&__exidx_end as *const u32).offset_from(&__exidx_start) as u32;
start = &__exidx_start;
*len_ptr = length;
}
start
}