From 1392e8e2d8cfe4115f0a152aca16ffe3f0f4573a Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Thu, 10 Mar 2022 15:38:34 -0500 Subject: build: Don't add unrelated libs to LIBTEST_* This was used to, in effect, manually emulate --start-group/--end-group. However, we can just order the libraries correctly and avoid specifying libraries multiple times on the link line. Note: lld (not ld.bfd) knows how to resolve out-of-order references and doesn't seem to need the reodering --- src/Makefile.bench.include | 2 +- src/Makefile.test_fuzz.include | 5 ----- src/Makefile.test_util.include | 5 ----- 3 files changed, 1 insertion(+), 11 deletions(-) (limited to 'src') diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index 5dae4374e3..80773e2764 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -52,13 +52,13 @@ nodist_bench_bench_bitcoin_SOURCES = $(GENERATED_BENCH_FILES) bench_bench_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS) -I$(builddir)/bench/ bench_bench_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) bench_bench_bitcoin_LDADD = \ + $(LIBTEST_UTIL) \ $(LIBBITCOIN_NODE) \ $(LIBBITCOIN_WALLET) \ $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_CONSENSUS) \ $(LIBBITCOIN_CRYPTO) \ - $(LIBTEST_UTIL) \ $(LIBLEVELDB) \ $(LIBLEVELDB_SSE42) \ $(LIBMEMENV) \ diff --git a/src/Makefile.test_fuzz.include b/src/Makefile.test_fuzz.include index 9574454fd2..8922dda3ad 100644 --- a/src/Makefile.test_fuzz.include +++ b/src/Makefile.test_fuzz.include @@ -18,8 +18,3 @@ libtest_fuzz_a_SOURCES = \ test/fuzz/fuzz.cpp \ test/fuzz/util.cpp \ $(TEST_FUZZ_H) - -LIBTEST_FUZZ += $(LIBBITCOIN_NODE) -LIBTEST_FUZZ += $(LIBBITCOIN_COMMON) -LIBTEST_FUZZ += $(LIBBITCOIN_UTIL) -LIBTEST_FUZZ += $(LIBBITCOIN_CRYPTO_BASE) diff --git a/src/Makefile.test_util.include b/src/Makefile.test_util.include index 92cb8a5ce6..9306bb6fcc 100644 --- a/src/Makefile.test_util.include +++ b/src/Makefile.test_util.include @@ -34,8 +34,3 @@ libtest_util_a_SOURCES = \ test/util/validation.cpp \ test/util/wallet.cpp \ $(TEST_UTIL_H) - -LIBTEST_UTIL += $(LIBBITCOIN_NODE) -LIBTEST_UTIL += $(LIBBITCOIN_COMMON) -LIBTEST_UTIL += $(LIBBITCOIN_UTIL) -LIBTEST_UTIL += $(LIBBITCOIN_CRYPTO_BASE) -- cgit v1.2.3 From 64caf944797bc35c3044fe5675389656f9511a41 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 15 Mar 2022 21:52:29 -0400 Subject: build: Remove vestigial LIBLEVELDB_SSE42 - LIBLEVELDB_SSE42_INT was defined, but never referenced anywhere - LIBLEVELDB_SSE42 is referenced, but never defined anywhere Apparently leveldb used to have platform-specific crc32 code before it got split off into a separate lib. --- src/Makefile.am | 2 -- src/Makefile.bench.include | 1 - src/Makefile.crc32c.include | 1 - src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 3 +-- 6 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index c089bed0c9..abcfda2a3f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -681,7 +681,6 @@ bitcoin_bin_ldadd = \ $(LIBBITCOIN_CONSENSUS) \ $(LIBBITCOIN_CRYPTO) \ $(LIBLEVELDB) \ - $(LIBLEVELDB_SSE42) \ $(LIBMEMENV) \ $(LIBSECP256K1) @@ -868,7 +867,6 @@ bitcoin_chainstate_LDADD = \ $(LIBUNIVALUE) \ $(LIBSECP256K1) \ $(LIBLEVELDB) \ - $(LIBLEVELDB_SSE42) \ $(LIBMEMENV) # Required for obj/build.h to be generated first. diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index 80773e2764..6fa9a4efa9 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -60,7 +60,6 @@ bench_bench_bitcoin_LDADD = \ $(LIBBITCOIN_CONSENSUS) \ $(LIBBITCOIN_CRYPTO) \ $(LIBLEVELDB) \ - $(LIBLEVELDB_SSE42) \ $(LIBMEMENV) \ $(LIBSECP256K1) \ $(LIBUNIVALUE) \ diff --git a/src/Makefile.crc32c.include b/src/Makefile.crc32c.include index 3cbe71792c..67604cf08a 100644 --- a/src/Makefile.crc32c.include +++ b/src/Makefile.crc32c.include @@ -3,7 +3,6 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. LIBCRC32C_INT = crc32c/libcrc32c.a -LIBLEVELDB_SSE42_INT = leveldb/libleveldb_sse42.a EXTRA_LIBRARIES += $(LIBCRC32C_INT) diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 3491f07ee0..72037b3db2 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -330,7 +330,7 @@ endif if ENABLE_ZMQ bitcoin_qt_ldadd += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif -bitcoin_qt_ldadd += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) \ +bitcoin_qt_ldadd += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(LIBSECP256K1) \ $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS) bitcoin_qt_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 29c322fbc2..fa822f2954 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -55,7 +55,7 @@ if ENABLE_ZMQ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \ - $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(QT_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) \ + $(LIBMEMENV) $(QT_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) \ $(QR_LIBS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(LIBSECP256K1) \ $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS) qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 96a9a74802..19c1a108d9 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -47,7 +47,6 @@ FUZZ_SUITE_LD_COMMON = \ $(LIBBITCOIN_CLI) \ $(LIBUNIVALUE) \ $(LIBLEVELDB) \ - $(LIBLEVELDB_SSE42) \ $(LIBMEMENV) \ $(LIBSECP256K1) \ $(MINISKETCH_LIBS) \ @@ -204,7 +203,7 @@ test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) endif test_test_bitcoin_LDADD += $(LIBBITCOIN_NODE) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \ - $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) $(MINISKETCH_LIBS) + $(LIBLEVELDB) $(LIBMEMENV) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) $(MINISKETCH_LIBS) test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) test_test_bitcoin_LDADD += $(BDB_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(SQLITE_LIBS) -- cgit v1.2.3 From 05d1525b6d4412f68ff4c5460cd1daa6fb49969b Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 21 Dec 2021 20:31:00 -0500 Subject: build: Create .la library for crc32c Libtool will yell at you if you try to link a shared library against static ones. This change creates a libtool archive library for crc32c and allows a shared library to be linked against it portably. Also specify -static in both: - ..._la_CXXFLAGS so that libtool will avoid building two versions of each object (one PIC, one non-PIC). We just need the one that is suitable for static linking. - ..._la_LDFLAGS so that libtool will create a static library. [META] This change is done in preparation for a future commit where we link the libbitcoinkernel library against this one. --- src/Makefile.crc32c.include | 64 +++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/Makefile.crc32c.include b/src/Makefile.crc32c.include index 67604cf08a..c4dd84991d 100644 --- a/src/Makefile.crc32c.include +++ b/src/Makefile.crc32c.include @@ -2,9 +2,9 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -LIBCRC32C_INT = crc32c/libcrc32c.a +LIBCRC32C_INT = crc32c/libcrc32c.la -EXTRA_LIBRARIES += $(LIBCRC32C_INT) +noinst_LTLIBRARIES += $(LIBCRC32C_INT) LIBCRC32C = $(LIBCRC32C_INT) @@ -33,41 +33,49 @@ else CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=0 endif -crc32c_libcrc32c_a_CPPFLAGS = $(AM_CPPFLAGS) $(CRC32C_CPPFLAGS_INT) $(CRC32C_CPPFLAGS) -crc32c_libcrc32c_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) - -crc32c_libcrc32c_a_SOURCES = -crc32c_libcrc32c_a_SOURCES += crc32c/include/crc32c/crc32c.h -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_arm64.h -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_arm64_check.h -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_internal.h -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_prefetch.h -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_read_le.h -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_round_up.h -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_sse42_check.h -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_sse42.h - -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c.cc -crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_portable.cc +crc32c_libcrc32c_la_CPPFLAGS = $(AM_CPPFLAGS) $(CRC32C_CPPFLAGS_INT) $(CRC32C_CPPFLAGS) + +# Specify -static in both CXXFLAGS and LDFLAGS so libtool will only build a +# static version of this library. We don't need a dynamic version, and a dynamic +# version can't be used on windows anyway because the library doesn't currently +# export DLL symbols. +crc32c_libcrc32c_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static +crc32c_libcrc32c_la_LDFLAGS = $(AM_LDFLAGS) -static + +crc32c_libcrc32c_la_SOURCES = +crc32c_libcrc32c_la_SOURCES += crc32c/include/crc32c/crc32c.h +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_arm64.h +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_arm64_check.h +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_internal.h +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_prefetch.h +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_read_le.h +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_round_up.h +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_sse42_check.h +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_sse42.h + +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c.cc +crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_portable.cc if ENABLE_SSE42 -LIBCRC32C_SSE42_INT = crc32c/libcrc32c_sse42.a -EXTRA_LIBRARIES += $(LIBCRC32C_SSE42_INT) +LIBCRC32C_SSE42_INT = crc32c/libcrc32c_sse42.la +noinst_LTLIBRARIES += $(LIBCRC32C_SSE42_INT) LIBCRC32C += $(LIBCRC32C_SSE42_INT) -crc32c_libcrc32c_sse42_a_CPPFLAGS = $(crc32c_libcrc32c_a_CPPFLAGS) -crc32c_libcrc32c_sse42_a_CXXFLAGS = $(crc32c_libcrc32c_a_CXXFLAGS) $(SSE42_CXXFLAGS) +crc32c_libcrc32c_sse42_la_CPPFLAGS = $(crc32c_libcrc32c_la_CPPFLAGS) +crc32c_libcrc32c_sse42_la_CXXFLAGS = $(crc32c_libcrc32c_la_CXXFLAGS) $(SSE42_CXXFLAGS) +crc32c_libcrc32c_sse42_la_LDFLAGS = $(crc32c_libcrc32c_la_LDFLAGS) -crc32c_libcrc32c_sse42_a_SOURCES = crc32c/src/crc32c_sse42.cc +crc32c_libcrc32c_sse42_la_SOURCES = crc32c/src/crc32c_sse42.cc endif if ENABLE_ARM_CRC -LIBCRC32C_ARM_CRC_INT = crc32c/libcrc32c_arm_crc.a -EXTRA_LIBRARIES += $(LIBCRC32C_ARM_CRC_INT) +LIBCRC32C_ARM_CRC_INT = crc32c/libcrc32c_arm_crc.la +noinst_LTLIBRARIES += $(LIBCRC32C_ARM_CRC_INT) LIBCRC32C += $(LIBCRC32C_ARM_CRC_INT) -crc32c_libcrc32c_arm_crc_a_CPPFLAGS = $(crc32c_libcrc32c_a_CPPFLAGS) -crc32c_libcrc32c_arm_crc_a_CXXFLAGS = $(crc32c_libcrc32c_a_CXXFLAGS) $(ARM_CRC_CXXFLAGS) +crc32c_libcrc32c_arm_crc_la_CPPFLAGS = $(crc32c_libcrc32c_la_CPPFLAGS) +crc32c_libcrc32c_arm_crc_la_CXXFLAGS = $(crc32c_libcrc32c_la_CXXFLAGS) $(ARM_CRC_CXXFLAGS) +crc32c_libcrc32c_arm_crc_la_LDFLAGS = $(crc32c_libcrc32c_la_LDFLAGS) -crc32c_libcrc32c_arm_crc_a_SOURCES = crc32c/src/crc32c_arm64.cc +crc32c_libcrc32c_arm_crc_la_SOURCES = crc32c/src/crc32c_arm64.cc endif -- cgit v1.2.3 From 8bdfe057c796dde1cd2e5a37a73e87a879e9fe56 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 21 Dec 2021 20:31:00 -0500 Subject: build: Create .la library for leveldb Libtool will yell at you if you try to link a shared library against static ones. This change creates a libtool archive library for leveldb and allows a shared library to be linked against it portably. Also specify -static in both: - ..._la_CXXFLAGS so that libtool will avoid building two versions of each object (one PIC, one non-PIC). We just need the one that is suitable for static linking. - ..._la_LDFLAGS so that libtool will create a static library. If we don't specify this, then libtool will build two versions of each object and prefer the non-static PIC version of the object, which is built with -DDLL_EXPORT -DPIC for mingw-w64 targets. This can cause symbol resolution problems when we link this library against an executable that does specify -all-static, since that will be built without the -DDLL_EXPORT flag. This is especially important for leveldb and memenv since they link against libwinpthreads, which has difference symbols depending on whether DLL_EXPORT is defined or not. [META] This change is done in preparation for a future commit where we link the libbitcoinkernel library against this one. Appendix: The specific linker errors when linking memenv built without -all-static against a bitcoind with -all-static look like: x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `__gthread_mutex_unlock': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `__gthread_mutex_unlock': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `__gthread_mutex_unlock': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `__gthread_mutex_unlock': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/leveldb/helpers/memenv/memenv.cc:230: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `__gthread_mutex_unlock': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/leveldb/helpers/memenv/memenv.cc:230: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `__gthread_mutex_unlock': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `__gthread_mutex_unlock': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `__gthread_mutex_unlock': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `__gthread_mutex_unlock': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/leveldb/helpers/memenv/memenv.cc:285: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/stl_map.h:501: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:733: undefined reference to `__imp_pthread_mutex_init' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `std::_Vector_base >::_Vector_impl_data::_Vector_impl_data()': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/stl_vector.h:97: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `std::mutex::lock()': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/std_mutex.h:104: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `leveldb::Status::IOError(leveldb::Slice const&, leveldb::Slice const&)': /distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/./leveldb/include/leveldb/status.h:53: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `leveldb::Status::IOError(leveldb::Slice const&, leveldb::Slice const&)': /distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/./leveldb/include/leveldb/status.h:53: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `leveldb::Status::IOError(leveldb::Slice const&, leveldb::Slice const&)': /distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/./leveldb/include/leveldb/status.h:53: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/stl_map.h:1069: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/stl_tree.h:350: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `leveldb::Status::IOError(leveldb::Slice const&, leveldb::Slice const&)': /distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/./leveldb/include/leveldb/status.h:53: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/./leveldb/include/leveldb/status.h:53: more undefined references to `__imp_pthread_mutex_unlock' follow x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `std::mutex::lock()': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/std_mutex.h:104: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/stl_map.h:1069: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `leveldb::Status::IOError(leveldb::Slice const&, leveldb::Slice const&)': /distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/./leveldb/include/leveldb/status.h:53: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:740: undefined reference to `__imp_pthread_mutex_destroy' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `std::mutex::lock()': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/std_mutex.h:100: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/distsrc-base/distsrc-99874bd94511-x86_64-w64-mingw32/src/leveldb/helpers/memenv/memenv.cc:268: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:733: undefined reference to `__imp_pthread_mutex_init' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `std::_Vector_base >::_Vector_impl_data::_Vector_impl_data()': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/stl_vector.h:97: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o): in function `std::mutex::lock()': /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/std_mutex.h:104: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: /gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/bits/std_mutex.h:104: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:733: undefined reference to `__imp_pthread_mutex_init' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749: undefined reference to `__imp_pthread_mutex_lock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' x86_64-w64-mingw32-ld: leveldb/.libs/libmemenv.a(libmemenv_la-memenv.o):/gnu/store/yn52na8xbgzpiq7fdpm9pfyyf5w3z60m-gcc-cross-x86_64-w64-mingw32-10.3.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779: undefined reference to `__imp_pthread_mutex_unlock' --- src/Makefile.leveldb.include | 217 ++++++++++++++++++++++--------------------- 1 file changed, 112 insertions(+), 105 deletions(-) (limited to 'src') diff --git a/src/Makefile.leveldb.include b/src/Makefile.leveldb.include index 3bec92482a..066f8940c5 100644 --- a/src/Makefile.leveldb.include +++ b/src/Makefile.leveldb.include @@ -2,11 +2,11 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -LIBLEVELDB_INT = leveldb/libleveldb.a -LIBMEMENV_INT = leveldb/libmemenv.a +LIBLEVELDB_INT = leveldb/libleveldb.la +LIBMEMENV_INT = leveldb/libmemenv.la -EXTRA_LIBRARIES += $(LIBLEVELDB_INT) -EXTRA_LIBRARIES += $(LIBMEMENV_INT) +noinst_LTLIBRARIES += $(LIBLEVELDB_INT) +noinst_LTLIBRARIES += $(LIBMEMENV_INT) LIBLEVELDB = $(LIBLEVELDB_INT) $(LIBCRC32C) LIBMEMENV = $(LIBMEMENV_INT) @@ -37,111 +37,118 @@ else LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_POSIX endif -leveldb_libleveldb_a_CPPFLAGS = $(AM_CPPFLAGS) $(LEVELDB_CPPFLAGS_INT) $(LEVELDB_CPPFLAGS) -leveldb_libleveldb_a_CXXFLAGS = $(filter-out -Wconditional-uninitialized -Werror=conditional-uninitialized -Wsuggest-override -Werror=suggest-override, $(AM_CXXFLAGS)) $(PIE_FLAGS) +leveldb_libleveldb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LEVELDB_CPPFLAGS_INT) $(LEVELDB_CPPFLAGS) -leveldb_libleveldb_a_SOURCES= -leveldb_libleveldb_a_SOURCES += leveldb/port/port_stdcxx.h -leveldb_libleveldb_a_SOURCES += leveldb/port/port.h -leveldb_libleveldb_a_SOURCES += leveldb/port/thread_annotations.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/db.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/options.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/comparator.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/filter_policy.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/slice.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/table_builder.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/env.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/export.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/c.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/iterator.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/cache.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/dumpfile.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/table.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/write_batch.h -leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/status.h -leveldb_libleveldb_a_SOURCES += leveldb/db/log_format.h -leveldb_libleveldb_a_SOURCES += leveldb/db/memtable.h -leveldb_libleveldb_a_SOURCES += leveldb/db/version_set.h -leveldb_libleveldb_a_SOURCES += leveldb/db/write_batch_internal.h -leveldb_libleveldb_a_SOURCES += leveldb/db/filename.h -leveldb_libleveldb_a_SOURCES += leveldb/db/version_edit.h -leveldb_libleveldb_a_SOURCES += leveldb/db/dbformat.h -leveldb_libleveldb_a_SOURCES += leveldb/db/builder.h -leveldb_libleveldb_a_SOURCES += leveldb/db/log_writer.h -leveldb_libleveldb_a_SOURCES += leveldb/db/db_iter.h -leveldb_libleveldb_a_SOURCES += leveldb/db/skiplist.h -leveldb_libleveldb_a_SOURCES += leveldb/db/db_impl.h -leveldb_libleveldb_a_SOURCES += leveldb/db/table_cache.h -leveldb_libleveldb_a_SOURCES += leveldb/db/snapshot.h -leveldb_libleveldb_a_SOURCES += leveldb/db/log_reader.h -leveldb_libleveldb_a_SOURCES += leveldb/table/filter_block.h -leveldb_libleveldb_a_SOURCES += leveldb/table/block_builder.h -leveldb_libleveldb_a_SOURCES += leveldb/table/block.h -leveldb_libleveldb_a_SOURCES += leveldb/table/two_level_iterator.h -leveldb_libleveldb_a_SOURCES += leveldb/table/merger.h -leveldb_libleveldb_a_SOURCES += leveldb/table/format.h -leveldb_libleveldb_a_SOURCES += leveldb/table/iterator_wrapper.h -leveldb_libleveldb_a_SOURCES += leveldb/util/crc32c.h -leveldb_libleveldb_a_SOURCES += leveldb/util/env_posix_test_helper.h -leveldb_libleveldb_a_SOURCES += leveldb/util/env_windows_test_helper.h -leveldb_libleveldb_a_SOURCES += leveldb/util/arena.h -leveldb_libleveldb_a_SOURCES += leveldb/util/random.h -leveldb_libleveldb_a_SOURCES += leveldb/util/posix_logger.h -leveldb_libleveldb_a_SOURCES += leveldb/util/hash.h -leveldb_libleveldb_a_SOURCES += leveldb/util/histogram.h -leveldb_libleveldb_a_SOURCES += leveldb/util/coding.h -leveldb_libleveldb_a_SOURCES += leveldb/util/testutil.h -leveldb_libleveldb_a_SOURCES += leveldb/util/mutexlock.h -leveldb_libleveldb_a_SOURCES += leveldb/util/logging.h -leveldb_libleveldb_a_SOURCES += leveldb/util/no_destructor.h -leveldb_libleveldb_a_SOURCES += leveldb/util/testharness.h -leveldb_libleveldb_a_SOURCES += leveldb/util/windows_logger.h +# Specify -static in both CXXFLAGS and LDFLAGS so libtool will only build a +# static version of this library. We don't need a dynamic version, and a dynamic +# version can't be used on windows anyway because the library doesn't currently +# export DLL symbols. +leveldb_libleveldb_la_CXXFLAGS = $(filter-out -Wconditional-uninitialized -Werror=conditional-uninitialized -Wsuggest-override -Werror=suggest-override, $(AM_CXXFLAGS)) $(PIE_FLAGS) -static +leveldb_libleveldb_la_LDFLAGS = $(AM_LDFLAGS) -static -leveldb_libleveldb_a_SOURCES += leveldb/db/builder.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/c.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/dbformat.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/db_impl.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/db_iter.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/dumpfile.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/filename.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/log_reader.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/log_writer.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/memtable.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/repair.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/table_cache.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/version_edit.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/version_set.cc -leveldb_libleveldb_a_SOURCES += leveldb/db/write_batch.cc -leveldb_libleveldb_a_SOURCES += leveldb/table/block_builder.cc -leveldb_libleveldb_a_SOURCES += leveldb/table/block.cc -leveldb_libleveldb_a_SOURCES += leveldb/table/filter_block.cc -leveldb_libleveldb_a_SOURCES += leveldb/table/format.cc -leveldb_libleveldb_a_SOURCES += leveldb/table/iterator.cc -leveldb_libleveldb_a_SOURCES += leveldb/table/merger.cc -leveldb_libleveldb_a_SOURCES += leveldb/table/table_builder.cc -leveldb_libleveldb_a_SOURCES += leveldb/table/table.cc -leveldb_libleveldb_a_SOURCES += leveldb/table/two_level_iterator.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/arena.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/bloom.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/cache.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/coding.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/comparator.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/crc32c.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/env.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/filter_policy.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/hash.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/histogram.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/logging.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/options.cc -leveldb_libleveldb_a_SOURCES += leveldb/util/status.cc +leveldb_libleveldb_la_SOURCES= +leveldb_libleveldb_la_SOURCES += leveldb/port/port_stdcxx.h +leveldb_libleveldb_la_SOURCES += leveldb/port/port.h +leveldb_libleveldb_la_SOURCES += leveldb/port/thread_annotations.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/db.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/options.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/comparator.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/filter_policy.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/slice.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/table_builder.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/env.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/export.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/c.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/iterator.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/cache.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/dumpfile.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/table.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/write_batch.h +leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/status.h +leveldb_libleveldb_la_SOURCES += leveldb/db/log_format.h +leveldb_libleveldb_la_SOURCES += leveldb/db/memtable.h +leveldb_libleveldb_la_SOURCES += leveldb/db/version_set.h +leveldb_libleveldb_la_SOURCES += leveldb/db/write_batch_internal.h +leveldb_libleveldb_la_SOURCES += leveldb/db/filename.h +leveldb_libleveldb_la_SOURCES += leveldb/db/version_edit.h +leveldb_libleveldb_la_SOURCES += leveldb/db/dbformat.h +leveldb_libleveldb_la_SOURCES += leveldb/db/builder.h +leveldb_libleveldb_la_SOURCES += leveldb/db/log_writer.h +leveldb_libleveldb_la_SOURCES += leveldb/db/db_iter.h +leveldb_libleveldb_la_SOURCES += leveldb/db/skiplist.h +leveldb_libleveldb_la_SOURCES += leveldb/db/db_impl.h +leveldb_libleveldb_la_SOURCES += leveldb/db/table_cache.h +leveldb_libleveldb_la_SOURCES += leveldb/db/snapshot.h +leveldb_libleveldb_la_SOURCES += leveldb/db/log_reader.h +leveldb_libleveldb_la_SOURCES += leveldb/table/filter_block.h +leveldb_libleveldb_la_SOURCES += leveldb/table/block_builder.h +leveldb_libleveldb_la_SOURCES += leveldb/table/block.h +leveldb_libleveldb_la_SOURCES += leveldb/table/two_level_iterator.h +leveldb_libleveldb_la_SOURCES += leveldb/table/merger.h +leveldb_libleveldb_la_SOURCES += leveldb/table/format.h +leveldb_libleveldb_la_SOURCES += leveldb/table/iterator_wrapper.h +leveldb_libleveldb_la_SOURCES += leveldb/util/crc32c.h +leveldb_libleveldb_la_SOURCES += leveldb/util/env_posix_test_helper.h +leveldb_libleveldb_la_SOURCES += leveldb/util/env_windows_test_helper.h +leveldb_libleveldb_la_SOURCES += leveldb/util/arena.h +leveldb_libleveldb_la_SOURCES += leveldb/util/random.h +leveldb_libleveldb_la_SOURCES += leveldb/util/posix_logger.h +leveldb_libleveldb_la_SOURCES += leveldb/util/hash.h +leveldb_libleveldb_la_SOURCES += leveldb/util/histogram.h +leveldb_libleveldb_la_SOURCES += leveldb/util/coding.h +leveldb_libleveldb_la_SOURCES += leveldb/util/testutil.h +leveldb_libleveldb_la_SOURCES += leveldb/util/mutexlock.h +leveldb_libleveldb_la_SOURCES += leveldb/util/logging.h +leveldb_libleveldb_la_SOURCES += leveldb/util/no_destructor.h +leveldb_libleveldb_la_SOURCES += leveldb/util/testharness.h +leveldb_libleveldb_la_SOURCES += leveldb/util/windows_logger.h + +leveldb_libleveldb_la_SOURCES += leveldb/db/builder.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/c.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/dbformat.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/db_impl.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/db_iter.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/dumpfile.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/filename.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/log_reader.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/log_writer.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/memtable.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/repair.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/table_cache.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/version_edit.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/version_set.cc +leveldb_libleveldb_la_SOURCES += leveldb/db/write_batch.cc +leveldb_libleveldb_la_SOURCES += leveldb/table/block_builder.cc +leveldb_libleveldb_la_SOURCES += leveldb/table/block.cc +leveldb_libleveldb_la_SOURCES += leveldb/table/filter_block.cc +leveldb_libleveldb_la_SOURCES += leveldb/table/format.cc +leveldb_libleveldb_la_SOURCES += leveldb/table/iterator.cc +leveldb_libleveldb_la_SOURCES += leveldb/table/merger.cc +leveldb_libleveldb_la_SOURCES += leveldb/table/table_builder.cc +leveldb_libleveldb_la_SOURCES += leveldb/table/table.cc +leveldb_libleveldb_la_SOURCES += leveldb/table/two_level_iterator.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/arena.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/bloom.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/cache.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/coding.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/comparator.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/crc32c.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/env.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/filter_policy.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/hash.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/histogram.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/logging.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/options.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/status.cc if TARGET_WINDOWS -leveldb_libleveldb_a_SOURCES += leveldb/util/env_windows.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/env_windows.cc else -leveldb_libleveldb_a_SOURCES += leveldb/util/env_posix.cc +leveldb_libleveldb_la_SOURCES += leveldb/util/env_posix.cc endif -leveldb_libmemenv_a_CPPFLAGS = $(leveldb_libleveldb_a_CPPFLAGS) -leveldb_libmemenv_a_CXXFLAGS = $(leveldb_libleveldb_a_CXXFLAGS) -leveldb_libmemenv_a_SOURCES = leveldb/helpers/memenv/memenv.cc -leveldb_libmemenv_a_SOURCES += leveldb/helpers/memenv/memenv.h +leveldb_libmemenv_la_CPPFLAGS = $(leveldb_libleveldb_la_CPPFLAGS) +leveldb_libmemenv_la_CXXFLAGS = $(leveldb_libleveldb_la_CXXFLAGS) +leveldb_libmemenv_la_LDFLAGS = $(leveldb_libleveldb_la_LDFLAGS) +leveldb_libmemenv_la_SOURCES = leveldb/helpers/memenv/memenv.cc +leveldb_libmemenv_la_SOURCES += leveldb/helpers/memenv/memenv.h -- cgit v1.2.3 From c1e16cb31f4d8edde8fea310011189b8b272cb07 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 22 Dec 2021 01:16:00 -0500 Subject: build: Create .la library for bitcoincrypto Libtool will yell at you if you try to link a shared library against static ones. This change creates a libtool archive library for bitcoincrypto and allows a shared library to be linked against it portably. Also specify -static in both: - ..._la_CXXFLAGS so that libtool will avoid building two versions of each object (one PIC, one non-PIC). We just need the one that is suitable for static linking. - ..._la_LDFLAGS so that libtool will create a static library. [META] This change is done in preparation for a future commit where we link the libbitcoinkernel library against this one. --- src/Makefile.am | 105 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index abcfda2a3f..1b15cd109c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,6 +15,14 @@ AM_LIBTOOLFLAGS = --preserve-dup-deps PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) EXTRA_LIBRARIES = +lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS) +noinst_LTLIBRARIES = + +bin_PROGRAMS = +noinst_PROGRAMS = +TESTS = +BENCHMARKS = + BITCOIN_INCLUDES=-I$(builddir) -I$(srcdir)/$(MINISKETCH_INCLUDE_DIR_INT) -I$(srcdir)/secp256k1/include -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) LIBBITCOIN_NODE=libbitcoin_node.a @@ -22,7 +30,7 @@ LIBBITCOIN_COMMON=libbitcoin_common.a LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a LIBBITCOIN_CLI=libbitcoin_cli.a LIBBITCOIN_UTIL=libbitcoin_util.a -LIBBITCOIN_CRYPTO_BASE=crypto/libbitcoin_crypto_base.a +LIBBITCOIN_CRYPTO_BASE=crypto/libbitcoin_crypto_base.la LIBBITCOINQT=qt/libbitcoinqt.a LIBSECP256K1=secp256k1/libsecp256k1.la @@ -37,23 +45,24 @@ LIBBITCOIN_WALLET=libbitcoin_wallet.a LIBBITCOIN_WALLET_TOOL=libbitcoin_wallet_tool.a endif -LIBBITCOIN_CRYPTO= $(LIBBITCOIN_CRYPTO_BASE) +LIBBITCOIN_CRYPTO = $(LIBBITCOIN_CRYPTO_BASE) if ENABLE_SSE41 -LIBBITCOIN_CRYPTO_SSE41 = crypto/libbitcoin_crypto_sse41.a +LIBBITCOIN_CRYPTO_SSE41 = crypto/libbitcoin_crypto_sse41.la LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SSE41) endif if ENABLE_AVX2 -LIBBITCOIN_CRYPTO_AVX2 = crypto/libbitcoin_crypto_avx2.a +LIBBITCOIN_CRYPTO_AVX2 = crypto/libbitcoin_crypto_avx2.la LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_AVX2) endif if ENABLE_X86_SHANI -LIBBITCOIN_CRYPTO_X86_SHANI = crypto/libbitcoin_crypto_x86_shani.a +LIBBITCOIN_CRYPTO_X86_SHANI = crypto/libbitcoin_crypto_x86_shani.la LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_X86_SHANI) endif if ENABLE_ARM_SHANI -LIBBITCOIN_CRYPTO_ARM_SHANI = crypto/libbitcoin_crypto_arm_shani.a +LIBBITCOIN_CRYPTO_ARM_SHANI = crypto/libbitcoin_crypto_arm_shani.la LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_ARM_SHANI) endif +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) @@ -61,7 +70,6 @@ $(LIBSECP256K1): $(wildcard secp256k1/src/*.h) $(wildcard secp256k1/src/*.c) $(w # 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 += \ - $(LIBBITCOIN_CRYPTO) \ $(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_CONSENSUS) \ @@ -72,14 +80,6 @@ EXTRA_LIBRARIES += \ $(LIBBITCOIN_WALLET_TOOL) \ $(LIBBITCOIN_ZMQ) -lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS) -noinst_LTLIBRARIES = - -bin_PROGRAMS = -noinst_PROGRAMS = -TESTS = -BENCHMARKS = - if BUILD_BITCOIND bin_PROGRAMS += bitcoind endif @@ -462,9 +462,16 @@ libbitcoin_wallet_tool_a_SOURCES = \ $(BITCOIN_CORE_H) # crypto primitives library -crypto_libbitcoin_crypto_base_a_CPPFLAGS = $(AM_CPPFLAGS) -crypto_libbitcoin_crypto_base_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -crypto_libbitcoin_crypto_base_a_SOURCES = \ +crypto_libbitcoin_crypto_base_la_CPPFLAGS = $(AM_CPPFLAGS) + +# Specify -static in both CXXFLAGS and LDFLAGS so libtool will only build a +# static version of this library. We don't need a dynamic version, and a dynamic +# version can't be used on windows anyway because the library doesn't currently +# export DLL symbols. +crypto_libbitcoin_crypto_base_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static +crypto_libbitcoin_crypto_base_la_LDFLAGS = $(AM_LDFLAGS) -static + +crypto_libbitcoin_crypto_base_la_SOURCES = \ crypto/aes.cpp \ crypto/aes.h \ crypto/chacha_poly_aead.h \ @@ -496,32 +503,44 @@ crypto_libbitcoin_crypto_base_a_SOURCES = \ crypto/siphash.h if USE_ASM -crypto_libbitcoin_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp +crypto_libbitcoin_crypto_base_la_SOURCES += crypto/sha256_sse4.cpp endif -crypto_libbitcoin_crypto_sse41_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -crypto_libbitcoin_crypto_sse41_a_CPPFLAGS = $(AM_CPPFLAGS) -crypto_libbitcoin_crypto_sse41_a_CXXFLAGS += $(SSE41_CXXFLAGS) -crypto_libbitcoin_crypto_sse41_a_CPPFLAGS += -DENABLE_SSE41 -crypto_libbitcoin_crypto_sse41_a_SOURCES = crypto/sha256_sse41.cpp - -crypto_libbitcoin_crypto_avx2_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -crypto_libbitcoin_crypto_avx2_a_CPPFLAGS = $(AM_CPPFLAGS) -crypto_libbitcoin_crypto_avx2_a_CXXFLAGS += $(AVX2_CXXFLAGS) -crypto_libbitcoin_crypto_avx2_a_CPPFLAGS += -DENABLE_AVX2 -crypto_libbitcoin_crypto_avx2_a_SOURCES = crypto/sha256_avx2.cpp - -crypto_libbitcoin_crypto_x86_shani_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -crypto_libbitcoin_crypto_x86_shani_a_CPPFLAGS = $(AM_CPPFLAGS) -crypto_libbitcoin_crypto_x86_shani_a_CXXFLAGS += $(X86_SHANI_CXXFLAGS) -crypto_libbitcoin_crypto_x86_shani_a_CPPFLAGS += -DENABLE_X86_SHANI -crypto_libbitcoin_crypto_x86_shani_a_SOURCES = crypto/sha256_x86_shani.cpp - -crypto_libbitcoin_crypto_arm_shani_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -crypto_libbitcoin_crypto_arm_shani_a_CPPFLAGS = $(AM_CPPFLAGS) -crypto_libbitcoin_crypto_arm_shani_a_CXXFLAGS += $(ARM_SHANI_CXXFLAGS) -crypto_libbitcoin_crypto_arm_shani_a_CPPFLAGS += -DENABLE_ARM_SHANI -crypto_libbitcoin_crypto_arm_shani_a_SOURCES = crypto/sha256_arm_shani.cpp +# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and +# CXXFLAGS above +crypto_libbitcoin_crypto_sse41_la_LDFLAGS = $(AM_LDFLAGS) -static +crypto_libbitcoin_crypto_sse41_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static +crypto_libbitcoin_crypto_sse41_la_CPPFLAGS = $(AM_CPPFLAGS) +crypto_libbitcoin_crypto_sse41_la_CXXFLAGS += $(SSE41_CXXFLAGS) +crypto_libbitcoin_crypto_sse41_la_CPPFLAGS += -DENABLE_SSE41 +crypto_libbitcoin_crypto_sse41_la_SOURCES = crypto/sha256_sse41.cpp + +# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and +# CXXFLAGS above +crypto_libbitcoin_crypto_avx2_la_LDFLAGS = $(AM_LDFLAGS) -static +crypto_libbitcoin_crypto_avx2_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static +crypto_libbitcoin_crypto_avx2_la_CPPFLAGS = $(AM_CPPFLAGS) +crypto_libbitcoin_crypto_avx2_la_CXXFLAGS += $(AVX2_CXXFLAGS) +crypto_libbitcoin_crypto_avx2_la_CPPFLAGS += -DENABLE_AVX2 +crypto_libbitcoin_crypto_avx2_la_SOURCES = crypto/sha256_avx2.cpp + +# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and +# CXXFLAGS above +crypto_libbitcoin_crypto_x86_shani_la_LDFLAGS = $(AM_LDFLAGS) -static +crypto_libbitcoin_crypto_x86_shani_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static +crypto_libbitcoin_crypto_x86_shani_la_CPPFLAGS = $(AM_CPPFLAGS) +crypto_libbitcoin_crypto_x86_shani_la_CXXFLAGS += $(X86_SHANI_CXXFLAGS) +crypto_libbitcoin_crypto_x86_shani_la_CPPFLAGS += -DENABLE_X86_SHANI +crypto_libbitcoin_crypto_x86_shani_la_SOURCES = crypto/sha256_x86_shani.cpp + +# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and +# CXXFLAGS above +crypto_libbitcoin_crypto_arm_shani_la_LDFLAGS = $(AM_LDFLAGS) -static +crypto_libbitcoin_crypto_arm_shani_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static +crypto_libbitcoin_crypto_arm_shani_la_CPPFLAGS = $(AM_CPPFLAGS) +crypto_libbitcoin_crypto_arm_shani_la_CXXFLAGS += $(ARM_SHANI_CXXFLAGS) +crypto_libbitcoin_crypto_arm_shani_la_CPPFLAGS += -DENABLE_ARM_SHANI +crypto_libbitcoin_crypto_arm_shani_la_SOURCES = crypto/sha256_arm_shani.cpp # consensus: shared between all executables that validate any consensus rules. libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) @@ -877,7 +896,7 @@ bitcoin_chainstate-clientversion.$(OBJEXT): obj/build.h # bitcoinconsensus library # if BUILD_BITCOIN_LIBS include_HEADERS = script/bitcoinconsensus.h -libbitcoinconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_base_a_SOURCES) $(libbitcoin_consensus_a_SOURCES) +libbitcoinconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_base_la_SOURCES) $(libbitcoin_consensus_a_SOURCES) libbitcoinconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS) libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1) -- cgit v1.2.3 From 83a0bb7cc9907dbe089409ed5a417277ed63ed95 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 8 Feb 2022 17:06:21 -0500 Subject: build: Separate lib_LTLIBRARIES initialization Set lib_LTLIBRARIES with '=' to an empty value at the top of the Makefile.am and append to it from the library-local block for readability. Here's the error you get if you don't set lib_LTLIBRARIES to be empty: error: lib_LTLIBRARIES must be set with '=' before using '+=' [META] In a subsequent commit, we're going to introduce a library and append it to lib_LTLIBRARIES in its local block, this makes things more readable. --- src/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 1b15cd109c..d074e6314e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,7 +15,7 @@ AM_LIBTOOLFLAGS = --preserve-dup-deps PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) EXTRA_LIBRARIES = -lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS) +lib_LTLIBRARIES = noinst_LTLIBRARIES = bin_PROGRAMS = @@ -895,6 +895,8 @@ bitcoin_chainstate-clientversion.$(OBJEXT): obj/build.h # bitcoinconsensus library # if BUILD_BITCOIN_LIBS +lib_LTLIBRARIES += $(LIBBITCOINCONSENSUS) + include_HEADERS = script/bitcoinconsensus.h libbitcoinconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_base_la_SOURCES) $(libbitcoin_consensus_a_SOURCES) -- cgit v1.2.3 From 1df44dd20ca9e6e55eb353824b27d11bd1878c59 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Thu, 10 Feb 2022 21:38:32 -0500 Subject: b-cs: Define G_TRANSLATION_FUN in bitcoinkernel.cpp [META] This is done in preparation for extracting libbitcoinkernel in a following commit. It seems logical that generally users of a library shouldn't need to export its own symbols to use the library. --- src/Makefile.am | 1 + src/bitcoin-chainstate.cpp | 2 -- src/kernel/bitcoinkernel.cpp | 10 ++++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/kernel/bitcoinkernel.cpp (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index d074e6314e..11fded3c2e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -800,6 +800,7 @@ bitcoin_util_LDADD = \ # bitcoin-chainstate binary # bitcoin_chainstate_SOURCES = \ bitcoin-chainstate.cpp \ + kernel/bitcoinkernel.cpp \ arith_uint256.cpp \ blockfilter.cpp \ chain.cpp \ diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp index fcbb6aacce..81e8dfd9a0 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -28,8 +28,6 @@ #include #include -const std::function G_TRANSLATION_FUN = nullptr; - int main(int argc, char* argv[]) { // SETUP: Argument parsing and handling diff --git a/src/kernel/bitcoinkernel.cpp b/src/kernel/bitcoinkernel.cpp new file mode 100644 index 0000000000..bb101ba186 --- /dev/null +++ b/src/kernel/bitcoinkernel.cpp @@ -0,0 +1,10 @@ +// Copyright (c) 2022 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include + +// Define G_TRANSLATION_FUN symbol in libbitcoinkernel library so users of the +// library aren't required to export this symbol +extern const std::function G_TRANSLATION_FUN = nullptr; -- cgit v1.2.3 From 26b2e7ffb3471a4712e5b9e50e066e0e3218f0dd Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 21 Dec 2021 20:10:05 -0500 Subject: build: Extract the libbitcoinkernel library I strongly recommend reviewing with the following git-diff flags: --patience --color-moved=dimmed-zebra Extract out a libbitcoinkernel library linking in all files necessary for using our consensus engine as-is. Link bitcoin-chainstate against it. See previous commit "build: Add example bitcoin-chainstate executable" for more context. We explicitly specify -fvisibility=default, which effectively overrides the effects of --enable-reduced-exports since libbitcoinkernel requires default symbol visibility When compiling for mingw-w64, specify -static in both: - ..._la_CXXFLAGS so that libtool will avoid building two versions of each object (one PIC, one non-PIC). We just need the one that is suitable for static linking. - ..._la_LDFLAGS so that libtool will create a static library. If we don't specify this, then libtool will prefer the non-static PIC version of the object, which is built with -DDLL_EXPORT -DPIC for mingw-w64 targets. This can cause symbol resolution problems when we link this library against an executable that does specify -all-static, since that will be built without the -DDLL_EXPORT flag. Unfortunately, this means that for mingw-w64 we can only build a static version of the library for now. This will be fixed. However, on other targets, the shared library creation works fine. ----- Note to users: You need to either specify: --enable-experimental-util-chainstate or, --with-experimental-kernel-lib To build the libbitcionkernel library. See the configure help for more details. build shared libbitcoinkernel where we can --- src/Makefile.am | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 11fded3c2e..4121f1ca4c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,6 +29,7 @@ LIBBITCOIN_NODE=libbitcoin_node.a LIBBITCOIN_COMMON=libbitcoin_common.a LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a LIBBITCOIN_CLI=libbitcoin_cli.a +LIBBITCOIN_KERNEL=libbitcoin_kernel.a LIBBITCOIN_UTIL=libbitcoin_util.a LIBBITCOIN_CRYPTO_BASE=crypto/libbitcoin_crypto_base.la LIBBITCOINQT=qt/libbitcoinqt.a @@ -40,6 +41,9 @@ endif if BUILD_BITCOIN_LIBS LIBBITCOINCONSENSUS=libbitcoinconsensus.la endif +if BUILD_BITCOIN_KERNEL_LIB +LIBBITCOINKERNEL=libbitcoinkernel.la +endif if ENABLE_WALLET LIBBITCOIN_WALLET=libbitcoin_wallet.a LIBBITCOIN_WALLET_TOOL=libbitcoin_wallet_tool.a @@ -798,8 +802,39 @@ bitcoin_util_LDADD = \ # # bitcoin-chainstate binary # -bitcoin_chainstate_SOURCES = \ - bitcoin-chainstate.cpp \ +bitcoin_chainstate_SOURCES = bitcoin-chainstate.cpp +bitcoin_chainstate_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) +bitcoin_chainstate_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +bitcoin_chainstate_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) +bitcoin_chainstate_LDADD = $(LIBBITCOINKERNEL) +# + +# bitcoinkernel library # +if BUILD_BITCOIN_KERNEL_LIB +lib_LTLIBRARIES += $(LIBBITCOINKERNEL) + +libbitcoinkernel_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS) $(PTHREAD_FLAGS) +libbitcoinkernel_la_LIBADD = $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) $(LIBSECP256K1) +libbitcoinkernel_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) + +# libbitcoinkernel requires default symbol visibility, explicitly specify that +# here so that things still work even when user configures with +# --enable-reduce-exports +# +# Note this is a quick hack that will be removed as we incrementally define what +# to export from the library. +libbitcoinkernel_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -fvisibility=default + +# TODO: For now, Specify -static in both CXXFLAGS and LDFLAGS when building for +# windows targets so libtool will only build a static version of this +# library. There are unresolved problems when building dll's for mingw-w64 +# and attempting to statically embed libstdc++, libpthread, etc. +if TARGET_WINDOWS +libbitcoinkernel_la_LDFLAGS += -static +libbitcoinkernel_la_CXXFLAGS += -static +endif + +libbitcoinkernel_la_SOURCES = \ kernel/bitcoinkernel.cpp \ arith_uint256.cpp \ blockfilter.cpp \ @@ -879,19 +914,11 @@ bitcoin_chainstate_SOURCES = \ validationinterface.cpp \ versionbits.cpp \ warnings.cpp -bitcoin_chainstate_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -bitcoin_chainstate_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bitcoin_chainstate_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) -bitcoin_chainstate_LDADD = \ - $(LIBBITCOIN_CRYPTO) \ - $(LIBUNIVALUE) \ - $(LIBSECP256K1) \ - $(LIBLEVELDB) \ - $(LIBMEMENV) # Required for obj/build.h to be generated first. # More details: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html -bitcoin_chainstate-clientversion.$(OBJEXT): obj/build.h +libbitcoinkernel_la-clientversion.l$(OBJEXT): obj/build.h +endif # BUILD_BITCOIN_KERNEL_LIB # # bitcoinconsensus library # -- cgit v1.2.3 From 3f0595095dd6d230dc661641227937e3ab4ca8d3 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Fri, 22 Apr 2022 13:28:33 -0400 Subject: docs: Add libbitcoinkernel_la_SOURCES explanation --- src/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 4121f1ca4c..fe8dcc753c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -834,6 +834,10 @@ libbitcoinkernel_la_LDFLAGS += -static libbitcoinkernel_la_CXXFLAGS += -static endif +# TODO: libbitcoinkernel is a work in progress consensus engine library, as more +# and more modules are decoupled from the consensus engine, this list will +# shrink to only those which are absolutely necessary. For example, things +# like index/*.cpp will be removed. libbitcoinkernel_la_SOURCES = \ kernel/bitcoinkernel.cpp \ arith_uint256.cpp \ -- cgit v1.2.3 From 035fa1f07aacb7bce74c0884ae28c8cf00fe3b1b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 27 Apr 2022 20:03:58 +0000 Subject: build: Remove LIBTOOL_APP_LDFLAGS for bitcoin-chainstate See added comment. Note that this won't actually have any effect until we add the mingw-w64 DLL fix since LIBTOOL_APP_LDFLAGS is undefined for other platforms. --- src/Makefile.am | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index fe8dcc753c..5e7120270f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -805,7 +805,11 @@ bitcoin_util_LDADD = \ bitcoin_chainstate_SOURCES = bitcoin-chainstate.cpp bitcoin_chainstate_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) bitcoin_chainstate_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bitcoin_chainstate_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) + +# $(LIBTOOL_APP_LDFLAGS) deliberately omitted here so that we can test linking +# bitcoin-chainstate against libbitcoinkernel as a shared or static library by +# setting --{en,dis}able-shared. +bitcoin_chainstate_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(PTHREAD_FLAGS) bitcoin_chainstate_LDADD = $(LIBBITCOINKERNEL) # -- cgit v1.2.3