- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I installed the sgx release (Nov 18, 2021) on 18.04.1-Ubuntu:
1. Driver: sgx_linux_x64_driver_1.41.bin and sgx_linux_x64_driver_2.11.0_2d2b795.bin;
2. sdk: sgx_linux_x64_sdk_2.15.101.1.bin;
3. psw: related pkg;
Then, I wrote the enclave program that references the openssl library, then I compiled libsgx_tsgxssl.a with openssl-1.1.1l.tar.gz and https://github.com/intel/intel-sgx-ssl.git and libsgx_tsgxssl_crypto.a, when I link my enclave so with the following link flag, it always reports the following error:
Enclave_Link_Flags := $(Enclave_Security_Link_Flags) \
-Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles \
-L./include/ssl/lib64 -Wl,--whole-archive -lsgx_tsgxssl -lsgx_tsgxssl_crypto -lpthread -Wl,--no-whole-archive \
-L$(SGX_LIBRARY_PATH) -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-pie,-eenclave_entry \
-Wl,--export-dynamic -Wl,--defsym,__ImageBase=0 -Wl,--gc-sections
:link error:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a(pthread_atfork.oS): undefined reference to symbol '__register_atfork@@GLIBC_2.3.2'
//lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you try following these steps and try to compile/link again:
- Copy sgxsdk/include/sgx_pthread.edl to the Enclave source directory.
- In Enclave.edl, add: from "sgx_pthread.edl" import *;
- In Enclave.cpp, add: #include "pthread.h"
Sincerely,
Sahira
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
or :
not -lpthread,
but -Wl,--start-group -lsgx_tstdc -lsgx_pthread -lsgx_tcxx -lsgx_tcrypto ,
link error:
/usr/local/bin/ld: /home/data/sgx/sgxsdk/lib64/libsgx_pthread.a(pthread.o): in function `_pthread_wakeup(unsigned long) [clone .part.0]':
pthread.cpp:(.text._Z15_pthread_wakeupm.part.0+0x2d): undefined reference to `pthread_wakeup_ocall'
/usr/local/bin/ld: /home/data/sgx/sgxsdk/lib64/libsgx_pthread.a(pthread.o): in function `_pthread_wait_timeout(unsigned long, unsigned long)':
pthread.cpp:(.text._Z21_pthread_wait_timeoutmm+0x30): undefined reference to `pthread_wait_timeout_ocall'
/usr/local/bin/ld: /home/data/sgx/sgxsdk/lib64/libsgx_pthread.a(pthread.o): in function `pthread_create':
pthread.cpp:(.text.pthread_create+0x113): undefined reference to `pthread_create_ocall'
/usr/local/bin/ld: pthread.cpp:(.text.pthread_create+0x16c): undefined reference to `pthread_wait_timeout_ocall'
/usr/local/bin/ld: /home/data/sgx/sgxsdk/lib64/libsgx_pthread.a(pthread.o): in function `pthread_join':
pthread.cpp:(.text.pthread_join+0xe0): undefined reference to `pthread_wait_timeout_ocall'
collect2: error: ld returned 1 exit status
sgx_t.mk:172: recipe for target 'libenclave_factory.so' failed
make[1]: *** [libenclave_factory.so] Error 1
make[1]: Leaving directory '/home/phf/phf_dell/vault/code/exchange-order-service/sgx'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you try following these steps and try to compile/link again:
- Copy sgxsdk/include/sgx_pthread.edl to the Enclave source directory.
- In Enclave.edl, add: from "sgx_pthread.edl" import *;
- In Enclave.cpp, add: #include "pthread.h"
Sincerely,
Sahira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel is no longer monitoring this thread. If you want a response from Intel in a follow-up question, please open a new thread.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page