Azure-Samples / microsoft-azure-attestation

Microsoft Azure Attestation is a solution for attesting Trusted Execution Environments (TEEs)
MIT License
30 stars 17 forks source link

Build failing for Sample Code for Open Enclave SDK #7

Closed ssahai closed 3 years ago

ssahai commented 3 years ago

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Getting linker error while building sgx.attest.sample.

Minimal steps to reproduce

On executing:

cd sgx.attest.sample/genquotes
make build

Getting a linker error, in the last command for make build i.e. this line of the Makefile.

OS and Version?

Trying to build this on an ACC Ubuntu 18.04 VM, with Open Enclave 0.14.0, installed using sudo apt install open-enclave.

Detailed Output

The output of make build command:

Compilers used: clang-8, clang++-8
LDFLAGS: -L/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave -nostdlib -nodefaultlibs -nostartfiles -Wl,--no-undefined -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--export-dynamic -Wl,-pie -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,now -Wl,-gc-sections -loeenclave -loelibcxx -loelibc -loesyscall -loecore
INCDIR: /opt/openenclave/share/pkgconfig/../../include
CXXFLAGS: -nostdinc -m64 -fPIE -ftls-model=local-exec -fvisibility=hidden -fstack-protector-strong -fno-omit-frame-pointer -ffunction-sections -fdata-sections -mllvm -x86-speculative-load-hardening -I/opt/openenclave/share/pkgconfig/../../include/openenclave/3rdparty/libcxx -I/opt/openenclave/share/pkgconfig/../../include/openenclave/3rdparty/libc -I/opt/openenclave/share/pkgconfig/../../include/openenclave/3rdparty -I/opt/openenclave/share/pkgconfig/../../include
oeedger8r ../remoteattestation.edl --trusted --trusted-dir ../common --search-path /opt/openenclave/share/pkgconfig/../../include --search-path /opt/openenclave/share/pkgconfig/../../include/openenclave/edl/sgx
Generating edge routine, for the Open Enclave SDK.
Processing ../remoteattestation.edl.
Processing /opt/openenclave/share/pkgconfig/../../include/openenclave/edl/sgx/platform.edl.
Processing /opt/openenclave/share/pkgconfig/../../include/openenclave/edl/sgx/attestation.edl.
Processing /opt/openenclave/share/pkgconfig/../../include/openenclave/edl/sgx/cpu.edl.
Processing /opt/openenclave/share/pkgconfig/../../include/openenclave/edl/sgx/debug.edl.
Processing /opt/openenclave/share/pkgconfig/../../include/openenclave/edl/sgx/thread.edl.
Processing /opt/openenclave/share/pkgconfig/../../include/openenclave/edl/sgx/switchless.edl.
Success.
clang++-8 -g -c -nostdinc -m64 -fPIE -ftls-model=local-exec -fvisibility=hidden -fstack-protector-strong -fno-omit-frame-pointer -ffunction-sections -fdata-sections -mllvm -x86-speculative-load-hardening -I/opt/openenclave/share/pkgconfig/../../include/openenclave/3rdparty/libcxx -I/opt/openenclave/share/pkgconfig/../../include/openenclave/3rdparty/libc -I/opt/openenclave/share/pkgconfig/../../include/openenclave/3rdparty -I/opt/openenclave/share/pkgconfig/../../include  -I. -I.. -std=c++11 -DOE_API_VERSION=2 ecalls.cpp ../common/attestation.cpp ../common/crypto.cpp ../common/dispatcher.cpp
clang-8 -g -c -nostdinc -m64 -fPIE -ftls-model=local-exec -fvisibility=hidden -fstack-protector-strong -fno-omit-frame-pointer -ffunction-sections -fdata-sections -mllvm -x86-speculative-load-hardening -I/opt/openenclave/share/pkgconfig/../../include/openenclave/3rdparty/libc -I/opt/openenclave/share/pkgconfig/../../include/openenclave/3rdparty -I/opt/openenclave/share/pkgconfig/../../include  -I.. -DOE_API_VERSION=2 ../common/remoteattestation_t.c
clang++-8 -o genquote_enclave attestation.o crypto.o ecalls.o dispatcher.o remoteattestation_t.o -L/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave -nostdlib -nodefaultlibs -nostartfiles -Wl,--no-undefined -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--export-dynamic -Wl,-pie -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,now -Wl,-gc-sections -loeenclave -loelibcxx -loelibc -loesyscall -loecore
crypto.o: In function `Crypto::init_mbedtls()':
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:31: undefined reference to `mbedtls_ctr_drbg_init'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:32: undefined reference to `mbedtls_entropy_init'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:33: undefined reference to `mbedtls_pk_init'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:33: undefined reference to `mbedtls_entropy_func'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:36: undefined reference to `mbedtls_ctr_drbg_seed'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:46: undefined reference to `mbedtls_pk_info_from_type'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:45: undefined reference to `mbedtls_pk_setup'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:56: undefined reference to `mbedtls_ctr_drbg_random'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:55: undefined reference to `mbedtls_rsa_gen_key'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:68: undefined reference to `mbedtls_pk_write_pubkey_pem'
crypto.o: In function `Crypto::cleanup_mbedtls()':
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:86: undefined reference to `mbedtls_pk_free'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:87: undefined reference to `mbedtls_entropy_free'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:88: undefined reference to `mbedtls_ctr_drbg_free'
crypto.o: In function `Crypto::Sha256(unsigned char const*, unsigned long, unsigned char*)':
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:107: undefined reference to `mbedtls_sha256_init'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:109: undefined reference to `mbedtls_sha256_starts_ret'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:113: undefined reference to `mbedtls_sha256_update_ret'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:117: undefined reference to `mbedtls_sha256_finish_ret'
/home/shubham/microsoft-azure-attestation/sgx.attest.sample/genquotes/enclave/../common/crypto.cpp:122: undefined reference to `mbedtls_sha256_free'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(report.c.o): In function `oe_verify_raw_sgx_report':
/source/openenclave/enclave/sgx/report.c:69: undefined reference to `oe_aes_cmac_sign'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(link.c.o):(.data.oe_link_enclave.symbols+0x28): undefined reference to `oe_crypto_initialize'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(quote.c.o): In function `oe_get_quote_cert_chain_internal':
/source/openenclave/common/sgx/quote.c:416: undefined reference to `oe_cert_chain_read_pem'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(quote.c.o): In function `oe_verify_quote_internal':
/source/openenclave/common/sgx/quote.c:263: undefined reference to `oe_cert_chain_read_pem'
/source/openenclave/common/sgx/quote.c:270: undefined reference to `oe_cert_chain_get_leaf_cert'
/source/openenclave/common/sgx/quote.c:274: undefined reference to `oe_cert_chain_get_root_cert'
/source/openenclave/common/sgx/quote.c:278: undefined reference to `oe_cert_chain_get_cert'
/source/openenclave/common/sgx/quote.c:284: undefined reference to `oe_cert_get_ec_public_key'
/source/openenclave/common/sgx/quote.c:288: undefined reference to `oe_cert_get_ec_public_key'
/source/openenclave/common/sgx/quote.c:294: undefined reference to `oe_ec_public_key_read_pem'
/source/openenclave/common/sgx/quote.c:371: undefined reference to `oe_ec_public_key_free'
/source/openenclave/common/sgx/quote.c:372: undefined reference to `oe_ec_public_key_free'
/source/openenclave/common/sgx/quote.c:373: undefined reference to `oe_ec_public_key_free'
/source/openenclave/common/sgx/quote.c:374: undefined reference to `oe_ec_public_key_free'
/source/openenclave/common/sgx/quote.c:375: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/quote.c:376: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/quote.c:377: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/quote.c:378: undefined reference to `oe_cert_chain_free'
/source/openenclave/common/sgx/quote.c:301: undefined reference to `oe_ec_public_key_equal'
/source/openenclave/common/sgx/quote.c:332: undefined reference to `oe_sha256_init'
/source/openenclave/common/sgx/quote.c:333: undefined reference to `oe_sha256_update'
/source/openenclave/common/sgx/quote.c:338: undefined reference to `oe_sha256_update'
/source/openenclave/common/sgx/quote.c:340: undefined reference to `oe_sha256_final'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(quote.c.o): In function `_read_public_key':
/source/openenclave/common/sgx/quote.c:176: undefined reference to `oe_ec_public_key_from_coordinates'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(quote.c.o): In function `oe_get_sgx_quote_validity':
/source/openenclave/common/sgx/quote.c:719: undefined reference to `oe_cert_chain_get_leaf_cert'
/source/openenclave/common/sgx/quote.c:780: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/quote.c:781: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/quote.c:782: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/quote.c:783: undefined reference to `oe_cert_chain_free'
/source/openenclave/common/sgx/quote.c:723: undefined reference to `oe_cert_chain_get_root_cert'
/source/openenclave/common/sgx/quote.c:727: undefined reference to `oe_cert_chain_get_cert'
/source/openenclave/common/sgx/quote.c:733: undefined reference to `oe_cert_get_validity_dates'
/source/openenclave/common/sgx/quote.c:737: undefined reference to `oe_cert_get_validity_dates'
/source/openenclave/common/sgx/quote.c:743: undefined reference to `oe_cert_get_validity_dates'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(quote.c.o): In function `_ecdsa_verify':
/source/openenclave/common/sgx/quote.c:197: undefined reference to `oe_sha256_init'
/source/openenclave/common/sgx/quote.c:198: undefined reference to `oe_sha256_update'
/source/openenclave/common/sgx/quote.c:199: undefined reference to `oe_sha256_final'
/source/openenclave/common/sgx/quote.c:201: undefined reference to `oe_ecdsa_signature_write_der'
/source/openenclave/common/sgx/quote.c:209: undefined reference to `oe_ec_public_key_verify'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(collateral.c.o): In function `oe_validate_revocation_list':
/source/openenclave/common/sgx/collateral.c:279: undefined reference to `oe_cert_chain_read_pem'
/source/openenclave/common/sgx/collateral.c:289: undefined reference to `oe_cert_chain_read_pem'
/source/openenclave/common/sgx/collateral.c:331: undefined reference to `oe_crl_read_der'
/source/openenclave/common/sgx/collateral.c:320: undefined reference to `oe_crl_read_pem'
/source/openenclave/common/sgx/collateral.c:331: undefined reference to `oe_crl_read_der'
/source/openenclave/common/sgx/collateral.c:320: undefined reference to `oe_crl_read_pem'
/source/openenclave/common/sgx/collateral.c:356: undefined reference to `oe_cert_verify'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(collateral.c.o): In function `_get_crl_validity':
/source/openenclave/common/sgx/collateral.c:86: undefined reference to `oe_crl_get_update_dates'
/source/openenclave/common/sgx/collateral.c:93: undefined reference to `oe_crl_get_update_dates'
/source/openenclave/common/sgx/collateral.c:93: undefined reference to `oe_crl_get_update_dates'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(collateral.c.o): In function `oe_validate_revocation_list':
/source/openenclave/common/sgx/collateral.c:447: undefined reference to `oe_cert_chain_get_leaf_cert'
/source/openenclave/common/sgx/collateral.c:451: undefined reference to `oe_cert_get_validity_dates'
/source/openenclave/common/sgx/collateral.c:475: undefined reference to `oe_crl_free'
/source/openenclave/common/sgx/collateral.c:475: undefined reference to `oe_crl_free'
/source/openenclave/common/sgx/collateral.c:477: undefined reference to `oe_cert_chain_free'
/source/openenclave/common/sgx/collateral.c:478: undefined reference to `oe_cert_chain_free'
/source/openenclave/common/sgx/collateral.c:479: undefined reference to `oe_cert_free'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(sgxcertextensions.c.o): In function `_get_sgx_extension':
/source/openenclave/common/sgx/sgxcertextensions.c:401: undefined reference to `oe_cert_find_extension'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(tcbinfo.c.o): In function `oe_verify_ecdsa256_signature':
/source/openenclave/common/sgx/tcbinfo.c:1357: undefined reference to `oe_cert_chain_get_root_cert'
/source/openenclave/common/sgx/tcbinfo.c:1384: undefined reference to `oe_ec_public_key_free'
/source/openenclave/common/sgx/tcbinfo.c:1385: undefined reference to `oe_ec_public_key_free'
/source/openenclave/common/sgx/tcbinfo.c:1386: undefined reference to `oe_ec_public_key_free'
/source/openenclave/common/sgx/tcbinfo.c:1388: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/tcbinfo.c:1389: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/tcbinfo.c:1358: undefined reference to `oe_cert_chain_get_leaf_cert'
/source/openenclave/common/sgx/tcbinfo.c:1360: undefined reference to `oe_cert_get_ec_public_key'
/source/openenclave/common/sgx/tcbinfo.c:1361: undefined reference to `oe_cert_get_ec_public_key'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(tcbinfo.c.o): In function `_ecdsa_verify':
/source/openenclave/common/sgx/tcbinfo.c:1314: undefined reference to `oe_sha256_init'
/source/openenclave/common/sgx/tcbinfo.c:1315: undefined reference to `oe_sha256_update'
/source/openenclave/common/sgx/tcbinfo.c:1316: undefined reference to `oe_sha256_final'
/source/openenclave/common/sgx/tcbinfo.c:1318: undefined reference to `oe_ecdsa_signature_write_der'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(tcbinfo.c.o): In function `oe_verify_ecdsa256_signature':
/source/openenclave/common/sgx/tcbinfo.c:1367: undefined reference to `oe_ec_public_key_read_pem'
/source/openenclave/common/sgx/tcbinfo.c:1372: undefined reference to `oe_ec_public_key_equal'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(tcbinfo.c.o): In function `_ecdsa_verify':
/source/openenclave/common/sgx/tcbinfo.c:1326: undefined reference to `oe_ec_public_key_verify'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(verifier.c.o): In function `oe_verify_qve_report_and_identity':
/source/openenclave/enclave/sgx/verifier.c:215: undefined reference to `oe_sha256_init'
/source/openenclave/enclave/sgx/verifier.c:218: undefined reference to `oe_sha256_update'
/source/openenclave/enclave/sgx/verifier.c:224: undefined reference to `oe_sha256_update'
/source/openenclave/enclave/sgx/verifier.c:227: undefined reference to `oe_sha256_update'
/source/openenclave/enclave/sgx/verifier.c:231: undefined reference to `oe_sha256_update'
/source/openenclave/enclave/sgx/verifier.c:237: undefined reference to `oe_sha256_update'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(verifier.c.o):/source/openenclave/enclave/sgx/verifier.c:245: more undefined references to `oe_sha256_update' follow
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(verifier.c.o): In function `oe_verify_qve_report_and_identity':
/source/openenclave/enclave/sgx/verifier.c:250: undefined reference to `oe_sha256_final'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(sha.c.o): In function `oe_sha256':
/source/openenclave/common/sha.c:11: undefined reference to `oe_sha256_init'
/source/openenclave/common/sha.c:12: undefined reference to `oe_sha256_update'
/source/openenclave/common/sha.c:13: undefined reference to `oe_sha256_final'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(asym_keys.c.o): In function `_create_asymmetric_keypair':
/source/openenclave/enclave/asym_keys.c:129: undefined reference to `oe_kdf_derive_key'
/source/openenclave/enclave/asym_keys.c:145: undefined reference to `oe_ec_valid_raw_private_key'
/source/openenclave/enclave/asym_keys.c:151: undefined reference to `oe_kdf_derive_key'
/source/openenclave/enclave/asym_keys.c:162: undefined reference to `oe_ec_generate_key_pair_from_private'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(asym_keys.c.o): In function `_export_keypair':
/source/openenclave/enclave/asym_keys.c:191: undefined reference to `oe_ec_public_key_write_pem'
/source/openenclave/enclave/asym_keys.c:193: undefined reference to `oe_ec_private_key_write_pem'
/source/openenclave/enclave/asym_keys.c:207: undefined reference to `oe_ec_public_key_write_pem'
/source/openenclave/enclave/asym_keys.c:209: undefined reference to `oe_ec_private_key_write_pem'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(asym_keys.c.o): In function `_derive_asymmetric_key':
/source/openenclave/enclave/asym_keys.c:268: undefined reference to `oe_ec_private_key_free'
/source/openenclave/enclave/asym_keys.c:269: undefined reference to `oe_ec_public_key_free'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(endorsements.c.o): In function `oe_get_sgx_endorsements':
/source/openenclave/common/sgx/endorsements.c:402: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/endorsements.c:403: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/endorsements.c:404: undefined reference to `oe_cert_chain_free'
/source/openenclave/common/sgx/endorsements.c:374: undefined reference to `oe_cert_chain_get_leaf_cert'
/source/openenclave/common/sgx/endorsements.c:378: undefined reference to `oe_cert_chain_get_cert'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboeenclave.a(qeidentity.c.o): In function `oe_validate_qe_identity':
/source/openenclave/common/sgx/qeidentity.c:62: undefined reference to `oe_cert_chain_read_pem'
/source/openenclave/common/sgx/qeidentity.c:213: undefined reference to `oe_cert_chain_free'
/source/openenclave/common/sgx/qeidentity.c:214: undefined reference to `oe_cert_free'
/source/openenclave/common/sgx/qeidentity.c:90: undefined reference to `oe_cert_chain_get_leaf_cert'
/source/openenclave/common/sgx/qeidentity.c:94: undefined reference to `oe_cert_get_validity_dates'
/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/liboecore.a(calls.c.o): In function `_handle_init_enclave':
/source/openenclave/enclave/core/sgx/calls.c:179: undefined reference to `oe_crypto_initialize'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:25: recipe for target 'build' failed
make: *** [build] Error 1
ssahai commented 3 years ago

It turns out that the mbedtls libraries were not being linked in the this command in the Makefile:

clang++-8 -o genquote_enclave attestation.o crypto.o ecalls.o dispatcher.o remoteattestation_t.o  -L/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave -nostdlib -nodefaultlibs -nostartfiles -Wl,--no-undefined -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--export-dynamic -Wl,-pie -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,now -Wl,-gc-sections -loeenclave -loelibcxx -loelibc -loesyscall -loecore

Adding the library flags: -loecryptombedtls -lmbedx509 -lmbedtls -lmbedcrypto solved majority of undefined references in the above error snapshot.

The final command that worked:

clang++-8 -o genquote_enclave attestation.o crypto.o ecalls.o dispatcher.o remoteattestation_t.o -L/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave -nostdlib -nodefaultlibs -nostartfiles -Wl,--no-undefined -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--export-dynamic -Wl,-pie -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,now -Wl,-gc-sections -loeenclave -loelibcxx -loelibc -loecryptombedtls -lmbedx509 -lmbedtls -lmbedcrypto -loecore -loesyscall

However, there is still an undefined reference to: 'time'. Executing the above command gives the following linker error:

/opt/openenclave/share/pkgconfig/../../lib/openenclave/enclave/libmbedx509.a(x509.c.o): In function `x509_get_current_time':
/source/openenclave/3rdparty/mbedtls/mbedtls/library/x509.c:935: undefined reference to `time'
/source/openenclave/3rdparty/mbedtls/mbedtls/library/x509.c:935: undefined reference to `time'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gkostal commented 3 years ago

@ssahai - thank you for reporting and troubleshooting this issue! This issue was caused by changes to the OE SDK to support both mbedtls and openssl crypto libraries, forcing developers to specifically select one or the other.

The issue has been fixed (commit). I've tested on a fresh Azure VM running:

If you have any other issues, don't hesitate to file another issue.