From 2ea21b96e093bceae65109c054fd37b21960a5c2 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 4 Jun 2020 10:40:25 +0200 Subject: [PATCH] Don't even include signal.h on WASI Since version 11, wasi-sysroot doesn't ignore it but spits out an error instead. --- azure-pipelines.yml | 2 +- src/libsodium/sodium/utils.c | 5 ++++- test/default/sodium_utils2.c | 4 +++- test/default/sodium_utils3.c | 4 +++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 693569fe..bbc4d55c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,7 +16,7 @@ jobs: curl https://get.wasmer.io -sSfL | sh displayName: Install wasmer - script: | - curl -sL -o - https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-10/wasi-sdk-10.0-linux.tar.gz | tar xz -f - -C /opt/ + curl -sL -o - https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-11/wasi-sdk-11.0-linux.tar.gz | tar xz -f - -C /opt/ sudo mv /opt/wasi-sdk-* /opt/wasi-sdk sudo ln -s /opt/wasi-sdk/share/*sysroot* /opt/wasi-sysroot displayName: Install the WASI SDK diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index 9bfef745..cdaff9d0 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -4,12 +4,15 @@ #include #include #include -#include #include #include #include #include +#ifndef __wasm__ +# include +#endif + #ifdef HAVE_SYS_MMAN_H # include #endif diff --git a/test/default/sodium_utils2.c b/test/default/sodium_utils2.c index a1801b1a..bd72f36c 100644 --- a/test/default/sodium_utils2.c +++ b/test/default/sodium_utils2.c @@ -3,7 +3,9 @@ #include #include -#include +#ifdef HAVE_CATCHABLE_SEGV +# include +#endif #define TEST_NAME "sodium_utils2" #include "cmptest.h" diff --git a/test/default/sodium_utils3.c b/test/default/sodium_utils3.c index a39f0ee4..3bba037a 100644 --- a/test/default/sodium_utils3.c +++ b/test/default/sodium_utils3.c @@ -3,7 +3,9 @@ #include #include -#include +#ifdef HAVE_CATCHABLE_SEGV +# include +#endif #define TEST_NAME "sodium_utils3" #include "cmptest.h"