Browse Source

Fix compilation errors on Ubuntu 18.04

Chia-Che Tsai 5 years ago
parent
commit
013c25cdb2

+ 1 - 1
LibOS/shim/include/shim_table.h

@@ -689,7 +689,7 @@ int shim__sysctl (struct __kernel_sysctl_args * args);
 int shim_prctl (int option, unsigned long arg2, unsigned long arg3,
                 unsigned long arg4, unsigned long arg5);
 void * shim_arch_prctl (int code, void * addr);
-int shim_adjtimex (struct __kernel_timex * txc_p);
+int shim_adjtimex (struct ____kernel_timex * txc_p);
 int shim_setrlimit (int resource, struct __kernel_rlimit * rlim);
 int shim_chroot (const char * filename);
 int shim_sync (void);

+ 1 - 1
LibOS/shim/include/shim_types.h

@@ -83,7 +83,7 @@ struct __kernel_timezone {
  * syscall interface - used (mainly by NTP daemon)
  * to discipline kernel clock oscillator
  */
-struct __kernel_timex {
+struct ____kernel_timex {
     unsigned int modes; /* mode selector */
     long offset;        /* time offset (usec) */
     long freq;          /* frequency offset (scaled ppm) */

+ 1 - 1
LibOS/shim/include/shim_unistd.h

@@ -64,7 +64,7 @@ struct sigcp {
 };
 
 #define SI_CP_SESSION(info) \
-    (((struct sigcp *) (info)->_sifields._pad)->si_session)
+    (((struct sigcp *) &(info)->_sifields)->si_session)
 
 #define SIGCP                   33
 

+ 1 - 1
LibOS/shim/include/shim_vma.h

@@ -31,7 +31,7 @@
 #include <api.h>
 #include <list.h>
 
-#include <asm/mman.h>
+#include <linux/mman.h>
 
 struct shim_handle;
 

+ 1 - 1
LibOS/shim/src/shim_syscalls.c

@@ -670,7 +670,7 @@ void * shim_do_arch_prctl (int code, void * addr)
     return (void *) -ENOSYS;
 }
 
-SHIM_SYSCALL_PASSTHROUGH (adjtimex, 1, int, struct __kernel_timex *, txc_p)
+SHIM_SYSCALL_PASSTHROUGH (adjtimex, 1, int, struct ____kernel_timex *, txc_p)
 
 /* setrlimit: sys/shim_getrlimit.c */
 DEFINE_SHIM_SYSCALL (setrlimit, 2, shim_do_setrlimit, int, int, resource,

+ 2 - 0
Pal/src/host/Linux-SGX/pal_linux.h

@@ -28,6 +28,8 @@
 #include "sgx_api.h"
 #include "enclave_ocalls.h"
 
+#include <linux/mman.h>
+
 #ifdef __x86_64__
 # include "sysdep-x86_64.h"
 #endif

+ 1 - 0
Pal/src/host/Linux/pal_linux.h

@@ -26,6 +26,7 @@
 
 #define PAL_LOADER RUNTIME_FILE("pal-Linux")
 
+#include <linux/mman.h>
 #include <sys/syscall.h>
 #include <sigset.h>