Skip to content

Commit

Permalink
Fix build bls
Browse files Browse the repository at this point in the history
  • Loading branch information
timemarkovqtum committed Sep 24, 2024
1 parent a3b8a9c commit fde0d01
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 8 deletions.
16 changes: 14 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
print-%: FORCE
@echo '$*'='$($*)'

DIST_SUBDIRS = secp256k1
DIST_SUBDIRS = secp256k1 blst

AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS) $(CORE_LDFLAGS)
AM_CXXFLAGS = $(CORE_CXXFLAGS) $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS) -DETH_FATDB=1
Expand All @@ -28,6 +28,7 @@ BITCOIN_INCLUDES=-I$(builddir) -I$(srcdir)/$(MINISKETCH_INCLUDE_DIR_INT) -I$(src

BITCOIN_INCLUDES += -I$(srcdir)/libff/libff
BITCOIN_INCLUDES += -I$(srcdir)/libff
BITCOIN_INCLUDES += -I$(srcdir)/blst/bindings
BITCOIN_INCLUDES += -I$(srcdir)/evmone/evmc/include
BITCOIN_INCLUDES += -I$(srcdir)/evmone/include
BITCOIN_INCLUDES += -I$(srcdir)/eth_client
Expand All @@ -45,6 +46,7 @@ LIBBITCOINQT=qt/libbitcoinqt.a
LIBSECP256K1=secp256k1/libsecp256k1.la
LIBCRYPTOPP=cryptopp/libcryptopp.a
LIBFF=libff/libff.a
LIBBLST=blst/libblst.a

if ENABLE_ZMQ
LIBBITCOIN_ZMQ=libbitcoin_zmq.a
Expand Down Expand Up @@ -82,6 +84,9 @@ noinst_LTLIBRARIES += $(LIBBITCOIN_CRYPTO)
$(LIBSECP256K1): $(wildcard secp256k1/src/*.h) $(wildcard secp256k1/src/*.c) $(wildcard secp256k1/include/*)
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)

$(LIBBLST):
CC='$(CC)' AR='$(AR)' $(MAKE) -C $(@D)

# Make is not made aware of per-object dependencies to avoid limiting building parallelization
# But to build the less dependent modules first, we manually select their order here:
EXTRA_LIBRARIES += \
Expand Down Expand Up @@ -785,6 +790,7 @@ libbitcoin_common_a_SOURCES = \
evmone/lib/evmone/baseline_instruction_table.cpp \
evmone/lib/evmone/baseline_instruction_table.hpp \
evmone/lib/evmone/constants.hpp \
evmone/lib/evmone/compat.hpp \
evmone/lib/evmone/eof.cpp \
evmone/lib/evmone/eof.hpp \
evmone/lib/evmone/execution_state.hpp \
Expand All @@ -798,6 +804,10 @@ libbitcoin_common_a_SOURCES = \
evmone/lib/evmone/tracing.hpp \
evmone/lib/evmone/vm.cpp \
evmone/lib/evmone/vm.hpp \
evmone/lib/evmone_precompiles/bls.cpp \
evmone/lib/evmone_precompiles/bls.hpp \
evmone/lib/evmone_precompiles/kzg.cpp \
evmone/lib/evmone_precompiles/kzg.hpp \
eth_client/libdevcore/Address.cpp \
eth_client/libdevcore/Address.h \
eth_client/libdevcore/Assertions.h \
Expand Down Expand Up @@ -1032,7 +1042,8 @@ qtum_bin_ldadd = \
$(LIBMEMENV) \
$(LIBCRYPTOPP) \
$(LIBFF) \
$(LIBSECP256K1)
$(LIBSECP256K1) \
$(LIBBLST)

qtum_bin_ldadd += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS) $(SQLITE_LIBS) $(GMP_LIBS) $(GMPXX_LIBS)

Expand Down Expand Up @@ -1320,6 +1331,7 @@ clean-local:
-rm -f cryptopp/*.o libff/*.o
-rm -f config.h
-rm -rf test/__pycache__
-$(MAKE) -C blst clean

.rc.o:
@test -f $(WINDRES) || (echo "windres $(WINDRES) not found, but is required to compile windows resource files"; exit 1)
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile.bench.include
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ bench_bench_qtum_LDADD = \
$(CRYPTO_LIBS) \
$(LIBFF) \
$(GMP_LIBS) \
$(GMPXX_LIBS)
$(GMPXX_LIBS) \
$(LIBBLST)

if ENABLE_ZMQ
bench_bench_qtum_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ qtum_qt_ldadd += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
endif
qtum_qt_ldadd += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(LIBSECP256K1) $(LIBCRYPTOPP) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS) $(LIBFF) $(GMP_LIBS) $(GMPXX_LIBS)
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS) $(LIBFF) $(LIBBLST) $(GMP_LIBS) $(GMPXX_LIBS)
qtum_qt_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
qtum_qt_libtoolflags = $(AM_LIBTOOLFLAGS) --tag CXX

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.qttest.include
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif
qt_test_test_qtum_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \
$(LIBMEMENV) $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) \
$(QR_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(LIBSECP256K1) $(LIBCRYPTOPP)\
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS) $(LIBFF) $(GMP_LIBS) $(GMPXX_LIBS)
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS) $(LIBFF) $(LIBBLST) $(GMP_LIBS) $(GMPXX_LIBS)
qt_test_test_qtum_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
qt_test_test_qtum_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)

Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ test_test_qtum_LDADD += $(LIBBITCOIN_NODE) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON
$(LIBLEVELDB) $(LIBMEMENV) $(BOOST_LIBS) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) $(MINISKETCH_LIBS) $(LIBCRYPTOPP) $(LIBSECP256K1)
test_test_qtum_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

test_test_qtum_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(SQLITE_LIBS) $(LIBFF) $(GMP_LIBS) $(GMPXX_LIBS)
test_test_qtum_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(SQLITE_LIBS) $(LIBFF) $(LIBBLST) $(GMP_LIBS) $(GMPXX_LIBS)
test_test_qtum_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) -static

if ENABLE_ZMQ
Expand All @@ -304,7 +304,7 @@ endif
if ENABLE_FUZZ_BINARY
test_fuzz_fuzz_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
test_fuzz_fuzz_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
test_fuzz_fuzz_LDADD = $(FUZZ_SUITE_LD_COMMON) $(LIBCRYPTOPP) $(LIBFF) $(GMP_LIBS) $(GMPXX_LIBS)
test_fuzz_fuzz_LDADD = $(FUZZ_SUITE_LD_COMMON) $(LIBCRYPTOPP) $(LIBFF) $(LIBBLST) $(GMP_LIBS) $(GMPXX_LIBS)
test_fuzz_fuzz_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
test_fuzz_fuzz_SOURCES = \
$(FUZZ_WALLET_SRC) \
Expand Down
28 changes: 28 additions & 0 deletions src/blst/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
###############################################################################
# Configuration
###############################################################################

# Settings for blst.
BLST_DIR = .
BLST_BUILDSCRIPT = ./build.sh
BLST_BUILDSCRIPT_FLAGS = -D__BLST_PORTABLE__

###############################################################################
# Core
###############################################################################

# This will build blst without condition.
.PHONY: build_blst
build_blst: $(BLST_BUILDSCRIPT)
@echo "[+] building blst"
@cd $(dir $(BLST_BUILDSCRIPT)) && \
./$(notdir $(BLST_BUILDSCRIPT)) $(BLST_BUILDSCRIPT_FLAGS)

###############################################################################
# Cleanup
###############################################################################

.PHONY: clean
clean:
@echo "[+] cleaning"
@rm -f *.o *.a
2 changes: 1 addition & 1 deletion src/evmone

0 comments on commit fde0d01

Please sign in to comment.