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.33k stars 544 forks source link

PSW build error on Ubuntu 18.04 #593

Open donporter opened 4 years ago

donporter commented 4 years ago

Hi All,

When I recently tried building master branch of the PSW, I get the following build errors. Any advice?

I have successfully built this code on older branches and other platforms previously.

Relevant output from make psw:

make[2]: Entering directory '/playpen/sgx/linux-sgx/psw/urts/linux'
cc -c -Wjump-misses-init -Wstrict-prototypes -Wunsuffixed-float-constants -fstack-protector-strong -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 -DDISABLE_TRACE -fPIC -Werror -g  -I/opt/intel/sgxsdk/include -I/playpen/sgx/linux-sgx/common/inc/internal -I/playpen/sgx/linux-sgx/common/inc/internal/linux -I/playpen/sgx/linux-sgx/psw/enclave_common -I/playpen/sgx/linux-sgx/psw/urts/ -I/playpen/sgx/linux-sgx/psw/urts/linux -I/playpen/sgx/linux-sgx/psw/urts/parser -I/playpen/sgx/linux-sgx/external/vtune/linux/include -I/playpen/sgx/linux-sgx/external/vtune/linux/sdk/src/ittnotify  enter_enclave.S -o enter_enclave.o
cc -c -Wjump-misses-init -Wstrict-prototypes -Wunsuffixed-float-constants -fstack-protector-strong -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 -DDISABLE_TRACE -fPIC -Werror -g  -I/opt/intel/sgxsdk/include -I/playpen/sgx/linux-sgx/common/inc/internal -I/playpen/sgx/linux-sgx/common/inc/internal/linux -I/playpen/sgx/linux-sgx/psw/enclave_common -I/playpen/sgx/linux-sgx/psw/urts/ -I/playpen/sgx/linux-sgx/psw/urts/linux -I/playpen/sgx/linux-sgx/psw/urts/parser -I/playpen/sgx/linux-sgx/external/vtune/linux/include -I/playpen/sgx/linux-sgx/external/vtune/linux/sdk/src/ittnotify  /playpen/sgx/linux-sgx/psw/../common/src/linux/xsave_gnu.S -o xsave_gnu.o
g++ -c -Wnon-virtual-dtor -std=c++11 -fstack-protector-strong -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 -DDISABLE_TRACE -fPIC -Werror -g  -I/opt/intel/sgxsdk/include -I/playpen/sgx/linux-sgx/common/inc/internal -I/playpen/sgx/linux-sgx/common/inc/internal/linux -I/playpen/sgx/linux-sgx/psw/enclave_common -I/playpen/sgx/linux-sgx/psw/urts/ -I/playpen/sgx/linux-sgx/psw/urts/linux -I/playpen/sgx/linux-sgx/psw/urts/parser -I/playpen/sgx/linux-sgx/external/vtune/linux/include -I/playpen/sgx/linux-sgx/external/vtune/linux/sdk/src/ittnotify  /playpen/sgx/linux-sgx/psw/urts/loader.cpp -o loader.o
In file included from /playpen/sgx/linux-sgx/psw/urts/loader.cpp:35:0:
/playpen/sgx/linux-sgx/common/inc/internal/arch.h:75:5: error: ‘sgx_config_id_t’ does not name a type; did you mean ‘sgx_prod_id_t’?
     sgx_config_id_t             config_id;      /* (192) CONFIGID */
     ^~~~~~~~~~~~~~~
     sgx_prod_id_t
/playpen/sgx/linux-sgx/common/inc/internal/arch.h:78:5: error: ‘sgx_config_svn_t’ does not name a type; did you mean ‘sgx_cpu_svn_t’?
     sgx_config_svn_t            config_svn;     /* (260) CONFIGSVN */
     ^~~~~~~~~~~~~~~~
     sgx_cpu_svn_t
In file included from /playpen/sgx/linux-sgx/psw/urts/loader.cpp:35:0:
/playpen/sgx/linux-sgx/common/inc/internal/arch.h:227:5: error: ‘sgx_isvfamily_id_t’ does not name a type; did you mean ‘sgx_key_id_t’?
     sgx_isvfamily_id_t   isv_family_id;  /* (912) ISV assigned Family ID */
     ^~~~~~~~~~~~~~~~~~
     sgx_key_id_t
/playpen/sgx/linux-sgx/common/inc/internal/arch.h:232:5: error: ‘sgx_isvext_prod_id_t’ does not name a type; did you mean ‘sgx_prod_id_t’?
     sgx_isvext_prod_id_t isvext_prod_id; /* (1008) ISV assigned Extended Product ID */
     ^~~~~~~~~~~~~~~~~~~~
     sgx_prod_id_t
In file included from /playpen/sgx/linux-sgx/psw/urts/loader.cpp:35:0:
/playpen/sgx/linux-sgx/common/inc/internal/arch.h:51:29: error: static assertion failed: static assert error
 #define se_static_assert(e) static_assert(e, "static assert error")
                             ^
/playpen/sgx/linux-sgx/common/inc/internal/arch.h:236:1: note: in expansion of macro ‘se_static_assert’
 se_static_assert(sizeof(css_body_t) == 128);
 ^~~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/common/inc/internal/arch.h:51:29: error: static assertion failed: static assert error
 #define se_static_assert(e) static_assert(e, "static assert error")
                             ^
/playpen/sgx/linux-sgx/common/inc/internal/arch.h:252:1: note: in expansion of macro ‘se_static_assert’
 se_static_assert(sizeof(enclave_css_t) == 1808);
 ^~~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/common/inc/internal/arch.h:51:29: error: static assertion failed: static assert error
 #define se_static_assert(e) static_assert(e, "static assert error")
                             ^
/playpen/sgx/linux-sgx/common/inc/internal/metadata.h:188:1: note: in expansion of macro ‘se_static_assert’
 se_static_assert(sizeof(metadata_t) == METADATA_SIZE);
 ^~~~~~~~~~~~~~~~
In file included from /playpen/sgx/linux-sgx/psw/urts/loader.cpp:37:0:
/playpen/sgx/linux-sgx/psw/urts/loader.h:60:80: error: ‘sgx_config_id_t’ has not been declared
     int load_enclave(SGXLaunchToken *lc, int flag, const metadata_t *metadata, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file = NULL, sgx_misc_attribute_t *misc_attr = NULL);
                                                                                ^~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.h:60:108: error: ‘sgx_config_svn_t’ has not been declared
     int load_enclave(SGXLaunchToken *lc, int flag, const metadata_t *metadata, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file = NULL, sgx_misc_attribute_t *misc_attr = NULL);
                                                                                                            ^~~~~~~~~~~~~~~~
In file included from /playpen/sgx/linux-sgx/psw/urts/loader.cpp:37:0:
/playpen/sgx/linux-sgx/psw/urts/loader.h:61:88: error: ‘sgx_config_id_t’ has not been declared
     int load_enclave_ex(SGXLaunchToken *lc, bool is_debug, const metadata_t *metadata, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file = NULL, sgx_misc_attribute_t *misc_attr = NULL);
                                                                                        ^~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.h:61:116: error: ‘sgx_config_svn_t’ has not been declared
     int load_enclave_ex(SGXLaunchToken *lc, bool is_debug, const metadata_t *metadata, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file = NULL, sgx_misc_attribute_t *misc_attr = NULL);
                                                                                                                    ^~~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.h:74:84: error: ‘sgx_config_id_t’ has not been declared
     int build_image(SGXLaunchToken * const lc, sgx_attributes_t * const secs_attr, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file, sgx_misc_attribute_t * const misc_attr);
                                                                                    ^~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.h:74:112: error: ‘sgx_config_svn_t’ has not been declared
     int build_image(SGXLaunchToken * const lc, sgx_attributes_t * const secs_attr, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file, sgx_misc_attribute_t * const misc_attr);
                                                                                                                ^~~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.h:75:56: error: ‘sgx_config_id_t’ has not been declared
     int build_secs(sgx_attributes_t * const secs_attr, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, sgx_misc_attribute_t * const misc_attr);
                                                        ^~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.h:75:84: error: ‘sgx_config_svn_t’ has not been declared
     int build_secs(sgx_attributes_t * const secs_attr, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, sgx_misc_attribute_t * const misc_attr);
                                                                                    ^~~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:492:61: error: ‘sgx_config_id_t’ has not been declared
 int CLoader::build_secs(sgx_attributes_t * const secs_attr, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, sgx_misc_attribute_t * const misc_attr)
                                                             ^~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:492:89: error: ‘sgx_config_svn_t’ has not been declared
 int CLoader::build_secs(sgx_attributes_t * const secs_attr, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, sgx_misc_attribute_t * const misc_attr)
                                                                                         ^~~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp: In member function ‘int CLoader::build_secs(sgx_attributes_t*, int*, int, sgx_misc_attribute_t*)’:
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:505:29: error: ‘secs_t {aka struct _secs_t}’ has no member named ‘config_id’
         if (memcpy_s(m_secs.config_id, SGX_CONFIGID_SIZE, config_id, SGX_CONFIGID_SIZE))
                             ^~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:505:40: error: ‘SGX_CONFIGID_SIZE’ was not declared in this scope
         if (memcpy_s(m_secs.config_id, SGX_CONFIGID_SIZE, config_id, SGX_CONFIGID_SIZE))
                                        ^~~~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:505:40: note: suggested alternative: ‘SGX_KEYID_SIZE’
         if (memcpy_s(m_secs.config_id, SGX_CONFIGID_SIZE, config_id, SGX_CONFIGID_SIZE))
                                        ^~~~~~~~~~~~~~~~~
                                        SGX_KEYID_SIZE
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:508:12: error: ‘secs_t {aka struct _secs_t}’ has no member named ‘config_svn’
     m_secs.config_svn = config_svn;
            ^~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp: At global scope:
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:525:89: error: ‘sgx_config_id_t’ has not been declared
 int CLoader::build_image(SGXLaunchToken * const lc, sgx_attributes_t * const secs_attr, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file, sgx_misc_attribute_t * const misc_attr)
                                                                                         ^~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:525:117: error: ‘sgx_config_svn_t’ has not been declared
 int CLoader::build_image(SGXLaunchToken * const lc, sgx_attributes_t * const secs_attr, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file, sgx_misc_attribute_t * const misc_attr)
                                                                                                                     ^~~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:761:86: error: ‘sgx_config_id_t’ has not been declared
 int CLoader::load_enclave(SGXLaunchToken *lc, int debug, const metadata_t *metadata, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file, sgx_misc_attribute_t *misc_attr)
                                                                                      ^~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:761:114: error: ‘sgx_config_svn_t’ has not been declared
 int CLoader::load_enclave(SGXLaunchToken *lc, int debug, const metadata_t *metadata, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file, sgx_misc_attribute_t *misc_attr)
                                                                                                                  ^~~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:797:90: error: ‘sgx_config_id_t’ has not been declared
 int CLoader::load_enclave_ex(SGXLaunchToken *lc, bool debug, const metadata_t *metadata, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file, sgx_misc_attribute_t *misc_attr)
                                                                                          ^~~~~~~~~~~~~~~
/playpen/sgx/linux-sgx/psw/urts/loader.cpp:797:118: error: ‘sgx_config_svn_t’ has not been declared
 int CLoader::load_enclave_ex(SGXLaunchToken *lc, bool debug, const metadata_t *metadata, sgx_config_id_t *config_id, sgx_config_svn_t config_svn, le_prd_css_file_t *prd_css_file, sgx_misc_attribute_t *misc_attr)
                                                                                                                      ^~~~~~~~~~~~~~~~
Makefile:154: recipe for target 'loader.o' failed
make[2]: *** [loader.o] Error 1
make[2]: Leaving directory '/playpen/sgx/linux-sgx/psw/urts/linux'
Makefile:46: recipe for target 'urts' failed
make[1]: *** [urts] Error 2
make[1]: Leaving directory '/playpen/sgx/linux-sgx/psw'
Makefile:61: recipe for target 'psw' failed
make: *** [psw] Error 2
lzha101 commented 4 years ago

The SDK version you installed under /opt/intel/sgxsdk folder may be out of date. You can try to reinstall the SDK and then build PSW.

ziyizhou0813 commented 8 months ago

已过期。您可以尝试重新安装SDK,然后构建PSW。

you are right