You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@teaclave.apache.org by GitBox <gi...@apache.org> on 2021/12/02 02:30:45 UTC
[GitHub] [incubator-teaclave] ChuanDou2021 opened a new issue #581: About file size
ChuanDou2021 opened a new issue #581:
URL: https://github.com/apache/incubator-teaclave/issues/581
<!--
We're glad to anwser any questions related to Teaclave.
To help people quickly understand the issue, please also
include some background and context of the question.
We have documented many useful information on the homepage,
please check them out first: https://teaclave.apache.org/docs/.
-->
I found so and bin in **release** dir are huge, can we do something to decrease file size? Optimized size of enclave can be loaded quickly, and smaller memories of enclave space.
determine file type, it's **with debug_info, not stripped**
```bash
# find . -type f -not -path "./tests/*" -not -path "./examples/*" ! -name "*.pem" ! -name "*.toml" | xargs file
./lib/libteaclave_client_sdk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=cee545842224ac31aff1a48aeb1352e6043780cd, with debug_info, not stripped
./lib/libteaclave_client_sdk.a: current ar archive
./cli/teaclave_cli: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=de8680e09a2607597ba7494172adb1c6a55fb50f, with debug_info, not stripped
./services/teaclave_frontend_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f246828479bdcedd8d79debdbaf198c1dbd2b9bb, with debug_info, not stripped
./services/teaclave_management_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=74fbcf74817a66dce93fec3cd54a6048516cab65, with debug_info, not stripped
./services/teaclave_storage_service: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=8d85f04a3c859cd172a685aadb5a7d5459424393, with debug_info, not stripped
./services/teaclave_execution_service: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=be642ed0f0ace497d61cd0323ce2616e1230000e, with debug_info, not stripped
./services/teaclave_scheduler_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=559cc35f762112327c367eea96202d7d26349600, with debug_info, not stripped
./services/teaclave_storage_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e5fc4133fb81debadaeb28ec92ec3f05b7aede4b, with debug_info, not stripped
./services/teaclave_authentication_service: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d5076b4630858a25f4bd23b976f5fb5249d7015e, with debug_info, not stripped
./services/teaclave_management_service: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=e028f88b37cc611c9cd6258483289d7b21e470d0, with debug_info, not stripped
./services/teaclave_access_control_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=25d0747864983e35abdb604e9b80ccf9ae73f2dc, with debug_info, not stripped
./services/teaclave_scheduler_service: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=29c87c3ec1f47e27ce4e2dd563267674704f5233, with debug_info, not stripped
./services/teaclave_execution_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=02fc9f84f6e575688579f121e7eb6b21fa434e0b, with debug_info, not stripped
./services/teaclave_access_control_service: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=88031c25575ca45af3d81e2d841cd25ea9a3b484, with debug_info, not stripped
./services/teaclave_frontend_service: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=6a42e1d5cf4f30bda2e73b8f0b26eda0157c6a67, with debug_info, not stripped
./services/auditors/optimus_prime/optimus_prime.sign.sha256: data
./services/auditors/godzilla/godzilla.sign.sha256: data
./services/auditors/albus_dumbledore/albus_dumbledore.sign.sha256: data
./services/teaclave_authentication_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=72613855b9dc0d7d4c0358a605cced1bd6414944, with debug_info, not stripped
./tool/teaclave_sgx_tool: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=69f7f73486d61e1d962e67fbcd7a97a742bce0ee, with debug_info, not stripped
./tool/teaclave_sgx_tool_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=9532c22afb7599d609000844ff10592a19e27b81, with debug_info, not stripped
```
determine file size (before **strip**):
```bash
# find . -name "*.so" | xargs ls -lh
-rwxr-xr-x 1 root root 50M Nov 30 00:36 ./lib/libteaclave_client_sdk.so
-rw-r--r-- 1 root root 63M Nov 30 00:41 ./services/teaclave_access_control_service_enclave.signed.so
-rw-r--r-- 1 root root 56M Nov 30 00:39 ./services/teaclave_authentication_service_enclave.signed.so
-rw-r--r-- 1 root root 84M Nov 30 00:38 ./services/teaclave_execution_service_enclave.signed.so
-rw-r--r-- 1 root root 53M Nov 30 00:38 ./services/teaclave_frontend_service_enclave.signed.so
-rw-r--r-- 1 root root 54M Nov 30 00:41 ./services/teaclave_management_service_enclave.signed.so
-rw-r--r-- 1 root root 51M Nov 30 00:38 ./services/teaclave_scheduler_service_enclave.signed.so
-rw-r--r-- 1 root root 54M Nov 30 00:41 ./services/teaclave_storage_service_enclave.signed.so
-rw-r--r-- 1 root root 56M Nov 30 00:41 ./tests/teaclave_functional_tests_enclave.signed.so
-rw-r--r-- 1 root root 83M Nov 30 00:40 ./tests/teaclave_integration_tests_enclave.signed.so
-rw-r--r-- 1 root root 103M Nov 30 00:37 ./tests/teaclave_unit_tests_enclave.signed.so
-rw-r--r-- 1 root root 40M Nov 30 00:38 ./tool/teaclave_sgx_tool_enclave.signed.so
```
dtermine file size again (after **strip**):
```bash
# find . -name "*.so" | xargs strip
# find . -name "*.so" | xargs ls -lh
-rwxr-xr-x 1 1003 1004 9.9M Dec 1 10:07 ./lib/libteaclave_client_sdk.so
-rw-r--r-- 1 1003 1004 23M Dec 1 10:07 ./services/teaclave_access_control_service_enclave.signed.so
-rw-r--r-- 1 1003 1004 12M Dec 1 10:07 ./services/teaclave_authentication_service_enclave.signed.so
-rw-r--r-- 1 1003 1004 29M Dec 1 10:07 ./services/teaclave_execution_service_enclave.signed.so
-rw-r--r-- 1 1003 1004 12M Dec 1 10:07 ./services/teaclave_frontend_service_enclave.signed.so
-rw-r--r-- 1 1003 1004 13M Dec 1 10:07 ./services/teaclave_management_service_enclave.signed.so
-rw-r--r-- 1 1003 1004 12M Dec 1 10:07 ./services/teaclave_scheduler_service_enclave.signed.so
-rw-r--r-- 1 1003 1004 12M Dec 1 10:07 ./services/teaclave_storage_service_enclave.signed.so
-rw-r--r-- 1 1003 1004 13M Dec 1 10:07 ./tests/teaclave_functional_tests_enclave.signed.so
-rw-r--r-- 1 1003 1004 27M Dec 1 10:07 ./tests/teaclave_integration_tests_enclave.signed.so
-rw-r--r-- 1 1003 1004 31M Dec 1 10:07 ./tests/teaclave_unit_tests_enclave.signed.so
-rw-r--r-- 1 1003 1004 7.6M Dec 1 10:07 ./tool/teaclave_sgx_tool_enclave.signed.so
```
I'm learning dev of teaclave, i don't know how verify the questions at present, so just list questions here:
Q1: Can the enclave work after **strip** ? Is signature info lost?
Q2: Is **wasm** file size optimized?
Q3: dup link so
set TEACLAVE_EXECUTOR_WAMR **ON**, every enclave will link **vmlib**
cmake/scripts/sgx_link_sign.sh
```bash
TEACLAVE_LINK_FLAGS="-L${TEACLAVE_OUT_DIR} -lpycomponent ffi.o -lpypy-c -lsgx_tlibc_ext -lffi"
if [ "$TEACLAVE_EXECUTOR_WAMR" == "ON" ]; then
TEACLAVE_LINK_FLAGS+=" -lvmlib"
fi
# Enable the security flags
ENCLAVE_SECURITY_LINK_FLAGS="-Wl,-z,relro,-z,now,-z,noexecstack"
ENCLAVE_LINK_FLAGS="${ENCLAVE_SECURITY_LINK_FLAGS} \
-Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L${SGX_LIBRARY_PATH} \
-Wl,--whole-archive -l${Trts_Library_Name} -Wl,--no-whole-archive \
-Wl,--start-group \
-l${Service_Library_Name} -lsgx_tprotected_fs -lsgx_tkey_exchange \
-lsgx_tstdc -lsgx_tcxx -lsgx_tservice -lsgx_tcrypto \
${TEACLAVE_LINK_FLAGS} \
-L${TRUSTED_TARGET_DIR}/${TARGET} -l${CUR_PKG_NAME} \
-Wl,--end-group \
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
-Wl,--defsym,__ImageBase=0 \
-Wl,--gc-sections \
-Wl,--version-script=${TEACLAVE_PROJECT_ROOT}/cmake/scripts/Enclave.lds"
```
Q4: In teaclave runtime, effect of dynamic link equal to static link, is it true?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org
[GitHub] [incubator-teaclave] mssun commented on issue #581: About file size
Posted by GitBox <gi...@apache.org>.
mssun commented on issue #581:
URL: https://github.com/apache/incubator-teaclave/issues/581#issuecomment-984310554
Thanks for asking this question.
First of all, did you evaluate the binary size with the release build? If not, you can add this flag for cmake `-DCMAKE_BUILD_TYPE=Release`.
This is what I got for the release build (without stripping):
```
$ find . -name "*.so" | xargs ls -lh
-rwxr-xr-x 1 user group 9.0M Dec 1 21:13 ./lib/libteaclave_client_sdk.so
-rw-r--r-- 1 user group 22M Dec 1 21:08 ./services/teaclave_access_control_service_enclave.signed.so
-rw-r--r-- 1 user group 7.4M Dec 1 21:07 ./services/teaclave_authentication_service_enclave.signed.so
-rw-r--r-- 1 user group 26M Dec 1 21:06 ./services/teaclave_execution_service_enclave.signed.so
-rw-r--r-- 1 user group 8.1M Dec 1 21:08 ./services/teaclave_frontend_service_enclave.signed.so
-rw-r--r-- 1 user group 8.3M Dec 1 21:10 ./services/teaclave_management_service_enclave.signed.so
-rw-r--r-- 1 user group 8.0M Dec 1 21:10 ./services/teaclave_scheduler_service_enclave.signed.so
-rw-r--r-- 1 user group 7.1M Dec 1 21:07 ./services/teaclave_storage_service_enclave.signed.so
-rw-r--r-- 1 user group 8.1M Dec 1 21:04 ./tests/teaclave_functional_tests_enclave.signed.so
-rw-r--r-- 1 user group 25M Dec 1 21:09 ./tests/teaclave_integration_tests_enclave.signed.so
-rw-r--r-- 1 user group 28M Dec 1 21:05 ./tests/teaclave_unit_tests_enclave.signed.so
-rw-r--r-- 1 user group 5.7M Dec 1 21:07 ./tool/teaclave_sgx_tool_enclave.signed.so
```
Q1: Can the enclave work after strip ? Is signature info lost?
Stripping will affect information for panic with backtrace. Therefore, it's safe to strip the binary.
Q2: Is wasm file size optimized?
I don't understand this question. Did you mean WAMR?
Q3: dup link so
I believe linker only links objects which are used. For example, WAMR is not used in the management service, `vmlib` is not linked into the library.
Q4: In teaclave runtime, effect of dynamic link equal to static link, is it true?
For SGX enclave, all code are statically linked.
Compared with C, Rust's program is larger mainly due to these two reasons:
- Rust's standard library
- Lots of generics in Rust's program
For our services, the two main libraries are vmlib (WAMR) used in the execution service and pypy-c (MesaPy) used in access_control service and execution service.
Please let me if you have more questions. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org
[GitHub] [incubator-teaclave] mssun closed issue #581: About file size
Posted by GitBox <gi...@apache.org>.
mssun closed issue #581:
URL: https://github.com/apache/incubator-teaclave/issues/581
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org
[GitHub] [incubator-teaclave] mssun commented on issue #581: About file size
Posted by GitBox <gi...@apache.org>.
mssun commented on issue #581:
URL: https://github.com/apache/incubator-teaclave/issues/581#issuecomment-997088699
I'm closing this issue. I believe this question has been solved.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org
[GitHub] [incubator-teaclave] ChuanDou2021 edited a comment on issue #581: About file size
Posted by GitBox <gi...@apache.org>.
ChuanDou2021 edited a comment on issue #581:
URL: https://github.com/apache/incubator-teaclave/issues/581#issuecomment-984417195
Thank you for reply.
I recompile the project with **-DCMAKE_BUILD_TYPE=Release**, and got the same result as you .
But, the file.so marked ** with debug_info, not stripped**, and file.so size can be optimized by **strip** even further.
### result with **with debug_info, not stripped**
```bash
#find . -name "*.so" | xargs file
./lib/libteaclave_client_sdk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6176b475f3ca9cbc6d36ae616b548c7fca0f324d, with debug_info, not stripped
./tests/teaclave_functional_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d753545de45a6d946b2f60976b675e47e729089d, with debug_info, not stripped
./tests/teaclave_integration_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d2a622eda368fa37d1951399510a358eb0f40671, with debug_info, not stripped
./tests/teaclave_unit_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=73a7b900de006c80b7cadd9730c093450f58dcb2, with debug_info, not stripped
./services/teaclave_frontend_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1a0f2fd65d81ac245a354bc131de9c0b95df56f0, with debug_info, not stripped
./services/teaclave_management_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=75dcb514f8951f8955cee7b09b8f6f8202ed3f63, with debug_info, not stripped
./services/teaclave_scheduler_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6c386ccf6fd690f63b857c84b1c7da77381d340f, with debug_info, not stripped
./services/teaclave_storage_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=969024af5546ea06ca8280698cafd9f448a91221, with debug_info, not stripped
./services/teaclave_access_control_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=072c8959e17dcd71d950fea703e1e02836d21564, with debug_info, not stripped
./services/teaclave_execution_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e87eac399eb95a4d13fb2cfb0ef348adc5ed62bc, with debug_info, not stripped
./services/teaclave_authentication_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1e577d5c6a55fb4891bdc8695de09b343ad57dc4, with debug_info, not stripped
./tool/teaclave_sgx_tool_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0c1bb9015993c9ce1deebf15152cf8fbc19d8805, with debug_info, not stripped
```
### no strip results:
```bash
#find . -name "*.so" | xargs ls -lh
-rwxr-xr-x 1 root root 8.6M 12月 2 16:18 ./lib/libteaclave_client_sdk.so
-rw-r--r-- 1 root root 23M 12月 2 16:23 ./services/teaclave_access_control_service_enclave.signed.so
-rw-r--r-- 1 root root 7.8M 12月 2 16:21 ./services/teaclave_authentication_service_enclave.signed.so
-rw-r--r-- 1 root root 26M 12月 2 16:20 ./services/teaclave_execution_service_enclave.signed.so
-rw-r--r-- 1 root root 7.8M 12月 2 16:20 ./services/teaclave_frontend_service_enclave.signed.so
-rw-r--r-- 1 root root 7.9M 12月 2 16:21 ./services/teaclave_management_service_enclave.signed.so
-rw-r--r-- 1 root root 7.6M 12月 2 16:20 ./services/teaclave_scheduler_service_enclave.signed.so
-rw-r--r-- 1 root root 7.6M 12月 2 16:24 ./services/teaclave_storage_service_enclave.signed.so
-rw-r--r-- 1 root root 7.8M 12月 2 16:22 ./tests/teaclave_functional_tests_enclave.signed.so
-rw-r--r-- 1 root root 25M 12月 2 16:23 ./tests/teaclave_integration_tests_enclave.signed.so
-rw-r--r-- 1 root root 28M 12月 2 16:19 ./tests/teaclave_unit_tests_enclave.signed.so
-rw-r--r-- 1 root root 6.0M 12月 2 16:21 ./tool/teaclave_sgx_tool_enclave.signed.so
```
### strip by hand
```bash
#find . -name "*.so" | xargs strip
#find . -name "*.so" | xargs file
./lib/libteaclave_client_sdk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6176b475f3ca9cbc6d36ae616b548c7fca0f324d, stripped
./tests/teaclave_functional_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d753545de45a6d946b2f60976b675e47e729089d, stripped
./tests/teaclave_integration_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d2a622eda368fa37d1951399510a358eb0f40671, stripped
./tests/teaclave_unit_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=73a7b900de006c80b7cadd9730c093450f58dcb2, stripped
./services/teaclave_frontend_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1a0f2fd65d81ac245a354bc131de9c0b95df56f0, stripped
./services/teaclave_management_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=75dcb514f8951f8955cee7b09b8f6f8202ed3f63, stripped
./services/teaclave_scheduler_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6c386ccf6fd690f63b857c84b1c7da77381d340f, stripped
./services/teaclave_storage_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=969024af5546ea06ca8280698cafd9f448a91221, stripped
./services/teaclave_access_control_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=072c8959e17dcd71d950fea703e1e02836d21564, stripped
./services/teaclave_execution_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e87eac399eb95a4d13fb2cfb0ef348adc5ed62bc, stripped
./services/teaclave_authentication_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1e577d5c6a55fb4891bdc8695de09b343ad57dc4, stripped
./tool/teaclave_sgx_tool_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0c1bb9015993c9ce1deebf15152cf8fbc19d8805, stripped
#find . -name "*.so" | xargs ls -lh
-rwxr-xr-x 1 root root 4.0M Dec 2 08:45 ./lib/libteaclave_client_sdk.so
-rw-r--r-- 1 root root 17M Dec 2 08:45 ./services/teaclave_access_control_service_enclave.signed.so
-rw-r--r-- 1 root root 5.0M Dec 2 08:45 ./services/teaclave_authentication_service_enclave.signed.so
-rw-r--r-- 1 root root 20M Dec 2 08:45 ./services/teaclave_execution_service_enclave.signed.so
-rw-r--r-- 1 root root 4.9M Dec 2 08:45 ./services/teaclave_frontend_service_enclave.signed.so
-rw-r--r-- 1 root root 5.0M Dec 2 08:45 ./services/teaclave_management_service_enclave.signed.so
-rw-r--r-- 1 root root 4.8M Dec 2 08:45 ./services/teaclave_scheduler_service_enclave.signed.so
-rw-r--r-- 1 root root 4.8M Dec 2 08:45 ./services/teaclave_storage_service_enclave.signed.so
-rw-r--r-- 1 root root 4.9M Dec 2 08:45 ./tests/teaclave_functional_tests_enclave.signed.so
-rw-r--r-- 1 root root 19M Dec 2 08:45 ./tests/teaclave_integration_tests_enclave.signed.so
-rw-r--r-- 1 root root 22M Dec 2 08:45 ./tests/teaclave_unit_tests_enclave.signed.so
-rw-r--r-- 1 root root 3.5M Dec 2 08:45 ./tool/teaclave_sgx_tool_enclave.signed.so
```
marked with **stripped**, and the file size is smaller.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org
[GitHub] [incubator-teaclave] ChuanDou2021 commented on issue #581: About file size
Posted by GitBox <gi...@apache.org>.
ChuanDou2021 commented on issue #581:
URL: https://github.com/apache/incubator-teaclave/issues/581#issuecomment-984417195
Thank you for reply.
I recompile the project with **-DCMAKE_BUILD_TYPE=Release**, and got the same result as you .
But, the file.so marked ** with debug_info, not stripped**, and file.so size can be optimized by **strip** even further.
### result with **with debug_info, not stripped**
```bash
#find . -name "*.so" | xargs file
./lib/libteaclave_client_sdk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6176b475f3ca9cbc6d36ae616b548c7fca0f324d, with debug_info, not stripped
./tests/teaclave_functional_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d753545de45a6d946b2f60976b675e47e729089d, with debug_info, not stripped
./tests/teaclave_integration_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d2a622eda368fa37d1951399510a358eb0f40671, with debug_info, not stripped
./tests/teaclave_unit_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=73a7b900de006c80b7cadd9730c093450f58dcb2, with debug_info, not stripped
./services/teaclave_frontend_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1a0f2fd65d81ac245a354bc131de9c0b95df56f0, with debug_info, not stripped
./services/teaclave_management_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=75dcb514f8951f8955cee7b09b8f6f8202ed3f63, with debug_info, not stripped
./services/teaclave_scheduler_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6c386ccf6fd690f63b857c84b1c7da77381d340f, with debug_info, not stripped
./services/teaclave_storage_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=969024af5546ea06ca8280698cafd9f448a91221, with debug_info, not stripped
./services/teaclave_access_control_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=072c8959e17dcd71d950fea703e1e02836d21564, with debug_info, not stripped
./services/teaclave_execution_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e87eac399eb95a4d13fb2cfb0ef348adc5ed62bc, with debug_info, not stripped
./services/teaclave_authentication_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1e577d5c6a55fb4891bdc8695de09b343ad57dc4, with debug_info, not stripped
./tool/teaclave_sgx_tool_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0c1bb9015993c9ce1deebf15152cf8fbc19d8805, with debug_info, not stripped
```
### no strip results:
```bash
#find . -name "*.so" | xargs ls -lh
-rwxr-xr-x 1 root root 8.6M 12月 2 16:18 ./lib/libteaclave_client_sdk.so
-rw-r--r-- 1 root root 23M 12月 2 16:23 ./services/teaclave_access_control_service_enclave.signed.so
-rw-r--r-- 1 root root 7.8M 12月 2 16:21 ./services/teaclave_authentication_service_enclave.signed.so
-rw-r--r-- 1 root root 26M 12月 2 16:20 ./services/teaclave_execution_service_enclave.signed.so
-rw-r--r-- 1 root root 7.8M 12月 2 16:20 ./services/teaclave_frontend_service_enclave.signed.so
-rw-r--r-- 1 root root 7.9M 12月 2 16:21 ./services/teaclave_management_service_enclave.signed.so
-rw-r--r-- 1 root root 7.6M 12月 2 16:20 ./services/teaclave_scheduler_service_enclave.signed.so
-rw-r--r-- 1 root root 7.6M 12月 2 16:24 ./services/teaclave_storage_service_enclave.signed.so
-rw-r--r-- 1 root root 7.8M 12月 2 16:22 ./tests/teaclave_functional_tests_enclave.signed.so
-rw-r--r-- 1 root root 25M 12月 2 16:23 ./tests/teaclave_integration_tests_enclave.signed.so
-rw-r--r-- 1 root root 28M 12月 2 16:19 ./tests/teaclave_unit_tests_enclave.signed.so
-rw-r--r-- 1 root root 6.0M 12月 2 16:21 ./tool/teaclave_sgx_tool_enclave.signed.so
```
### strip by hand
```bash
#find . -name "*.so" | xargs strip
#find . -name "*.so" | xargs file
./lib/libteaclave_client_sdk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6176b475f3ca9cbc6d36ae616b548c7fca0f324d, stripped
./tests/teaclave_functional_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d753545de45a6d946b2f60976b675e47e729089d, stripped
./tests/teaclave_integration_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d2a622eda368fa37d1951399510a358eb0f40671, stripped
./tests/teaclave_unit_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=73a7b900de006c80b7cadd9730c093450f58dcb2, stripped
./services/teaclave_frontend_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1a0f2fd65d81ac245a354bc131de9c0b95df56f0, stripped
./services/teaclave_management_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=75dcb514f8951f8955cee7b09b8f6f8202ed3f63, stripped
./services/teaclave_scheduler_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6c386ccf6fd690f63b857c84b1c7da77381d340f, stripped
./services/teaclave_storage_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=969024af5546ea06ca8280698cafd9f448a91221, stripped
./services/teaclave_access_control_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=072c8959e17dcd71d950fea703e1e02836d21564, stripped
./services/teaclave_execution_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e87eac399eb95a4d13fb2cfb0ef348adc5ed62bc, stripped
./services/teaclave_authentication_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1e577d5c6a55fb4891bdc8695de09b343ad57dc4, stripped
./tool/teaclave_sgx_tool_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0c1bb9015993c9ce1deebf15152cf8fbc19d8805, stripped
```
marked with **stripped**
### strip result
```bash
#find . -name "*.so" | xargs ls -lh
-rwxr-xr-x 1 root root 4.0M Dec 2 08:45 ./lib/libteaclave_client_sdk.so
-rw-r--r-- 1 root root 17M Dec 2 08:45 ./services/teaclave_access_control_service_enclave.signed.so
-rw-r--r-- 1 root root 5.0M Dec 2 08:45 ./services/teaclave_authentication_service_enclave.signed.so
-rw-r--r-- 1 root root 20M Dec 2 08:45 ./services/teaclave_execution_service_enclave.signed.so
-rw-r--r-- 1 root root 4.9M Dec 2 08:45 ./services/teaclave_frontend_service_enclave.signed.so
-rw-r--r-- 1 root root 5.0M Dec 2 08:45 ./services/teaclave_management_service_enclave.signed.so
-rw-r--r-- 1 root root 4.8M Dec 2 08:45 ./services/teaclave_scheduler_service_enclave.signed.so
-rw-r--r-- 1 root root 4.8M Dec 2 08:45 ./services/teaclave_storage_service_enclave.signed.so
-rw-r--r-- 1 root root 4.9M Dec 2 08:45 ./tests/teaclave_functional_tests_enclave.signed.so
-rw-r--r-- 1 root root 19M Dec 2 08:45 ./tests/teaclave_integration_tests_enclave.signed.so
-rw-r--r-- 1 root root 22M Dec 2 08:45 ./tests/teaclave_unit_tests_enclave.signed.so
-rw-r--r-- 1 root root 3.5M Dec 2 08:45 ./tool/teaclave_sgx_tool_enclave.signed.so
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org
[GitHub] [incubator-teaclave] ChuanDou2021 edited a comment on issue #581: About file size
Posted by GitBox <gi...@apache.org>.
ChuanDou2021 edited a comment on issue #581:
URL: https://github.com/apache/incubator-teaclave/issues/581#issuecomment-984417195
Thank you for reply.
I recompile the project with **-DCMAKE_BUILD_TYPE=Release**, and got the same result as you .
But, the file.so marked ** with debug_info, not stripped**, and file.so size can be optimized by **strip** even further.
### result with **with debug_info, not stripped**
```bash
#find . -name "*.so" | xargs file
./lib/libteaclave_client_sdk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6176b475f3ca9cbc6d36ae616b548c7fca0f324d, with debug_info, not stripped
./tests/teaclave_functional_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d753545de45a6d946b2f60976b675e47e729089d, with debug_info, not stripped
./tests/teaclave_integration_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d2a622eda368fa37d1951399510a358eb0f40671, with debug_info, not stripped
./tests/teaclave_unit_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=73a7b900de006c80b7cadd9730c093450f58dcb2, with debug_info, not stripped
./services/teaclave_frontend_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1a0f2fd65d81ac245a354bc131de9c0b95df56f0, with debug_info, not stripped
./services/teaclave_management_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=75dcb514f8951f8955cee7b09b8f6f8202ed3f63, with debug_info, not stripped
./services/teaclave_scheduler_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6c386ccf6fd690f63b857c84b1c7da77381d340f, with debug_info, not stripped
./services/teaclave_storage_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=969024af5546ea06ca8280698cafd9f448a91221, with debug_info, not stripped
./services/teaclave_access_control_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=072c8959e17dcd71d950fea703e1e02836d21564, with debug_info, not stripped
./services/teaclave_execution_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e87eac399eb95a4d13fb2cfb0ef348adc5ed62bc, with debug_info, not stripped
./services/teaclave_authentication_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1e577d5c6a55fb4891bdc8695de09b343ad57dc4, with debug_info, not stripped
./tool/teaclave_sgx_tool_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0c1bb9015993c9ce1deebf15152cf8fbc19d8805, with debug_info, not stripped
```
### no strip results:
```bash
#find . -name "*.so" | xargs ls -lh
-rwxr-xr-x 1 root root 8.6M 12月 2 16:18 ./lib/libteaclave_client_sdk.so
-rw-r--r-- 1 root root 23M 12月 2 16:23 ./services/teaclave_access_control_service_enclave.signed.so
-rw-r--r-- 1 root root 7.8M 12月 2 16:21 ./services/teaclave_authentication_service_enclave.signed.so
-rw-r--r-- 1 root root 26M 12月 2 16:20 ./services/teaclave_execution_service_enclave.signed.so
-rw-r--r-- 1 root root 7.8M 12月 2 16:20 ./services/teaclave_frontend_service_enclave.signed.so
-rw-r--r-- 1 root root 7.9M 12月 2 16:21 ./services/teaclave_management_service_enclave.signed.so
-rw-r--r-- 1 root root 7.6M 12月 2 16:20 ./services/teaclave_scheduler_service_enclave.signed.so
-rw-r--r-- 1 root root 7.6M 12月 2 16:24 ./services/teaclave_storage_service_enclave.signed.so
-rw-r--r-- 1 root root 7.8M 12月 2 16:22 ./tests/teaclave_functional_tests_enclave.signed.so
-rw-r--r-- 1 root root 25M 12月 2 16:23 ./tests/teaclave_integration_tests_enclave.signed.so
-rw-r--r-- 1 root root 28M 12月 2 16:19 ./tests/teaclave_unit_tests_enclave.signed.so
-rw-r--r-- 1 root root 6.0M 12月 2 16:21 ./tool/teaclave_sgx_tool_enclave.signed.so
```
### strip by hand
```bash
#find . -name "*.so" | xargs strip
#find . -name "*.so" | xargs file
./lib/libteaclave_client_sdk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6176b475f3ca9cbc6d36ae616b548c7fca0f324d, stripped
./tests/teaclave_functional_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d753545de45a6d946b2f60976b675e47e729089d, stripped
./tests/teaclave_integration_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d2a622eda368fa37d1951399510a358eb0f40671, stripped
./tests/teaclave_unit_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=73a7b900de006c80b7cadd9730c093450f58dcb2, stripped
./services/teaclave_frontend_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1a0f2fd65d81ac245a354bc131de9c0b95df56f0, stripped
./services/teaclave_management_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=75dcb514f8951f8955cee7b09b8f6f8202ed3f63, stripped
./services/teaclave_scheduler_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6c386ccf6fd690f63b857c84b1c7da77381d340f, stripped
./services/teaclave_storage_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=969024af5546ea06ca8280698cafd9f448a91221, stripped
./services/teaclave_access_control_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=072c8959e17dcd71d950fea703e1e02836d21564, stripped
./services/teaclave_execution_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e87eac399eb95a4d13fb2cfb0ef348adc5ed62bc, stripped
./services/teaclave_authentication_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1e577d5c6a55fb4891bdc8695de09b343ad57dc4, stripped
./tool/teaclave_sgx_tool_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0c1bb9015993c9ce1deebf15152cf8fbc19d8805, stripped
#find . -name "*.so" | xargs ls -lh
-rwxr-xr-x 1 root root 4.0M Dec 2 08:45 ./lib/libteaclave_client_sdk.so
-rw-r--r-- 1 root root 17M Dec 2 08:45 ./services/teaclave_access_control_service_enclave.signed.so
-rw-r--r-- 1 root root 5.0M Dec 2 08:45 ./services/teaclave_authentication_service_enclave.signed.so
-rw-r--r-- 1 root root 20M Dec 2 08:45 ./services/teaclave_execution_service_enclave.signed.so
-rw-r--r-- 1 root root 4.9M Dec 2 08:45 ./services/teaclave_frontend_service_enclave.signed.so
-rw-r--r-- 1 root root 5.0M Dec 2 08:45 ./services/teaclave_management_service_enclave.signed.so
-rw-r--r-- 1 root root 4.8M Dec 2 08:45 ./services/teaclave_scheduler_service_enclave.signed.so
-rw-r--r-- 1 root root 4.8M Dec 2 08:45 ./services/teaclave_storage_service_enclave.signed.so
-rw-r--r-- 1 root root 4.9M Dec 2 08:45 ./tests/teaclave_functional_tests_enclave.signed.so
-rw-r--r-- 1 root root 19M Dec 2 08:45 ./tests/teaclave_integration_tests_enclave.signed.so
-rw-r--r-- 1 root root 22M Dec 2 08:45 ./tests/teaclave_unit_tests_enclave.signed.so
-rw-r--r-- 1 root root 3.5M Dec 2 08:45 ./tool/teaclave_sgx_tool_enclave.signed.so
```
marked with **stripped**, and the file size is smaller.
Can I come to a conclusion: -DCMAKE_BUILD_TYPE=Release + strip, the most effective.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org
[GitHub] [incubator-teaclave] qinkunbao commented on issue #581: About file size
Posted by GitBox <gi...@apache.org>.
qinkunbao commented on issue #581:
URL: https://github.com/apache/incubator-teaclave/issues/581#issuecomment-984449479
Q1.
You are right that the size of enclave files can be further optimized with the `strip` command. The signature `mrenclave` of an enclave should not change. However, a stripped enclave binary does not have a better runtime performance, including the loading time. `strip` removes some sections from the binary, but these removed sections are not loaded into the enclave memory. Stripping binaries cannot decrease the memory usage.
> Thank you for reply. I recompile the project with **-DCMAKE_BUILD_TYPE=Release**, and got the same result as you . But, the file.so marked ** with debug_info, not stripped**, and file.so size can be optimized by **strip** even further.
>
> ### result with **with debug_info, not stripped**
> ```shell
> #find . -name "*.so" | xargs file
> ./lib/libteaclave_client_sdk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6176b475f3ca9cbc6d36ae616b548c7fca0f324d, with debug_info, not stripped
> ./tests/teaclave_functional_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d753545de45a6d946b2f60976b675e47e729089d, with debug_info, not stripped
> ./tests/teaclave_integration_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d2a622eda368fa37d1951399510a358eb0f40671, with debug_info, not stripped
> ./tests/teaclave_unit_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=73a7b900de006c80b7cadd9730c093450f58dcb2, with debug_info, not stripped
> ./services/teaclave_frontend_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1a0f2fd65d81ac245a354bc131de9c0b95df56f0, with debug_info, not stripped
> ./services/teaclave_management_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=75dcb514f8951f8955cee7b09b8f6f8202ed3f63, with debug_info, not stripped
> ./services/teaclave_scheduler_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6c386ccf6fd690f63b857c84b1c7da77381d340f, with debug_info, not stripped
> ./services/teaclave_storage_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=969024af5546ea06ca8280698cafd9f448a91221, with debug_info, not stripped
> ./services/teaclave_access_control_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=072c8959e17dcd71d950fea703e1e02836d21564, with debug_info, not stripped
> ./services/teaclave_execution_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e87eac399eb95a4d13fb2cfb0ef348adc5ed62bc, with debug_info, not stripped
> ./services/teaclave_authentication_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1e577d5c6a55fb4891bdc8695de09b343ad57dc4, with debug_info, not stripped
> ./tool/teaclave_sgx_tool_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0c1bb9015993c9ce1deebf15152cf8fbc19d8805, with debug_info, not stripped
> ```
>
> ### no strip results:
> ```shell
> #find . -name "*.so" | xargs ls -lh
> -rwxr-xr-x 1 root root 8.6M 12月 2 16:18 ./lib/libteaclave_client_sdk.so
> -rw-r--r-- 1 root root 23M 12月 2 16:23 ./services/teaclave_access_control_service_enclave.signed.so
> -rw-r--r-- 1 root root 7.8M 12月 2 16:21 ./services/teaclave_authentication_service_enclave.signed.so
> -rw-r--r-- 1 root root 26M 12月 2 16:20 ./services/teaclave_execution_service_enclave.signed.so
> -rw-r--r-- 1 root root 7.8M 12月 2 16:20 ./services/teaclave_frontend_service_enclave.signed.so
> -rw-r--r-- 1 root root 7.9M 12月 2 16:21 ./services/teaclave_management_service_enclave.signed.so
> -rw-r--r-- 1 root root 7.6M 12月 2 16:20 ./services/teaclave_scheduler_service_enclave.signed.so
> -rw-r--r-- 1 root root 7.6M 12月 2 16:24 ./services/teaclave_storage_service_enclave.signed.so
> -rw-r--r-- 1 root root 7.8M 12月 2 16:22 ./tests/teaclave_functional_tests_enclave.signed.so
> -rw-r--r-- 1 root root 25M 12月 2 16:23 ./tests/teaclave_integration_tests_enclave.signed.so
> -rw-r--r-- 1 root root 28M 12月 2 16:19 ./tests/teaclave_unit_tests_enclave.signed.so
> -rw-r--r-- 1 root root 6.0M 12月 2 16:21 ./tool/teaclave_sgx_tool_enclave.signed.so
> ```
>
> ### strip by hand
> ```shell
> #find . -name "*.so" | xargs strip
> #find . -name "*.so" | xargs file
> ./lib/libteaclave_client_sdk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6176b475f3ca9cbc6d36ae616b548c7fca0f324d, stripped
> ./tests/teaclave_functional_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d753545de45a6d946b2f60976b675e47e729089d, stripped
> ./tests/teaclave_integration_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d2a622eda368fa37d1951399510a358eb0f40671, stripped
> ./tests/teaclave_unit_tests_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=73a7b900de006c80b7cadd9730c093450f58dcb2, stripped
> ./services/teaclave_frontend_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1a0f2fd65d81ac245a354bc131de9c0b95df56f0, stripped
> ./services/teaclave_management_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=75dcb514f8951f8955cee7b09b8f6f8202ed3f63, stripped
> ./services/teaclave_scheduler_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6c386ccf6fd690f63b857c84b1c7da77381d340f, stripped
> ./services/teaclave_storage_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=969024af5546ea06ca8280698cafd9f448a91221, stripped
> ./services/teaclave_access_control_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=072c8959e17dcd71d950fea703e1e02836d21564, stripped
> ./services/teaclave_execution_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e87eac399eb95a4d13fb2cfb0ef348adc5ed62bc, stripped
> ./services/teaclave_authentication_service_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1e577d5c6a55fb4891bdc8695de09b343ad57dc4, stripped
> ./tool/teaclave_sgx_tool_enclave.signed.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0c1bb9015993c9ce1deebf15152cf8fbc19d8805, stripped
>
> #find . -name "*.so" | xargs ls -lh
> -rwxr-xr-x 1 root root 4.0M Dec 2 08:45 ./lib/libteaclave_client_sdk.so
> -rw-r--r-- 1 root root 17M Dec 2 08:45 ./services/teaclave_access_control_service_enclave.signed.so
> -rw-r--r-- 1 root root 5.0M Dec 2 08:45 ./services/teaclave_authentication_service_enclave.signed.so
> -rw-r--r-- 1 root root 20M Dec 2 08:45 ./services/teaclave_execution_service_enclave.signed.so
> -rw-r--r-- 1 root root 4.9M Dec 2 08:45 ./services/teaclave_frontend_service_enclave.signed.so
> -rw-r--r-- 1 root root 5.0M Dec 2 08:45 ./services/teaclave_management_service_enclave.signed.so
> -rw-r--r-- 1 root root 4.8M Dec 2 08:45 ./services/teaclave_scheduler_service_enclave.signed.so
> -rw-r--r-- 1 root root 4.8M Dec 2 08:45 ./services/teaclave_storage_service_enclave.signed.so
> -rw-r--r-- 1 root root 4.9M Dec 2 08:45 ./tests/teaclave_functional_tests_enclave.signed.so
> -rw-r--r-- 1 root root 19M Dec 2 08:45 ./tests/teaclave_integration_tests_enclave.signed.so
> -rw-r--r-- 1 root root 22M Dec 2 08:45 ./tests/teaclave_unit_tests_enclave.signed.so
> -rw-r--r-- 1 root root 3.5M Dec 2 08:45 ./tool/teaclave_sgx_tool_enclave.signed.so
> ```
>
> marked with **stripped**, and the file size is smaller.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org