prysm-pulse/third_party/herumi/mcl.BUILD
Preston Van Loon edb6590764
Build herumi's BLS from source (#5055)
* Build herumi from source. Working so far on linux_amd64 for compile, but tests fail to initialize the curve appropriately

* Add copts to go_default_library

* llvm toolchain, still WIP

* Fixes, make llvm a config flag

* fix gazelle resolution

* comment

* comment

* update herumi to the v0.9.4 version

* Apply @nisdas patch from https://github.com/herumi/bls-eth-go-binary/pull/5
2020-03-09 21:22:41 -05:00

81 lines
1.8 KiB
Plaintext

package(default_visibility = ["//visibility:public"])
MCL_OPTS = [
"-DMCL_USE_VINT",
"-DMCL_DONT_USE_OPENSSL",
"-DMCL_LLVM_BMI2=0",
"-DMCL_USE_LLVM=1",
"-DMCL_VINT_FIXED_BUFFER",
"-DMCL_SIZEOF_UNIT=8",
"-DMCL_MAX_BIT_SIZE=384",
"-DCYBOZU_DONT_USE_EXCEPTION",
"-DCYBOZU_DONT_USE_STRING",
"-std=c++03 ",
]
cc_library(
name = "fp",
srcs = [
"src/fp.cpp",
"src/asm/x86-64.s",
],
includes = [
"include",
],
hdrs = glob([
"src/xbyak/*.h",
"include/cybozu/*.hpp",
]) + [
"include/mcl/op.hpp",
"include/mcl/gmp_util.hpp",
"include/mcl/vint.hpp",
"include/mcl/randgen.hpp",
"include/mcl/array.hpp",
"include/mcl/util.hpp",
"include/mcl/fp_tower.hpp",
"include/mcl/fp.hpp",
"include/mcl/conversion.hpp",
"src/low_func.hpp",
"src/fp_generator.hpp",
"src/proto.hpp",
"src/low_func_llvm.hpp",
],
copts = MCL_OPTS,
)
cc_library(
name = "bn",
srcs = [
"src/bn_c384_256.cpp",
],
deps = [":fp"],
hdrs = [
"include/mcl/bn.h",
"include/mcl/curve_type.h",
"include/mcl/impl/bn_c_impl.hpp",
"include/mcl/bls12_381.hpp",
"include/mcl/bn_c384_256.h",
"include/mcl/ec.hpp",
"include/mcl/mapto_wb19.hpp",
"include/mcl/ecparam.hpp",
"include/mcl/lagrange.hpp",
"include/mcl/bn.hpp",
"include/mcl/operator.hpp",
],
includes = ["include"],
copts = MCL_OPTS,
)
# src_gen is a tool to generate some llvm assembly language file.
cc_binary(
name = "src_gen",
srcs = [
"src/gen.cpp",
"src/llvm_gen.hpp",
] + glob([
"include/cybozu/*.hpp",
"include/mcl/*.hpp",
]),
includes = ["include"],
)