monero: update to 0.14.0.0.
This commit is contained in:
parent
0d132d0986
commit
633f9e2d4f
4 changed files with 217 additions and 25 deletions
|
@ -0,0 +1,49 @@
|
|||
From 0cb6a763c1626848a833bccb33023bad49988850 Mon Sep 17 00:00:00 2001
|
||||
From: TheCharlatan <seb.kung@gmail.com>
|
||||
Date: Fri, 22 Feb 2019 15:18:32 +0000
|
||||
Subject: [PATCH] cmake: ARCH_ID fixes for cross compilation
|
||||
|
||||
---
|
||||
CMakeLists.txt | 3 +++
|
||||
contrib/depends/toolchain.cmake.in | 7 +++++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 125642b140..371c92f360 100644
|
||||
--- CMakeLists.txt
|
||||
+++ CMakeLists.txt
|
||||
@@ -115,6 +115,9 @@ string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
|
||||
# to identify the target architecture, to direct logic in this cmake script.
|
||||
# Since ARCH is a cached variable, it will not be set on first cmake invocation.
|
||||
if (NOT ARCH OR ARCH STREQUAL "" OR ARCH STREQUAL "native" OR ARCH STREQUAL "default")
|
||||
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "")
|
||||
+ set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||
+ endif()
|
||||
set(ARCH_ID "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
else()
|
||||
set(ARCH_ID "${ARCH}")
|
||||
diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in
|
||||
index 66168facb4..f11e7e922c 100644
|
||||
--- contrib/depends/toolchain.cmake.in
|
||||
+++ contrib/depends/toolchain.cmake.in
|
||||
@@ -41,6 +41,8 @@ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Find programs on host
|
||||
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
|
||||
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
|
||||
|
||||
+set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR} CACHE STRING "" FORCE)
|
||||
+
|
||||
# specify the cross compiler to be used. Darwin uses clang provided by the SDK.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
SET(CMAKE_C_COMPILER @prefix@/native/bin/clang)
|
||||
@@ -85,6 +87,11 @@ endif()
|
||||
|
||||
if(ARCHITECTURE STREQUAL "i686" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
SET(LINUX_32 ON)
|
||||
+ SET(ARCH_ID "i386")
|
||||
+endif()
|
||||
+
|
||||
+if(ARCHITECTURE STREQUAL "x86_64" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
+ SET(ARCH_ID "x86_64")
|
||||
endif()
|
||||
|
||||
#Create a new global cmake flag that indicates building with depends
|
|
@ -1,22 +0,0 @@
|
|||
From 3bb4b0d41f76483c4ae4d8d62faa4531049badeb Mon Sep 17 00:00:00 2001
|
||||
From: moneromooo-monero <moneromooo-monero@users.noreply.github.com>
|
||||
Date: Mon, 22 Oct 2018 22:17:15 +0000
|
||||
Subject: [PATCH] miner: fix build with boost 1.69
|
||||
|
||||
---
|
||||
src/cryptonote_basic/miner.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git src/cryptonote_basic/miner.cpp src/cryptonote_basic/miner.cpp
|
||||
index d0b03593ed..d8ca2dd357 100644
|
||||
--- src/cryptonote_basic/miner.cpp
|
||||
+++ src/cryptonote_basic/miner.cpp
|
||||
@@ -637,7 +637,7 @@ namespace cryptonote
|
||||
boost::tribool battery_powered(on_battery_power());
|
||||
if(!indeterminate( battery_powered ))
|
||||
{
|
||||
- on_ac_power = !battery_powered;
|
||||
+ on_ac_power = !(bool)battery_powered;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
From 773509ddd8f2b35a3a7f3e0a0414317be821b0ad Mon Sep 17 00:00:00 2001
|
||||
From: moneromooo-monero <moneromooo-monero@users.noreply.github.com>
|
||||
Date: Thu, 21 Feb 2019 19:14:19 +0000
|
||||
Subject: [PATCH] slow-hash: fix build on arm
|
||||
|
||||
---
|
||||
src/crypto/CMakeLists.txt | 5 +++-
|
||||
src/crypto/CryptonightR_JIT.c | 4 +++
|
||||
src/crypto/CryptonightR_JIT.h | 6 +++-
|
||||
src/crypto/slow-hash.c | 54 +++++++++++++++++++----------------
|
||||
4 files changed, 42 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt
|
||||
index 5ce43be222..6e774b8d50 100644
|
||||
--- src/crypto/CMakeLists.txt
|
||||
+++ src/crypto/CMakeLists.txt
|
||||
@@ -46,9 +46,12 @@ set(crypto_sources
|
||||
skein.c
|
||||
slow-hash.c
|
||||
CryptonightR_JIT.c
|
||||
- CryptonightR_template.S
|
||||
tree-hash.c)
|
||||
|
||||
+if(ARCH_ID STREQUAL "i386" OR ARCH_ID STREQUAL "x86_64" OR ARCH_ID STREQUAL "x86-64")
|
||||
+list(APPEND crypto_sources CryptonightR_template.S)
|
||||
+endif()
|
||||
+
|
||||
set(crypto_headers)
|
||||
|
||||
set(crypto_private_headers
|
||||
diff --git a/src/crypto/CryptonightR_JIT.c b/src/crypto/CryptonightR_JIT.c
|
||||
index 1667bf8165..552ba92c08 100644
|
||||
--- src/crypto/CryptonightR_JIT.c
|
||||
+++ src/crypto/CryptonightR_JIT.c
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "CryptonightR_template.h"
|
||||
|
||||
static const uint8_t prologue[] = {
|
||||
+#if defined __i386 || defined __x86_64__
|
||||
0x4C, 0x8B, 0xD7, // mov r10, rdi
|
||||
0x53, // push rbx
|
||||
0x55, // push rbp
|
||||
@@ -26,9 +27,11 @@ static const uint8_t prologue[] = {
|
||||
0x41, 0x8B, 0x42, 0x18, // mov eax, DWORD PTR [r10+24]
|
||||
0x41, 0x8B, 0x52, 0x1C, // mov edx, DWORD PTR [r10+28]
|
||||
0x45, 0x8B, 0x4A, 0x20, // mov r9d, DWORD PTR [r10+32]
|
||||
+#endif
|
||||
};
|
||||
|
||||
static const uint8_t epilogue[] = {
|
||||
+#if defined __i386 || defined __x86_64__
|
||||
0x49, 0x8B, 0xE3, // mov rsp, r11
|
||||
0x41, 0x89, 0x1A, // mov DWORD PTR [r10], ebx
|
||||
0x41, 0x89, 0x72, 0x04, // mov DWORD PTR [r10+4], esi
|
||||
@@ -38,6 +41,7 @@ static const uint8_t epilogue[] = {
|
||||
0x5D, // pop rbp
|
||||
0x5B, // pop rbx
|
||||
0xC3, // ret
|
||||
+#endif
|
||||
};
|
||||
|
||||
#define APPEND_CODE(src, size) \
|
||||
diff --git a/src/crypto/CryptonightR_JIT.h b/src/crypto/CryptonightR_JIT.h
|
||||
index 5f689b37be..cb32c3a799 100644
|
||||
--- src/crypto/CryptonightR_JIT.h
|
||||
+++ src/crypto/CryptonightR_JIT.h
|
||||
@@ -8,7 +8,11 @@
|
||||
// - Call v4_generate_JIT_code with "buf" pointed to memory allocated on previous step
|
||||
// - Call the generated code instead of "v4_random_math(code, r)", omit the "code" parameter
|
||||
|
||||
-typedef void (*v4_random_math_JIT_func)(uint32_t* r) __attribute__((sysv_abi));
|
||||
+typedef void (*v4_random_math_JIT_func)(uint32_t* r)
|
||||
+#if defined __i386 || defined __x86_64__
|
||||
+__attribute__((sysv_abi))
|
||||
+#endif
|
||||
+;
|
||||
|
||||
// Given the random math sequence, generates machine code (x86-64) for it
|
||||
// Returns 0 if code was generated successfully
|
||||
diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c
|
||||
index d823634fc0..a41b004775 100644
|
||||
--- src/crypto/slow-hash.c
|
||||
+++ src/crypto/slow-hash.c
|
||||
@@ -65,6 +65,31 @@ static void local_abort(const char *msg)
|
||||
#endif
|
||||
}
|
||||
|
||||
+volatile int use_v4_jit_flag = -1;
|
||||
+
|
||||
+static inline int use_v4_jit(void)
|
||||
+{
|
||||
+#if defined(__x86_64__)
|
||||
+
|
||||
+ if (use_v4_jit_flag != -1)
|
||||
+ return use_v4_jit_flag;
|
||||
+
|
||||
+ const char *env = getenv("MONERO_USE_CNV4_JIT");
|
||||
+ if (!env) {
|
||||
+ use_v4_jit_flag = 0;
|
||||
+ }
|
||||
+ else if (!strcmp(env, "0") || !strcmp(env, "no")) {
|
||||
+ use_v4_jit_flag = 0;
|
||||
+ }
|
||||
+ else {
|
||||
+ use_v4_jit_flag = 1;
|
||||
+ }
|
||||
+ return use_v4_jit_flag;
|
||||
+#else
|
||||
+ return 0;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
#define VARIANT1_1(p) \
|
||||
do if (variant == 1) \
|
||||
{ \
|
||||
@@ -494,31 +519,6 @@ STATIC INLINE int force_software_aes(void)
|
||||
return use;
|
||||
}
|
||||
|
||||
-volatile int use_v4_jit_flag = -1;
|
||||
-
|
||||
-STATIC INLINE int use_v4_jit(void)
|
||||
-{
|
||||
-#if defined(__x86_64__)
|
||||
-
|
||||
- if (use_v4_jit_flag != -1)
|
||||
- return use_v4_jit_flag;
|
||||
-
|
||||
- const char *env = getenv("MONERO_USE_CNV4_JIT");
|
||||
- if (!env) {
|
||||
- use_v4_jit_flag = 0;
|
||||
- }
|
||||
- else if (!strcmp(env, "0") || !strcmp(env, "no")) {
|
||||
- use_v4_jit_flag = 0;
|
||||
- }
|
||||
- else {
|
||||
- use_v4_jit_flag = 1;
|
||||
- }
|
||||
- return use_v4_jit_flag;
|
||||
-#else
|
||||
- return 0;
|
||||
-#endif
|
||||
-}
|
||||
-
|
||||
STATIC INLINE int check_aes_hw(void)
|
||||
{
|
||||
int cpuid_results[4];
|
||||
@@ -1029,6 +1029,8 @@ void slow_hash_free_state(void)
|
||||
|
||||
#define U64(x) ((uint64_t *) (x))
|
||||
|
||||
+#define hp_jitfunc ((v4_random_math_JIT_func)NULL)
|
||||
+
|
||||
STATIC INLINE void xor64(uint64_t *a, const uint64_t b)
|
||||
{
|
||||
*a ^= b;
|
||||
@@ -1574,6 +1576,8 @@ void cn_slow_hash(const void *data, size_t length, char *hash, int variant, int
|
||||
#else
|
||||
// Portable implementation as a fallback
|
||||
|
||||
+#define hp_jitfunc ((v4_random_math_JIT_func)NULL)
|
||||
+
|
||||
void slow_hash_allocate_state(void)
|
||||
{
|
||||
// Do nothing, this is just to maintain compatibility with the upgraded slow-hash.c
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'monero'
|
||||
pkgname=monero
|
||||
version=0.13.0.4
|
||||
revision=4
|
||||
version=0.14.0.0
|
||||
revision=1
|
||||
build_style=cmake
|
||||
configure_args="-DBUILD_GUI_DEPS=ON -DHAVE_LIBRESSL=1"
|
||||
conf_files="/etc/monerod.conf"
|
||||
|
@ -17,7 +17,7 @@ maintainer="Helmut Pozimski <helmut@pozimski.eu>"
|
|||
license="BSD-3-Clause"
|
||||
homepage="https://getmonero.org"
|
||||
distfiles="https://github.com/monero-project/monero/archive/v${version}.tar.gz"
|
||||
checksum=93158879f2890021ae75b31f4b81ad8026ce5b626da1f2fc44ab70657bfa512c
|
||||
checksum=8f5c4f517020eb30db7f0d9bd6bc9eac0823cb03f3dbb49c6d2ab0239ebf5f74
|
||||
system_accounts="monero"
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
|
|
Loading…
Reference in a new issue