Add proper tracing options, remove getenv calls from enclave code.
This adds proper tracing options, which removes the need for getenv calls in the enclave. Fixes #780.
Goes with https://github.com/lsds/sgx-lkl-musl/pull/36.
There's one relevant getenv call in musl, see https://github.com/lsds/sgx-lkl-musl/blob/a6360f883fd906b18c1878254547ad72da28d7e6/ldso/dynlink.c#L822. This is now the only tracing/debug env var that gets passed through to the enclave as an env var: https://github.com/lsds/sgx-lkl/blob/9979a88fa90cca275dcb0822deef5e0393cea88a/src/main-oe/sgxlkl_params.c#L3 I'm not sure this is still useful (see bunch of commented code further up in the file). Can I remove it?
There's one relevant getenv call in musl, see https://github.com/lsds/sgx-lkl-musl/blob/a6360f883fd906b18c1878254547ad72da28d7e6/ldso/dynlink.c#L822. This is now the only tracing/debug env var that gets passed through to the enclave as an env var: https://github.com/lsds/sgx-lkl/blob/9979a88fa90cca275dcb0822deef5e0393cea88a/src/main-oe/sgxlkl_params.c#L3
I'm not sure this is still useful (see bunch of commented code further up in the file). Can I remove it?
This is part of a mechanism that, instead of loading debug symbols inside the enclave and then passing a pointer to gdb, it allows the enclave image to be mounted outside and thus gdb can access the files with symbols directly. For large applications (e.g. TF), this results in much better performance during debugging.
Great, thanks for the explanation, then it makes sense to keep it!