diff options
-rw-r--r-- | CMakeLists.txt | 20 | ||||
-rw-r--r-- | README.md | 22 | ||||
-rw-r--r-- | external/unbound/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/crypto/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/crypto/slow-hash.c | 6 | ||||
-rw-r--r-- | tests/unit_tests/block_reward.cpp | 2 |
7 files changed, 40 insertions, 24 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 98ac1b600..0b0ce5a4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -497,8 +497,18 @@ else() endif() # Since gcc 4.9 the LTO format is non-standard (slim), so we need the gcc-specific ar and ranlib binaries if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0) AND NOT OPENBSD) - set(CMAKE_AR "gcc-ar") - set(CMAKE_RANLIB "gcc-ranlib") + # When invoking cmake on distributions on which gcc's binaries are prefix + # with an arch-specific triplet, the user has to either specify + # -DCHOST=... or -DCMAKE_AR=... and -DCMAKE_RANLIB=... + if (DEFINED CHOST) + set(CHOST_PREFIX "${CHOST}-") + endif() + if (NOT DEFINED CMAKE_AR) + set(CMAKE_AR "${CHOST_PREFIX}gcc-ar") + endif() + if (NOT DEFINED CMAKE_RANLIB) + set(CMAKE_RANLIB "${CHOST_PREFIX}gcc-ranlib") + endif() endif() endif() @@ -603,7 +613,11 @@ if(BUILD_DOCUMENTATION) endif() endif() -# when ON - will install libunbound and libwallet_merged into "lib" +# when ON - will install libwallet_merged into "lib" option(BUILD_GUI_DEPS "Build GUI dependencies." OFF) +# This is not nice, distribution packagers should not enable this, but depend +# on libunbound shipped with their distribution instead +option(INSTALL_VENDORED_LIBUNBOUND "Install libunbound binary built from source vendored with this repo." OFF) + @@ -147,6 +147,11 @@ invokes cmake commands as needed. make release-static +* **Optional**: build documentation in `doc/html` (omit `HAVE_DOT=YES` if `graphviz` is not installed): + + HAVE_DOT=YES doxygen Doxyfile + + #### On Windows: Binaries for Windows are built on Windows using the MinGW toolchain within @@ -233,23 +238,6 @@ By default, in either dynamically or statically linked builds, binaries target t * ```make release-static-win64``` builds binaries on 64-bit Windows portable across 64-bit Windows systems * ```make release-static-win32``` builds binaries on 64-bit or 32-bit Windows portable across 32-bit Windows systems -### Building Documentation - -Monero developer documentation uses Doxygen, and is currently a work-in-progress. - -Dependencies: Doxygen `>=1.8.0`, Graphviz `>=2.28` (optional). - -* To build the HTML documentation without diagrams, change - to the root of the source code directory, and run - - doxygen Doxyfile - -* To build the HTML documentation with diagrams (Graphviz required): - - HAVE_DOT=YES doxygen Doxyfile - -* The output will be built in doc/html/ - ## Running monerod The build places the binary in `bin/` sub-directory within the build directory diff --git a/external/unbound/CMakeLists.txt b/external/unbound/CMakeLists.txt index 99a44e1a6..4b82fab82 100644 --- a/external/unbound/CMakeLists.txt +++ b/external/unbound/CMakeLists.txt @@ -230,7 +230,7 @@ if (MINGW) endif () -if (BUILD_GUI_DEPS) +if (INSTALL_VENDORED_LIBUNBOUND) install(TARGETS unbound ARCHIVE DESTINATION lib) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6010e3805..55a276f06 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -92,6 +92,8 @@ function (bitmonero_add_library name) set_property(TARGET "${name}" PROPERTY FOLDER "libs") + target_compile_definitions(${objlib} + PRIVATE $<TARGET_PROPERTY:${name},INTERFACE_COMPILE_DEFINITIONS>) endfunction () add_subdirectory(common) diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt index 962ec8a06..ed668022f 100644 --- a/src/crypto/CMakeLists.txt +++ b/src/crypto/CMakeLists.txt @@ -74,3 +74,13 @@ bitmonero_add_library(crypto ${crypto_sources} ${crypto_headers} ${crypto_private_headers}) + +if (ARM) + option(NO_OPTIMIZED_MULTIPLY_ON_ARM + "Compute multiply using generic C implementation instead of ARM ASM" OFF) + if(NO_OPTIMIZED_MULTIPLY_ON_ARM) + message(STATUS "Using generic C implementation for multiply") + set_property(SOURCE slow-hash.c + PROPERTY COMPILE_DEFINITIONS "NO_OPTIMIZED_MULTIPLY_ON_ARM") + endif() +endif() diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c index 8a1807657..a0d2d1302 100644 --- a/src/crypto/slow-hash.c +++ b/src/crypto/slow-hash.c @@ -679,7 +679,7 @@ void slow_hash_free_state(void) #include "aesb.c" -#ifndef ARM_MUL_IMPL_ASM +#ifdef NO_OPTIMIZED_MULTIPLY_ON_ARM /* The asm corresponds to this C code */ #define SHORT uint32_t #define LONG uint64_t @@ -712,7 +712,7 @@ void mul(const uint8_t *ca, const uint8_t *cb, uint8_t *cres) { res[0] = t.tmp[6]; res[1] = t.tmp[7]; } -#else // ARM_MUL_IMPL_ASM (TODO: this fails hash-slow test with GCC 6.1.1) +#else // !NO_OPTIMIZED_MULTIPLY_ON_ARM /* Can work as inline, but actually runs slower. Keep it separate */ #define mul(a, b, c) cn_mul128(a, b, c) @@ -747,7 +747,7 @@ __asm__ __volatile__( : [A]"r"(aa[1]), [a]"r"(aa[0]), [B]"r"(bb[1]), [b]"r"(bb[0]), [r]"r"(r) : "cc", "memory"); } -#endif // ARM_MUL_IMPL_ASM +#endif // NO_OPTIMIZED_MULTIPLY_ON_ARM STATIC INLINE void sum_half_blocks(uint8_t* a, const uint8_t* b) { diff --git a/tests/unit_tests/block_reward.cpp b/tests/unit_tests/block_reward.cpp index e16e2c3ec..5d93c3084 100644 --- a/tests/unit_tests/block_reward.cpp +++ b/tests/unit_tests/block_reward.cpp @@ -138,6 +138,7 @@ namespace ASSERT_FALSE(m_block_not_too_big); } +#ifdef __x86_64__ // For 64-bit systems only, because block size is limited to size_t. TEST_F(block_reward_and_current_block_size, fails_on_huge_median_size) { #if !defined(NDEBUG) @@ -153,6 +154,7 @@ namespace ASSERT_DEATH(do_test(huge_size - 2, huge_size), ""); #endif } +#endif // __x86_64__ //-------------------------------------------------------------------------------------------------------------------- class block_reward_and_last_block_sizes : public ::testing::Test |