diff --git a/src/szl/Cargo.toml b/src/szl/Cargo.toml
index 2b541b7..459b6b1 100644
--- a/src/szl/Cargo.toml
+++ b/src/szl/Cargo.toml
@@ -13,7 +13,7 @@ default = ["target_zc706"]
 log = "0.4"
 cstr_core = { version = "0.2", default-features = false }
 libboard_zynq = { git = "https://git.m-labs.hk/M-Labs/zynq-rs.git" }
-libsupport_zynq = { git = "https://git.m-labs.hk/M-Labs/zynq-rs.git" }
+libsupport_zynq = { git = "https://git.m-labs.hk/M-Labs/zynq-rs.git", default-features = false, features = ["dummy_irq_handler"] }
 libcortex_a9 = { git = "https://git.m-labs.hk/M-Labs/zynq-rs.git" }
 
 [build-dependencies]
diff --git a/src/szl/build.rs b/src/szl/build.rs
index 2fe03fc..90e8692 100644
--- a/src/szl/build.rs
+++ b/src/szl/build.rs
@@ -32,7 +32,8 @@ pub fn compile_unlzma() {
     cfg.flag("-fPIC");
     cfg.flag("-fno-stack-protector");
     cfg.flag("--target=armv7-none-eabihf");
-    cfg.flag("-Os");
+    cfg.flag("-Oz");
+    cfg.flag("-flto=full");
 
     let sources = vec![
         "unlzma.c",
diff --git a/src/szl/src/main.rs b/src/szl/src/main.rs
index 3f2cf75..612884e 100644
--- a/src/szl/src/main.rs
+++ b/src/szl/src/main.rs
@@ -1,5 +1,6 @@
 #![no_std]
 #![no_main]
+#![feature(panic_info_message)]
 
 extern crate log;
 
@@ -15,6 +16,7 @@ use libcortex_a9::{
 use libboard_zynq::{
     self as zynq, println,
     clocks::Clocks, clocks::source::{ClockSource, ArmPll, IoPll},
+    stdio,
     logger,
     timer::GlobalTimer,
 };
@@ -28,7 +30,17 @@ extern "C" {
 }
 
 extern fn lzma_error(message: *const u8) {
-    error!("LZMA error: {}", unsafe { CStr::from_ptr(message) }.to_str().unwrap());
+    let msg = unsafe {CStr::from_ptr(message)}.to_str();
+    if let Ok(msg) = msg {
+        println!("LZMA error: {}", msg);
+    }
+}
+
+#[panic_handler]
+fn panic(_: &core::panic::PanicInfo) -> ! {
+    stdio::drop_uart();
+    println!("panicked!");
+    loop {}
 }
 
 #[no_mangle]