Skip to content

Commit

Permalink
[tools/sgx] Remove unneeded include deps for RA-TLS and Secret Prov libs
Browse files Browse the repository at this point in the history
Gramine RA-TLS and Secret Provisioning libraries actually only need
`sgx_arch.h` and `sgx_attest.h` from `PAL/Linux-SGX` (for some
SGX-hardware-specific structs). However, RA-TLS and Secret Prov use
`sgx_inc` which contains unnecessary includes, e.g., `common_inc`.

This commit removes `sgx_inc` from RA-TLS and Secret Provisioning libs'
include dependencies and includes only the needed headers from
`PAL/Linux-SGX`.

Signed-off-by: Kailun Qin <[email protected]>
  • Loading branch information
kailun-qin authored and Dmitrii Kuvaiskii committed Oct 25, 2022
1 parent 8b4ebdf commit ef46981
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
8 changes: 7 additions & 1 deletion pal/src/host/linux-sgx/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ gsgx_h = configure_file(
configuration: conf_sgx,
)

pal_sgx_inc = [
include_directories(
'.',
),
]

sgx_inc = [
includes_pal_common,
pal_sgx_inc,
include_directories(
'.',
'../../../include/arch/@0@/linux'.format(host_machine.cpu_family()),
'../../../include/host/linux-common',
),
Expand Down
4 changes: 2 additions & 2 deletions tools/sgx/common/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sgx_util = shared_library('sgx_util',
],

include_directories: [
sgx_inc,
pal_sgx_inc, # this is only for `sgx_arch.h` and `sgx_attest.h`
common_inc,
],
dependencies: [
Expand All @@ -31,7 +31,7 @@ sgx_util_dep = declare_dependency(
link_with: sgx_util,
include_directories: [
include_directories('.'),
sgx_inc, # this is mostly for sgx_arch.h
pal_sgx_inc, # this is only for `sgx_arch.h` and `sgx_attest.h`
protected_files_inc,
],
)
Expand Down
14 changes: 7 additions & 7 deletions tools/sgx/ra-tls/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ra_tls_args = [
libra_tls_attest = shared_library('ra_tls_attest',
'ra_tls_attest.c',
c_args: ra_tls_args,
include_directories: sgx_inc,
include_directories: pal_sgx_inc, # this is only for `sgx_arch.h` and `sgx_attest.h`
dependencies: [
mbedtls_static_dep,
],
Expand All @@ -29,7 +29,7 @@ libra_tls_verify_epid = shared_library('ra_tls_verify_epid',
'ra_tls.h',

c_args: ra_tls_args,
include_directories: sgx_inc,
include_directories: pal_sgx_inc,
dependencies: [
sgx_util_dep,
mbedtls_static_dep,
Expand All @@ -50,7 +50,7 @@ libsecret_prov_attest = shared_library('secret_prov_attest',
'secret_prov.h',

c_args: ra_tls_args,
include_directories: sgx_inc,
include_directories: pal_sgx_inc,
dependencies: [
mbedtls_static_dep,
sgx_util_dep,
Expand All @@ -72,7 +72,7 @@ libsecret_prov_verify_epid = shared_library('secret_prov_verify_epid',
'secret_prov.h',

c_args: ra_tls_args,
include_directories: sgx_inc,
include_directories: pal_sgx_inc,
dependencies: [
threads_dep,
sgx_util_dep,
Expand All @@ -93,7 +93,7 @@ if dcap
'ra_tls.h',

c_args: ra_tls_args,
include_directories: sgx_inc,
include_directories: pal_sgx_inc,
dependencies: [
sgx_dcap_quoteverify_dep,
sgx_util_dep,
Expand All @@ -114,7 +114,7 @@ if dcap
'ra_tls.h',

c_args: ra_tls_args,
include_directories: sgx_inc,
include_directories: pal_sgx_inc,
dependencies: [
sgx_dcap_quoteverify_dep,
sgx_util_dep,
Expand All @@ -137,7 +137,7 @@ if dcap
'secret_prov.h',

c_args: ra_tls_args,
include_directories: sgx_inc,
include_directories: pal_sgx_inc,
dependencies: [
threads_dep,
sgx_dcap_quoteverify_dep,
Expand Down

0 comments on commit ef46981

Please sign in to comment.