apache / apache/teaclave-sgx-sdk

Use simulation mode on MacOS

Open
#318 13 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.2k
Forks
268
PR merge metrics
No merged PRs in 30d

Description

**Specs: MacBook Pro (16-inch, 2019), 2.3 GHz 8-Core Intel Core i9**

When following the instructions outlined [here](https://github.com/apache/incubator-teaclave-sgx-sdk#use-simulation-mode-for-non-sgx-enabled-machine-includes-macos).

I get the following error:

```
./lib/libenclave.a(sgx_trts-e1de7fe3db2688ea.sgx_trts.c1x8g4sc-cgu.2.rcgu.o): In function `sgx_trts::enclave::SgxGlobalData::new::hd171d7330c2c7ee0':
sgx_trts.c1x8g4sc-cgu.2:(.text._ZN8sgx_trts7enclave13SgxGlobalData3new17hd171d7330c2c7ee0E+0xa5): undefined reference to `get_rsrv_base'
sgx_trts.c1x8g4sc-cgu.2:(.text._ZN8sgx_trts7enclave13SgxGlobalData3new17hd171d7330c2c7ee0E+0xb2): undefined reference to `get_rsrv_size'
collect2: error: ld returned 1 exit status
Makefile:155: recipe for target 'enclave/enclave.so' failed
make: *** [enclave/enclave.so] Error 1
```

Steps to reproduce:
```
1. docker pull baiduxlab/sgx-rust-stable
2. docker run -v /Users//code/incubator-teaclave-sgx-sdk:/root/sgx -ti baiduxlab/sgx-rust-stable
3. cd sgx/samplecode/helloworld/
4. Edited the Makefile to run in SW mode
5. make && cd bin
6. ./app
```

I've seen some closed issues in this repo that report _similar_ errors, but none fix this exact issue.

**Side Notes:**
- Do I need to have the [linux-sgx](https://github.com/intel/linux-sgx) sdk installed on my Macbook? (The docker container includes all necessary libraries right?)
- I have tried the latest build too and that's gave the same error, `baiduxlab/sgx-rust`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the simulation-mode instructions and the samplecode/helloworld/Makefile inside the provided Docker image. Reproduce the linker failure and trace the enclave build that links libenclave.a, focusing on the missing get_rsrv_base and get_rsrv_size symbols. Done means make completes and ./app runs in simulation mode on the reported macOS setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, macos, rust
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.