intel / linux-sgx

Intel SGX for Linux*
https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/linux-overview.html
Other
1.34k stars 548 forks source link

Unable to build latest release #481

Open cbeck88 opened 4 years ago

cbeck88 commented 4 years ago

I have been building linux-sgx repo from source locally for a long time, and installing it in my linux kernel in order to develop SGX software, thank you for your hard work!

I tried upgrading to latest release 2.7.1 and I get the following build errors:

~/linux-sgx/linux-sgx$ git checkout -f sgx_2.7.1
~/linux-sgx/linux-sgx$ make clean
~/linux-sgx/linux-sgx$ make sdk

It fails with compiler errors:

make[3]: Entering directory '/home/chris/linux-sgx/linux-sgx/sdk/tlibcrypto'
cc -Wjump-misses-init -Wstrict-prototypes -Wunsuffixed-float-constants -fstack-protector-strong -fcf-protection -O2 -D_FORTIFY_SOURCE=2 -UDEBUG -DNDEBUG -ffunction-sections -fdata-sections -Wall -Wextra -Winit-self -Wpointer-arith -Wreturn-type -Waddress -Wsequence-point -Wformat-security -Wmissing-include-dirs -Wfloat-equal -Wundef -Wshadow -Wcast-align -Wconversion -Wredundant-decls -DITT_ARCH_IA64 -I/home/chris/linux-sgx/linux-sgx/common/inc/internal -I/home/chris/linux-sgx/linux-sgx/common/inc -I/home/chris/linux-sgx/linux-sgx/common/inc/tlibc -I/home/chris/linux-sgx/linux-sgx/external/ippcp_internal/inc -ffreestanding -nostdinc -fvisibility=hidden -fpie -fno-strict-overflow -fno-delete-null-pointer-checks -m64 -Werror -fno-exceptions -fPIC -I/home/chris/linux-sgx/linux-sgx/common/inc/internal -I/home/chris/linux-sgx/linux-sgx/common/inc -I/home/chris/linux-sgx/linux-sgx/common/inc/tlibc -I/home/chris/linux-sgx/linux-sgx/external/ippcp_internal/inc  -c -o ipp/ipp_disp/ippcpsgx_disp00198.o ipp/ipp_disp/ippcpsgx_disp00198.c
In file included from /home/chris/linux-sgx/linux-sgx/external/ippcp_internal/inc/ippcp.h:58,
                 from ipp/ipp_disp/ippcpsgx_disp00198.c:32:
ipp/ipp_disp/ippcpsgx_disp00198.c:50:45: error: unknown type name ‘IppsHashInfo’; did you mean ‘ippsHashInit’?
 IPPAPI(IppStatus, y8_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod))
                                             ^~~~~~~~~~~~
/home/chris/linux-sgx/linux-sgx/external/ippcp_internal/inc/ippcpdefs.h:72:68: note: in definition of macro ‘IPPAPI’
     #define   IPPAPI( type,name,arg )        type IPP_STDCALL name arg;
                                                                    ^~~
ipp/ipp_disp/ippcpsgx_disp00198.c:51:45: error: unknown type name ‘IppsHashInfo’; did you mean ‘ippsHashInit’?
 IPPAPI(IppStatus, l9_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod))
                                             ^~~~~~~~~~~~
/home/chris/linux-sgx/linux-sgx/external/ippcp_internal/inc/ippcpdefs.h:72:68: note: in definition of macro ‘IPPAPI’
     #define   IPPAPI( type,name,arg )        type IPP_STDCALL name arg;
                                                                    ^~~
ipp/ipp_disp/ippcpsgx_disp00198.c:52:45: error: unknown type name ‘IppsHashInfo’; did you mean ‘ippsHashInit’?
 IPPAPI(IppStatus, k0_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod))
                                             ^~~~~~~~~~~~
/home/chris/linux-sgx/linux-sgx/external/ippcp_internal/inc/ippcpdefs.h:72:68: note: in definition of macro ‘IPPAPI’
     #define   IPPAPI( type,name,arg )        type IPP_STDCALL name arg;
                                                                    ^~~
ipp/ipp_disp/ippcpsgx_disp00198.c:54:50: error: unknown type name ‘IppsHashInfo’; did you mean ‘ippsHashInit’?
 IPPFUN(IppStatus,sgx_disp_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod))
                                                  ^~~~~~~~~~~~
ipp/ipp_disp/ippcpsgx_disp00198.c:34:60: note: in definition of macro ‘IPPFUN’
 #define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg
                                                            ^~~
make[3]: *** [<builtin>: ipp/ipp_disp/ippcpsgx_disp00198.o] Error 1
make[3]: Leaving directory '/home/chris/linux-sgx/linux-sgx/sdk/tlibcrypto'
make[2]: *** [Makefile.opt_lib:185: tcrypto] Error 2
make[2]: Leaving directory '/home/chris/linux-sgx/linux-sgx/sdk'
make[1]: *** [Makefile:53: all] Error 2
make[1]: Leaving directory '/home/chris/linux-sgx/linux-sgx/sdk'
make: *** [Makefile:73: sdk] Error 2

I am using Ubuntu 18.04, I reran the instructions from README.txt just in case:

sudo apt-get install build-essential ocaml ocamlbuild automake autoconf libtool wget python libssl-dev

Is this issue known, or is there something I'm missing that has changed about the build process? Thank you

llly commented 4 years ago

You need to clean the repo by git clean -df first, then download latest prebuilt by ./download_prebuilt.sh following README.