diff --git a/Makefile b/Makefile index 82faf4c7a0..5318d8deea 100755 --- a/Makefile +++ b/Makefile @@ -60,11 +60,9 @@ endif endif ifeq ($(SGX_DEBUG), 1) - # we build with cargo --release, even in SGX DEBUG mode SGX_COMMON_CFLAGS += -O0 -g -ggdb - # cargo sets this automatically, cannot use 'debug' - OUTPUT_PATH := release - CARGO_TARGET := --release + OUTPUT_PATH := debug + CARGO_TARGET := else SGX_COMMON_CFLAGS += -O2 OUTPUT_PATH := release diff --git a/enclave-runtime/Makefile b/enclave-runtime/Makefile index ef4a7bb4ca..b4dc322eed 100644 --- a/enclave-runtime/Makefile +++ b/enclave-runtime/Makefile @@ -35,8 +35,8 @@ Rust_Enclave_Files := $(wildcard src/*.rs) $(wildcard ../stf/src/*.rs) RUSTFLAGS :="-C target-feature=+avx2" ifeq ($(SGX_DEBUG), 1) - OUTPUT_PATH := release - CARGO_TARGET := --release + OUTPUT_PATH := debug + CARGO_TARGET := else OUTPUT_PATH := release CARGO_TARGET := --release diff --git a/enclave-runtime/src/lib.rs b/enclave-runtime/src/lib.rs index 394464f987..4fb612c2aa 100644 --- a/enclave-runtime/src/lib.rs +++ b/enclave-runtime/src/lib.rs @@ -402,3 +402,17 @@ fn internal_trigger_parentchain_block_import() -> Result<()> { triggered_import_dispatcher.import_all()?; Ok(()) } + +// This is required, because `ring` / `ring-xous` would not compile without it non-release (debug) mode. +// See #1200 for more details. +#[cfg(debug_assertions)] +#[no_mangle] +pub extern "C" fn __assert_fail( + __assertion: *const u8, + __file: *const u8, + __line: u32, + __function: *const u8, +) -> ! { + use core::intrinsics::abort; + abort() +} diff --git a/service/src/cli.yml b/service/src/cli.yml index 0af54bb323..0b3f398fe4 100644 --- a/service/src/cli.yml +++ b/service/src/cli.yml @@ -90,7 +90,6 @@ subcommands: args: - skip-ra: long: skip-ra - short: s help: skip remote attestation. Set this flag if running enclave in SW mode - shard: required: false @@ -115,12 +114,10 @@ subcommands: args: - shard: long: shard - short: s required: false help: shard identifier base58 encoded. Defines the state that this worker shall operate on. Default is mrenclave - skip-ra: long: skip-ra - short: s help: skip remote attestation. Set this flag if running enclave in SW mode - shielding-key: about: Get the public RSA3072 key from the TEE to be used to encrypt requests