Supporting Backtrace crate for x86_64-fortanix-unknown-sgx. #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supporting a new target for this crate needs us to support backtrace and symbolize.
backtrace:
This is supported via a port of libunwind which is linked to x86_64-fortanix-unknown-sgx. See rust-lang/#56979 for more details
symbolize:
To reduce enclave TCB size, we do not support symbol resolution for this target. So symbol resolution would basically pass via
NOOP
implementation. For generating backtrace after a panic, in the std library, we rather, display the offset of each function, which could be resolved later. See rust-lang/#57441 for more details.This PR tries to emulate same behaviour for backtrace crate. Here we let the back trace have actual addresses, which would be consistent with the function pointers at run time. But, while displaying the back-trace structure, we convert the addresses to their corresponding offsets so that the user could easily resolve the actual symbols (say, via
addr2len
).