1 (edited by ENOTTY 2021-07-09 12:17:37)

Topic: Missing size_t definition when compiling WolfSSL against Linux SGX SDK

Hi all,

I'm using WolfSSL latest from the master branch (commit a250e1f23a5b1002c57570a29a2db3048eed1316) and the Linux SGX SDK latest from the master branch (just a few commits after 2.13.3) on Ubuntu 20.04. I've built the SGX SDK and installed it at /opt/intel/sgxsdk (default location).

When running build.sh in IDE/LINUX-SGX, I get an error "unknown type name size_t" on line 208 of wolfssl/wolfcrypt/types.h (where wc_ptr_t is defined). The error occurs with this call to gcc:

cc  -DDEBUG_WOLFSSL -Wno-implicit-function-declaration -std=c11 -m64 -O2 -nostdinc -fvisibility=hidden -fpie -fstack-protector -I/wolfssl/ -I/wolfssl/wolfcrypt/ -I/opt/intel/sgxsdk/include -I/opt/intel/sgxsdk/include/tlibc -I/opt/intel/sgxsdk/include/stlport -I/wolfssl/wolfcrypt/test -I/wolfssl/wolfcrypt/benchmark/ -fno-builtin-printf -I. -DWOLFSSL_SGX -DWOLFSSL_HAVE_SP_RSA -DWOLFSSL_HAVE_SP_DH -DWOLFSSL_HAVE_SP_ECC   -c -o /wolfssl/wolfcrypt/src/aes.o /wolfssl/wolfcrypt/src/aes.c
In file included from /wolfssl/wolfssl/wolfcrypt/error-crypt.h:34,
                 from /wolfssl/wolfcrypt/src/aes.c:36:
/wolfssl/wolfssl/wolfcrypt/types.h:208:13: error: unknown type name 'size_t'
  208 |     typedef size_t wc_ptr_t;
      |             ^~~~~~

I currently believe that the WolfSSL system of includes isn't picking up the definition of size_t in the SGX SDK's tlibc header files (which are found in /opt/intel/sgxsdk/include/tlibc).

I haven't yet dug into WolfSSL's includes to figure out how it picks up either types.h or limits.h yet, but any advice would be appreciated.

Thanks for reading!

Share

Re: Missing size_t definition when compiling WolfSSL against Linux SGX SDK

Hello ENOTTY,

I was able to reproduce your issue on that commit.  Looks like we've just checked in a fix here:
https://github.com/wolfSSL/wolfssl/comm … 8a742dde57
I retested with this commit applied and everything is building for me now.  Let me know if it works for you.

Thanks,
Kareem

Share

Re: Missing size_t definition when compiling WolfSSL against Linux SGX SDK

Looks like that worked, thanks!

Share