lsds / TaLoS

Efficient TLS termination inside Intel SGX enclaves for existing applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation of libressl not working

kbamponsem opened this issue · comments

The compile chain isn't working because the sys/time.h library doesn't accept int gettimeofday(struct timeval *tv, void *tz);
One has to revert it back to int getimeofday(struct timeval *tv, struct timezone *tz);

Hi

This is interesting because I had the exact inverse problem. What system configuration (which OS, kernel, gcc version) do you use?

Thank you

Ubuntu 18.04
kernel: 5.4.0-1065
gcc (Ubuntu 11.1.0-1ubuntu1~18.04.1) 11.1.0

Also encountered this problem. Modifying the function signature of getimeofday in src/libressl-2.4.1/crypto/enclaveshim_ocalls.c as described by kbamponsem worked.

This is the compiler error:

enclaveshim_ocalls.c:1123:5: error: conflicting types for ‘gettimeofday’; have ‘int(struct timeval *, void *)’
 1123 | int gettimeofday(struct timeval *tv, void *tz) {
      |     ^~~~~~~~~~~~
In file included from enclaveshim_ocalls.c:33:
/usr/include/x86_64-linux-gnu/sys/time.h:68:12: note: previous declaration of ‘gettimeofday’ with type ‘int(struct timeval * restrict,
struct timezone * restrict)’
   68 | extern int gettimeofday (struct timeval *__restrict __tv,
      |            ^~~~~~~~~~~~
Makefile.sgx:782: recipe for target 'enclaveshim_ocalls.o' failed
make: *** [enclaveshim_ocalls.o] Error 1

Hi. I have modified the signature of gettimeofday(). Thank you for raising this issue.

commented

Hi,
I get the same issue but with the modified signature. Here is the compiler error :

enclaveshim_ocalls.c:1123:5: error: conflicting types for ‘gettimeofday’
 1123 | int gettimeofday(struct timeval *tv, struct timezone *tz) {
      |     ^~~~~~~~~~~~
In file included from enclaveshim_ocalls.c:33:
/usr/include/x86_64-linux-gnu/sys/time.h:66:12: note: previous declaration of ‘gettimeofday’ was here
   66 | extern int gettimeofday (struct timeval *__restrict __tv,
      |            ^~~~~~~~~~~~
make: *** [Makefile.sgx:784: enclaveshim_ocalls.o] Error 1

OS: Ubuntu 20.04.6 LTS
kernel: 5.15.0-100-generic
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0