test for clang

dev
MITSUNARI Shigeo 7 years ago
parent ecc6ad34f2
commit c4c1d4c1fe
  1. 13
      Makefile
  2. 2
      include/mcl/bn.h
  3. 2
      include/mcl/gmp_util.hpp
  4. 6
      include/mcl/op.hpp
  5. 2
      include/mcl/she.h
  6. 2
      include/mcl/vint.hpp

@ -280,9 +280,22 @@ she-wasm:
ecdsa-wasm:
$(MAKE) ../ecdsa-wasm/ecdsa_c.js
# test
bin/emu:
$(CXX) -g -o $@ src/fp.cpp src/bn_c256.cpp test/bn_c256_test.cpp -DMCL_DONT_USE_XBYAK -DMCL_DONT_USE_OPENSSL -DMCL_USE_VINT -DMCL_SIZEOF_UNIT=8 -DMCL_VINT_64BIT_PORTABLE -DMCL_VINT_FIXED_BUFFER -DMCL_MAX_BIT_SIZE=256 -I./include -I../cybozulib/include
# test
CLANG_WASM=-DNDEBUG -DMCLSHE_WIN_SIZE=8 -DCYBOZU_MINIMUM_EXCEPTION
CLANG_WASM+=-DMCL_SIZEOF_UNIT=8 -DMCL_MAX_BIT_SIZE=256
CLANG_WASM+=-DCYBOZU_DONT_USE_EXCEPTION -DCYBOZU_DONT_USE_STRING -DMCL_DONT_USE_CSRPNG
CLANG_WASM+=-O3 -Oz -target wasm32-wasm -fno-exceptions
CLANG_WASM+=-Wall -Wextra
CLANG_WASM+=-I./include -I../cybozulib/include -std=c++03
mcl-wasm-clang:
clang++-6.0 -c -o bin/fp.o src/fp.cpp $(CLANG_WASM)
clang++-6.0 -c -o bin/bn_c256.o src/bn_c256.cpp $(CLANG_WASM)
wasm-ld-6.0 -o bin/mcl256.wasm bin/fp.o bin/bn_c256.o -no-entry --strip-all --allow-undefined
clean:
$(RM) $(MCL_LIB) $(MCL_SLIB) $(BN256_LIB) $(BN256_SLIB) $(BN384_LIB) $(BN384_SLIB) $(BN512_LIB) $(BN512_SLIB) $(SHE256_LIB) $(OBJ_DIR)/*.o $(OBJ_DIR)/*.d $(EXE_DIR)/*.exe $(GEN_EXE) $(ASM_OBJ) $(LIB_OBJ) $(BN256_OBJ) $(BN384_OBJ) $(BN512_OBJ) $(LLVM_SRC) $(FUNC_LIST) src/*.ll

@ -31,6 +31,8 @@
#endif
#elif defined(__EMSCRIPTEN__) && !defined(MCLBN_DONT_EXPORT)
#define MCLBN_DLL_API __attribute__((used))
#elif defined(__wasm__) && !defined(MCLBN_DONT_EXPORT)
#define MCLBN_DLL_API __attribute__((visibility("default")))
#else
#define MCLBN_DLL_API
#endif

@ -21,7 +21,7 @@
#pragma warning(disable : 4512)
#pragma warning(disable : 4146)
#endif
#ifdef __EMSCRIPTEN__
#if defined(__EMSCRIPTEN__) || defined(__wasm__)
#define MCL_USE_VINT
#endif
#ifdef MCL_USE_VINT

@ -13,7 +13,7 @@
#ifndef MCL_MAX_BIT_SIZE
#define MCL_MAX_BIT_SIZE 521
#endif
#ifdef __EMSCRIPTEN__
#if defined(__EMSCRIPTEN__) || defined(__wasm__)
#define MCL_DONT_USE_XBYAK
#define MCL_DONT_USE_OPENSSL
#endif
@ -23,10 +23,6 @@
#define MCL_MAX_HASH_BIT_SIZE 512
#if CYBOZU_CPP_VERSION >= CYBOZU_CPP_VERSION_CPP11
#include <random>
#endif
namespace mcl {
/*

@ -26,6 +26,8 @@
#else
#ifdef __EMSCRIPTEN__
#define MCLSHE_DLL_API __attribute__((used))
#elif defined(__wasm__)
#define MCLSHE_DLL_API __attribute__((visibility("default")))
#else
#define MCLSHE_DLL_API
#endif

@ -14,7 +14,7 @@
#include <mcl/randgen.hpp>
#include <mcl/conversion.hpp>
#ifdef __EMSCRIPTEN__
#if defined(__EMSCRIPTEN__) || defined(__wasm__)
#define MCL_VINT_64BIT_PORTABLE
#define MCL_VINT_FIXED_BUFFER
#endif

Loading…
Cancel
Save