From 1f958d7e97a1fbfdd94ceea3f080eff9b55acafc Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 28 Mar 2019 13:03:34 -0700 Subject: [PATCH 1/5] Update Travis from trusty to xenial. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1fce0e4147a9..395c3a7399d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ matrix: # Similarly, we don't need to hold up people using stable while we wait # for the results which may fail. fast_finish: true -dist: trusty +dist: xenial sudo: false before_script: # If an old version of rustfmt from cargo is already installed, uninstall From 4746c4dc91193d72f7053c1b066b4ef7ae88d744 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 29 Mar 2019 12:09:56 -0700 Subject: [PATCH 2/5] Investigating why getentropy is an unresolved symbol on xenial. --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 395c3a7399d4..709ce32f8640 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,11 @@ before_script: # rustup update makes it ready. - rustup update - rustfmt +stable --version + # Testing. + gcc -Wall t.c -Wl,-y,getentropy + clang -Wall t.c -Wl,-y,getentropy + /lib/x86_64-linux-gnu/libc.so.6 + nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep getentropy script: ./test-all.sh cache: cargo: true From f662ce0efb0f499b73310dde7a1ffae192e45166 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 29 Mar 2019 04:38:08 -0700 Subject: [PATCH 3/5] Don't use getentropy on GLIBC < 2.25. --- wasmtime-wasi/sandboxed-system-primitives/src/config.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wasmtime-wasi/sandboxed-system-primitives/src/config.h b/wasmtime-wasi/sandboxed-system-primitives/src/config.h index 5fa4ce1dda94..c44526290c47 100644 --- a/wasmtime-wasi/sandboxed-system-primitives/src/config.h +++ b/wasmtime-wasi/sandboxed-system-primitives/src/config.h @@ -12,13 +12,20 @@ #ifndef CONFIG_H #define CONFIG_H +#include + #if defined(__FreeBSD__) || defined(__APPLE__) #define CONFIG_HAS_ARC4RANDOM_BUF 1 #else #define CONFIG_HAS_ARC4RANDOM_BUF 0 #endif -#ifdef __linux__ +// On Linux, prefer to use getentropy, though it isn't available in +// GLIBC before 2.25. +#if defined(__linux__) && \ + (!defined(__GLIBC__) || \ + __GLIBC__ > 2 || \ + (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25)) #define CONFIG_HAS_GETENTROPY 1 #else #define CONFIG_HAS_GETENTROPY 0 From 07f5f7e31f3d239904304b244651fcc64afbd896 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 29 Mar 2019 04:56:52 -0700 Subject: [PATCH 4/5] Fix .travis.yml syntax. --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 709ce32f8640..51a1f48f6e3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,10 +37,10 @@ before_script: - rustup update - rustfmt +stable --version # Testing. - gcc -Wall t.c -Wl,-y,getentropy - clang -Wall t.c -Wl,-y,getentropy - /lib/x86_64-linux-gnu/libc.so.6 - nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep getentropy + - gcc -Wall t.c -Wl,-y,getentropy + - clang -Wall t.c -Wl,-y,getentropy + - /lib/x86_64-linux-gnu/libc.so.6 + - nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep getentropy script: ./test-all.sh cache: cargo: true From 77a36408fa475df3befa10c17ed7c46bd1d379e8 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 29 Mar 2019 05:01:06 -0700 Subject: [PATCH 5/5] Remove debugging code. --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 51a1f48f6e3e..395c3a7399d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,11 +36,6 @@ before_script: # rustup update makes it ready. - rustup update - rustfmt +stable --version - # Testing. - - gcc -Wall t.c -Wl,-y,getentropy - - clang -Wall t.c -Wl,-y,getentropy - - /lib/x86_64-linux-gnu/libc.so.6 - - nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep getentropy script: ./test-all.sh cache: cargo: true