You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@teaclave.apache.org by Felix Müller <no...@github.com.INVALID> on 2021/06/01 12:01:18 UTC

[apache/incubator-teaclave-sgx-sdk] Linker error: missing `u_pipe2_ocall` symbol when using `mio-sgx` inside the enclave (#342)

We're running into a linker error problem when we try to incorporate the [mio-sgx](https://github.com/mesalock-linux/mio-sgx) library into our enclave. It seems like the `u_pipe2_ocall` symbol is missing, which, if I looked that up correctly, is provided by the [sgx_ustdc](https://github.com/apache/incubator-teaclave-sgx-sdk/blob/ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb/sgx_ustdc/pipe.c#L33) library?

However, in the [mio samplecode](https://github.com/apache/incubator-teaclave-sgx-sdk/tree/master/samplecode/mio/server) I cannot find any reference to `sgx_ustdc`, neither in the Makefile (where I'd expect it, since it's a C-Library?) nor in any Cargo.toml. So I don't quite understand what's going on and how the symbols of that library find their way into `sgx_libc`. Any help is appreciated 😄 


The error reported by the compiler:
```
/usr/local/bin/ld: ./lib/libenclave.a(sgx_libc-fe3717fe13cfb6f5.sgx_libc.2dl1tomz-cgu.6.rcgu.o): in function `sgx_libc::linux::x86_64::ocall::pipe2':
sgx_libc.2dl1tomz-cgu.6:(.text._ZN8sgx_libc5linux6x86_645ocall5pipe217hc10c647a6c5db8d3E+0x26): undefined reference to `u_pipe2_ocall'
collect2: error: ld returned 1 exit status
Makefile:190: recipe for target 'enclave/enclave.so' failed
```

SGX dependency section of the enclave `cargo.toml`:
```
[target.'cfg(not(target_env = "sgx"))'.dependencies]
sgx_tse       = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
sgx_tstd      = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", features = ["untrusted_fs","net","backtrace"] }
sgx_rand      = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
sgx_trts      = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
sgx_types     = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
sgx_tseal     = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
sgx_tcrypto   = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
sgx_serialize = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
sgx_tunittest = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
```

Further down, we add the `mio` dependency:
```
[dependencies.mio]
git      = "https://github.com/mesalock-linux/mio-sgx"
rev   = "sgx_1.1.3"
```



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/342

Re: [apache/incubator-teaclave-sgx-sdk] Linker error: missing `u_pipe2_ocall` symbol when using `mio-sgx` inside the enclave (#342)

Posted by Felix Müller <no...@github.com.INVALID>.
Okay I think I found the problem. The `Enclave.edl` was missing the imports from `sgx_pipe`:

In `Enclave.edl`
```
from "sgx_pipe.edl" import *;
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/342#issuecomment-852086006

Re: [apache/incubator-teaclave-sgx-sdk] Linker error: missing `u_pipe2_ocall` symbol when using `mio-sgx` inside the enclave (#342)

Posted by Felix Müller <no...@github.com.INVALID>.
Closed #342.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/342#event-4825083027