Re: [PATCH 5/5] selftests/sgx: Enclave freestanding compilation + separate linker options.
From: Jo Van Bulck
Date: Mon Aug 07 2023 - 06:04:09 EST
On 28.07.23 21:22, Jarkko Sakkinen wrote:
Should be split into two patches.
Thanks, will do in the next patch revision.
Please describe the motivation for the
second paragraph in the patch, which adds '-ffreestanding'.
Even when passing -nostdlib, the compiler still assumes memset and
memcpy are present [1].
I found that, when not passing '-ffreestanding', clang seems to optimize
away the existing memcpy/memset implementations and errors with:
/bin/ld: test_encl.o: in function `do_encl_init_tcs_page':
test_encl.c:(.text+0x17e): undefined reference to `memset'
I will add this information in the next patch revision.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90701
Best,
Jo