1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

wasi: enable full builds, bump bench iterations up

also disable threaded linking to work around an lld bug
This commit is contained in:
Frank Denis 2019-04-09 11:40:28 +02:00
parent 6a5650fb34
commit d40175ae33

View File

@ -12,7 +12,7 @@ mkdir -p $PREFIX || exit 1
export CC="clang" export CC="clang"
export CFLAGS="--target=wasm32-unknkown-wasi --sysroot=${WASI_SYSROOT} -O2" export CFLAGS="--target=wasm32-unknkown-wasi --sysroot=${WASI_SYSROOT} -O2"
export LDFLAGS="-s" export LDFLAGS="-s -Wl,--no-threads"
export NM="llvm-nm" export NM="llvm-nm"
export AR="llvm-ar" export AR="llvm-ar"
export RANLIB="llvm-ranlib" export RANLIB="llvm-ranlib"
@ -25,11 +25,10 @@ grep -q -F -- '-wasi' build-aux/config.sub || \
if [ "x$1" = "x--bench" ]; then if [ "x$1" = "x--bench" ]; then
export BENCHMARKS=1 export BENCHMARKS=1
export LIBSODIUM_FULL_BUILD=1 export CPPFLAGS="-DBENCHMARKS -DITERATIONS=100"
export CPPFLAGS="-DBENCHMARKS -DITERATIONS=25"
fi fi
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then if [ -n "$LIBSODIUM_MINIMAL_BUILD" ]; then
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal" export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
else else
export LIBSODIUM_ENABLE_MINIMAL_FLAG="" export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
@ -37,7 +36,8 @@ fi
./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ ./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
--prefix="$PREFIX" --with-sysroot="$WASI_SYSROOT" \ --prefix="$PREFIX" --with-sysroot="$WASI_SYSROOT" \
--host=wasm32-unknown-wasi --disable-ssp --disable-shared || exit 1 --host=wasm32-unknown-wasi \
--disable-ssp --disable-shared || exit 1
NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
PROCESSORS=${NPROCESSORS:-3} PROCESSORS=${NPROCESSORS:-3}