Enable SIMD support for Linux SGX platform (#474)

This commit is contained in:
Wenyong Huang
2020-12-21 01:17:36 -06:00
committed by GitHub
parent a2294877f5
commit adb05ea719
5 changed files with 18 additions and 28 deletions

View File

@ -7,7 +7,7 @@
#include "bh_log.h"
#include "wasm_export.h"
#include "../interpreter/wasm.h"
#ifndef _DEFAULT_SOURCE
#if !defined(_DEFAULT_SOURCE) && !defined(BH_PLATFORM_LINUX_SGX)
#include "sys/syscall.h"
#endif
@ -267,7 +267,7 @@ getentropy_wrapper(wasm_exec_env_t exec_env, void *buffer, uint32 length)
{
if (buffer == NULL)
return -1;
#ifdef _DEFAULT_SOURCE
#if defined(_DEFAULT_SOURCE) || defined(BH_PLATFORM_LINUX_SGX)
return getentropy(buffer, length);
#else
return syscall(SYS_getrandom, buffer, length, 0);